Remove classic plugin infra
Summary: This removes all code duplication / old plugin infra that isn't needed anymore when all plugin run on the Sandy plugin infra structure. The diff is quite large, but the minimal one that passes tests and compiles. Existing tests are preserved by wrapping all remaining tests in `wrapSandy` for classic plugins where needed Reviewed By: passy Differential Revision: D29394738 fbshipit-source-id: 1315fabd9f048576aed15ed5f1cb6414d5fdbd40
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9d6abd62c6
commit
16154e1343
@@ -7,7 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {PluginDefinition, FlipperPlugin, FlipperDevicePlugin} from './plugin';
|
||||
import {PluginDefinition} from './plugin';
|
||||
import BaseDevice, {OS} from './devices/BaseDevice';
|
||||
import {Logger} from './fb-interfaces/Logger';
|
||||
import {Store} from './reducers/index';
|
||||
@@ -21,7 +21,6 @@ import invariant from 'invariant';
|
||||
import {
|
||||
getPluginKey,
|
||||
defaultEnabledBackgroundPlugins,
|
||||
isSandyPlugin,
|
||||
} from './utils/pluginUtils';
|
||||
import {processMessagesLater} from './utils/messageQueue';
|
||||
import {emitBytesReceived} from './dispatcher/tracking';
|
||||
@@ -118,10 +117,7 @@ export default class Client extends EventEmitter {
|
||||
messageBuffer: Record<
|
||||
string /*pluginKey*/,
|
||||
{
|
||||
plugin:
|
||||
| typeof FlipperPlugin
|
||||
| typeof FlipperDevicePlugin
|
||||
| _SandyPluginInstance;
|
||||
plugin: _SandyPluginInstance;
|
||||
messages: Params[];
|
||||
}
|
||||
> = {};
|
||||
@@ -220,7 +216,7 @@ export default class Client extends EventEmitter {
|
||||
initFromImport(initialStates: Record<string, Record<string, any>>): this {
|
||||
this.plugins.forEach((pluginId) => {
|
||||
const plugin = this.getPlugin(pluginId);
|
||||
if (isSandyPlugin(plugin)) {
|
||||
if (plugin) {
|
||||
// TODO: needs to be wrapped in error tracking T68955280
|
||||
this.sandyPluginStates.set(
|
||||
plugin.id,
|
||||
@@ -253,7 +249,7 @@ export default class Client extends EventEmitter {
|
||||
) {
|
||||
// start a plugin on start if it is a SandyPlugin, which is enabled, and doesn't have persisted state yet
|
||||
if (
|
||||
isSandyPlugin(plugin) &&
|
||||
plugin &&
|
||||
(isEnabled || defaultEnabledBackgroundPlugins.includes(plugin.id)) &&
|
||||
!this.sandyPluginStates.has(plugin.id)
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user