Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
Kill onRegisterDevice
Browse files Browse the repository at this point in the history
Summary: `onRegisterDevice` device abstraction was only used by the CrashReporterPlugin, and since with Sandy plugin lifecycles every plugin can do 'on-load' logic, we don't need it anymore.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27046711

fbshipit-source-id: 16c567c60ed29a50017d525a2b707ee696a99e62
  • Loading branch information
mweststrate authored and facebook-github-bot committed Mar 16, 2021
1 parent 87c5fab commit 6a30899
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 85 deletions.
8 changes: 0 additions & 8 deletions desktop/app/src/dispatcher/androidDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import child_process from 'child_process';
import {Store} from '../reducers/index';
import BaseDevice from '../devices/BaseDevice';
import {Logger} from '../fb-interfaces/Logger';
import {registerDeviceCallbackOnPlugins} from '../utils/onRegisterDevice';
import {getAdbClient} from '../utils/adbClient';
import which from 'which';
import {promisify} from 'util';
Expand Down Expand Up @@ -248,13 +247,6 @@ export default (store: Store, logger: Logger) => {
type: 'REGISTER_DEVICE',
payload: androidDevice,
});

registerDeviceCallbackOnPlugins(
store,
store.getState().plugins.devicePlugins,
store.getState().plugins.clientPlugins,
androidDevice,
);
}

async function unregisterDevices(deviceIds: Array<string>) {
Expand Down
7 changes: 0 additions & 7 deletions desktop/app/src/dispatcher/iOSDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import child_process from 'child_process';
const execFile = child_process.execFile;
import iosUtil from '../utils/iOSContainerUtility';
import IOSDevice from '../devices/IOSDevice';
import {registerDeviceCallbackOnPlugins} from '../utils/onRegisterDevice';
import {addErrorNotification} from '../reducers/notifications';
import {getStaticPath} from '../utils/pathUtils';
import {destroyDevice} from '../reducers/connections';
Expand Down Expand Up @@ -176,12 +175,6 @@ function processDevices(
type: 'REGISTER_DEVICE',
payload: iOSDevice,
});
registerDeviceCallbackOnPlugins(
store,
store.getState().plugins.devicePlugins,
store.getState().plugins.clientPlugins,
iOSDevice,
);
}
}

Expand Down
8 changes: 0 additions & 8 deletions desktop/app/src/dispatcher/metroDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import {Store} from '../reducers/index';
import {Logger} from '../fb-interfaces/Logger';
import {registerDeviceCallbackOnPlugins} from '../utils/onRegisterDevice';
import MetroDevice from '../devices/MetroDevice';
import http from 'http';
import {addErrorNotification} from '../reducers/notifications';
Expand Down Expand Up @@ -67,13 +66,6 @@ export async function registerMetroDevice(
payload: metroDevice,
serial: METRO_URL,
});

registerDeviceCallbackOnPlugins(
store,
store.getState().plugins.devicePlugins,
store.getState().plugins.clientPlugins,
metroDevice,
);
}

export default (store: Store, logger: Logger) => {
Expand Down
10 changes: 0 additions & 10 deletions desktop/app/src/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,6 @@ export abstract class FlipperBasePlugin<
static getActiveNotifications:
| ((persistedState: StaticPersistedState) => Array<Notification>)
| undefined;
static onRegisterDevice:
| ((
store: Store,
baseDevice: BaseDevice,
setPersistedState: (
pluginKey: string,
newPluginState: StaticPersistedState | null,
) => void,
) => void)
| null;

reducers: {
[actionName: string]: (state: State, actionData: any) => Partial<State>;
Expand Down
52 changes: 0 additions & 52 deletions desktop/app/src/utils/onRegisterDevice.tsx

This file was deleted.

0 comments on commit 6a30899

Please sign in to comment.