Load bundled server add-ons
Reviewed By: antonk52 Differential Revision: D34238883 fbshipit-source-id: 01b4b1c1c0a63cbfb639e903f6a77307ae370330
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b655efc78e
commit
2ce037d96b
@@ -16,13 +16,22 @@ import {
|
||||
} from 'flipper-common';
|
||||
import {ServerAddOnDesktopToModuleConnection} from './ServerAddOnDesktopToModuleConnection';
|
||||
import {ServerAddOnModuleToDesktopConnection} from './ServerAddOnModuleToDesktopConnection';
|
||||
// @ts-ignore
|
||||
import defaultPlugins from '../defaultPlugins';
|
||||
|
||||
interface ServerAddOnModule {
|
||||
default?: ServerAddOnFn;
|
||||
default: ServerAddOnFn;
|
||||
}
|
||||
|
||||
const loadPlugin = (_pluginName: string): ServerAddOnModule => {
|
||||
// TODO: Implement me
|
||||
const loadPlugin = (pluginName: string): ServerAddOnModule => {
|
||||
console.debug('loadPlugin', pluginName);
|
||||
|
||||
const bundledPlugin = defaultPlugins[pluginName];
|
||||
if (bundledPlugin) {
|
||||
return bundledPlugin;
|
||||
}
|
||||
|
||||
// TODO: Use getInstalledPlugin
|
||||
return {default: async () => async () => {}};
|
||||
};
|
||||
|
||||
@@ -51,7 +60,7 @@ export class ServerAddOn {
|
||||
assertNotNull(serverAddOn);
|
||||
assert(
|
||||
typeof serverAddOn === 'function',
|
||||
`ServerAddOn ${pluginName} must export "serverAddOn" function.`,
|
||||
`ServerAddOn ${pluginName} must export "serverAddOn" function as a default export.`,
|
||||
);
|
||||
|
||||
const serverAddOnModuleToDesktopConnection =
|
||||
|
||||
Reference in New Issue
Block a user