Migrate to default exports for server add-ons
Reviewed By: antonk52 Differential Revision: D34201906 fbshipit-source-id: 3ee2bf831d5a1f5c6c9252acce1b1731462871f1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5cdb7c952e
commit
b655efc78e
@@ -18,12 +18,12 @@ import {ServerAddOnDesktopToModuleConnection} from './ServerAddOnDesktopToModule
|
|||||||
import {ServerAddOnModuleToDesktopConnection} from './ServerAddOnModuleToDesktopConnection';
|
import {ServerAddOnModuleToDesktopConnection} from './ServerAddOnModuleToDesktopConnection';
|
||||||
|
|
||||||
interface ServerAddOnModule {
|
interface ServerAddOnModule {
|
||||||
serverAddOn?: ServerAddOnFn;
|
default?: ServerAddOnFn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadPlugin = (_pluginName: string): ServerAddOnModule => {
|
const loadPlugin = (_pluginName: string): ServerAddOnModule => {
|
||||||
// TODO: Implement me
|
// TODO: Implement me
|
||||||
return {serverAddOn: async () => async () => {}};
|
return {default: async () => async () => {}};
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Fix potential race conditions when starting/stopping concurrently
|
// TODO: Fix potential race conditions when starting/stopping concurrently
|
||||||
@@ -47,7 +47,7 @@ export class ServerAddOn {
|
|||||||
): Promise<ServerAddOn> {
|
): Promise<ServerAddOn> {
|
||||||
console.info('ServerAddOn.start', pluginName);
|
console.info('ServerAddOn.start', pluginName);
|
||||||
|
|
||||||
const {serverAddOn} = loadPlugin(pluginName);
|
const {default: serverAddOn} = loadPlugin(pluginName);
|
||||||
assertNotNull(serverAddOn);
|
assertNotNull(serverAddOn);
|
||||||
assert(
|
assert(
|
||||||
typeof serverAddOn === 'function',
|
typeof serverAddOn === 'function',
|
||||||
|
|||||||
Reference in New Issue
Block a user