Remove Newsfeed Story Inspector and native plugin mechanism

Summary: Changelog: The 'nativeplugins' on Android are no longer supported

Reviewed By: jknoxville

Differential Revision: D29163281

fbshipit-source-id: fb4032f240fc306608fe57479f3124d4e7a3400f
This commit is contained in:
Michel Weststrate
2021-06-21 05:38:26 -07:00
committed by Facebook GitHub Bot
parent 244e3a434c
commit 07199323d1
20 changed files with 2 additions and 1267 deletions

View File

@@ -18,7 +18,6 @@ import {reportPluginFailures} from './utils/metrics';
import {notNull} from './utils/typeUtils';
import {default as isProduction} from './utils/isProduction';
import {registerPlugins} from './reducers/plugins';
import createTableNativePlugin from './plugins/TableNativePlugin';
import {EventEmitter} from 'events';
import invariant from 'invariant';
import {
@@ -241,27 +240,11 @@ export default class Client extends EventEmitter {
// get the supported plugins
async loadPlugins(): Promise<Plugins> {
const plugins = await this.rawCall<{plugins: Plugins}>(
const {plugins} = await this.rawCall<{plugins: Plugins}>(
'getPlugins',
false,
).then((data) => data.plugins);
);
this.plugins = plugins;
const nativeplugins = plugins
.map((plugin) => /_nativeplugin_([^_]+)_([^_]+)/.exec(plugin))
.filter(notNull)
.map(([id, type, title]) => {
// TODO put this in another component, and make the "types" registerable
console.warn(`TableNative plugins are deprecated: ${id}`);
switch (type) {
case 'Table':
return createTableNativePlugin(id, title);
default: {
return null;
}
}
})
.filter(Boolean);
this.store.dispatch(registerPlugins(nativeplugins as any));
return plugins;
}