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';
|
||||
|
||||
interface ServerAddOnModule {
|
||||
serverAddOn?: ServerAddOnFn;
|
||||
default?: ServerAddOnFn;
|
||||
}
|
||||
|
||||
const loadPlugin = (_pluginName: string): ServerAddOnModule => {
|
||||
// TODO: Implement me
|
||||
return {serverAddOn: async () => async () => {}};
|
||||
return {default: async () => async () => {}};
|
||||
};
|
||||
|
||||
// TODO: Fix potential race conditions when starting/stopping concurrently
|
||||
@@ -47,7 +47,7 @@ export class ServerAddOn {
|
||||
): Promise<ServerAddOn> {
|
||||
console.info('ServerAddOn.start', pluginName);
|
||||
|
||||
const {serverAddOn} = loadPlugin(pluginName);
|
||||
const {default: serverAddOn} = loadPlugin(pluginName);
|
||||
assertNotNull(serverAddOn);
|
||||
assert(
|
||||
typeof serverAddOn === 'function',
|
||||
|
||||
Reference in New Issue
Block a user