Migrate application from js to tsx
Summary: As per the title Reviewed By: jknoxville Differential Revision: D16690005 fbshipit-source-id: 8975da8aa7221b731358eacb4040f48198bf073b
This commit is contained in:
committed by
Facebook Github Bot
parent
03b5b133b8
commit
c3807a6ba2
@@ -5,7 +5,7 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {uriComponents} from '../application.js';
|
import {uriComponents} from '../application.tsx';
|
||||||
|
|
||||||
test('test parsing of deeplink URL', () => {
|
test('test parsing of deeplink URL', () => {
|
||||||
const url = 'flipper://app/plugin/meta/data';
|
const url = 'flipper://app/plugin/meta/data';
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {remote, ipcRenderer} from 'electron';
|
import {remote, ipcRenderer} from 'electron';
|
||||||
import type {Store} from '../reducers/index.tsx';
|
import {toggleAction} from '../reducers/application';
|
||||||
import type {Logger} from '../fb-interfaces/Logger.js';
|
import {Store} from '../reducers/index.js';
|
||||||
import {toggleAction} from '../reducers/application.tsx';
|
import {Logger} from '../fb-interfaces/Logger.js';
|
||||||
import {parseFlipperPorts} from '../utils/environmentVariables';
|
import {parseFlipperPorts} from '../utils/environmentVariables';
|
||||||
import {
|
import {
|
||||||
importDataToStore,
|
importDataToStore,
|
||||||
@@ -17,21 +17,21 @@ import {
|
|||||||
} from '../utils/exportData';
|
} from '../utils/exportData';
|
||||||
import {tryCatchReportPlatformFailures} from '../utils/metrics';
|
import {tryCatchReportPlatformFailures} from '../utils/metrics';
|
||||||
|
|
||||||
import {selectPlugin} from '../reducers/connections.tsx';
|
import {selectPlugin} from '../reducers/connections';
|
||||||
import qs from 'query-string';
|
import qs from 'query-string';
|
||||||
|
|
||||||
export const uriComponents = (url: string) => {
|
export const uriComponents = (url: string): Array<string> => {
|
||||||
if (!url) {
|
if (!url) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const match: ?Array<string> = url.match(
|
const match: Array<string> | undefined | null = url.match(
|
||||||
/^flipper:\/\/([^\/]*)\/([^\/]*)\/?(.*)$/,
|
/^flipper:\/\/([^\/]*)\/([^\/]*)\/?(.*)$/,
|
||||||
);
|
);
|
||||||
if (match) {
|
if (match) {
|
||||||
return (match
|
return match
|
||||||
.map(decodeURIComponent)
|
.map(decodeURIComponent)
|
||||||
.slice(1)
|
.slice(1)
|
||||||
.filter(Boolean): Array<string>);
|
.filter(Boolean);
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
@@ -54,7 +54,7 @@ export default (store: Store, logger: Logger) => {
|
|||||||
ipcRenderer.on('flipper-protocol-handler', (event, url) => {
|
ipcRenderer.on('flipper-protocol-handler', (event, url) => {
|
||||||
if (url.startsWith('flipper://import')) {
|
if (url.startsWith('flipper://import')) {
|
||||||
const {search} = new URL(url);
|
const {search} = new URL(url);
|
||||||
const download = qs.parse(search)?.url;
|
const download = qs.parse(search) ? qs.parse(search) : undefined;
|
||||||
store.dispatch(toggleAction('downloadingImportData', true));
|
store.dispatch(toggleAction('downloadingImportData', true));
|
||||||
return (
|
return (
|
||||||
download &&
|
download &&
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
import androidDevice from './androidDevice.tsx';
|
import androidDevice from './androidDevice.tsx';
|
||||||
import iOSDevice from './iOSDevice';
|
import iOSDevice from './iOSDevice';
|
||||||
import desktopDevice from './desktopDevice';
|
import desktopDevice from './desktopDevice';
|
||||||
import application from './application';
|
import application from './application.tsx';
|
||||||
import tracking from './tracking.tsx';
|
import tracking from './tracking.tsx';
|
||||||
import server from './server.tsx';
|
import server from './server.tsx';
|
||||||
import notifications from './notifications';
|
import notifications from './notifications';
|
||||||
|
|||||||
Reference in New Issue
Block a user