Remove default plugin entrypoints for hot-reloading
Summary: As we stopped bundling plugins in D39276249, we no longer need the entry points for the bundled plugins (these entry points are always going to be empty) Reviewed By: lblasa Differential Revision: D39307565 fbshipit-source-id: 43751fe31c8bd962677c226b27cfe52093d3f2d4
This commit is contained in:
committed by
Facebook GitHub Bot
parent
94df830dfb
commit
642a3ebf81
@@ -8,7 +8,11 @@
|
||||
*/
|
||||
|
||||
import type {Store} from '../reducers/index';
|
||||
import {Logger, MarketplacePluginDetails} from 'flipper-common';
|
||||
import {
|
||||
InstalledPluginDetails,
|
||||
Logger,
|
||||
MarketplacePluginDetails,
|
||||
} from 'flipper-common';
|
||||
import {PluginDefinition} from '../plugin';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
@@ -83,7 +87,7 @@ class UIPluginInitializer extends AbstractPluginInitializer {
|
||||
}
|
||||
|
||||
public requirePluginImpl(pluginDetails: ActivatablePluginDetails) {
|
||||
return requirePluginInternal(this.defaultPluginsIndex, pluginDetails);
|
||||
return requirePluginInternal(pluginDetails);
|
||||
}
|
||||
|
||||
protected loadMarketplacePlugins() {
|
||||
@@ -123,12 +127,11 @@ export const requirePlugin = (pluginDetails: ActivatablePluginDetails) =>
|
||||
)(pluginDetails);
|
||||
|
||||
export const requirePluginInternal = async (
|
||||
defaultPluginsIndex: any,
|
||||
pluginDetails: ActivatablePluginDetails,
|
||||
): Promise<PluginDefinition> => {
|
||||
let plugin = pluginDetails.isBundled
|
||||
? defaultPluginsIndex[pluginDetails.name].source
|
||||
: await getRenderHostInstance().requirePlugin(pluginDetails.entry);
|
||||
let plugin = await getRenderHostInstance().requirePlugin(
|
||||
(pluginDetails as InstalledPluginDetails).entry,
|
||||
);
|
||||
if (!plugin) {
|
||||
throw new Error(
|
||||
`Failed to obtain plugin source for: ${pluginDetails.name}`,
|
||||
|
||||
Reference in New Issue
Block a user