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:
Andrey Goncharov
2022-09-15 10:02:19 -07:00
committed by Facebook GitHub Bot
parent 94df830dfb
commit 642a3ebf81
16 changed files with 55 additions and 164 deletions

View File

@@ -138,7 +138,6 @@ export interface RenderHost {
shouldUseDarkColors(): boolean;
restartFlipper(update?: boolean): void;
openLink(url: string): void;
loadDefaultPlugins(): Record<string, any>;
GK(gatekeeper: string): boolean;
flipperServer: FlipperServer;
serverConfig: FlipperServerConfig;

View File

@@ -25,7 +25,6 @@ import {getRenderHostInstance} from './RenderHost';
import pMap from 'p-map';
export abstract class AbstractPluginInitializer {
protected defaultPluginsIndex: any = null;
protected gatekeepedPlugins: Array<ActivatablePluginDetails> = [];
protected disabledPlugins: Array<ActivatablePluginDetails> = [];
protected failedPlugins: Array<[ActivatablePluginDetails, string]> = [];
@@ -48,7 +47,6 @@ export abstract class AbstractPluginInitializer {
}
protected async _init(): Promise<_SandyPluginDefinition[]> {
this.loadDefaultPluginIndex();
this.loadMarketplacePlugins();
const uninstalledPluginNames = this.loadUninstalledPluginNames();
const allLocalVersions = await this.loadAllLocalVersions(
@@ -65,9 +63,6 @@ export abstract class AbstractPluginInitializer {
pluginDetails: ActivatablePluginDetails,
): Promise<_SandyPluginDefinition>;
protected loadDefaultPluginIndex() {
this.defaultPluginsIndex = getRenderHostInstance().loadDefaultPlugins();
}
protected loadMarketplacePlugins() {}
protected loadUninstalledPluginNames(): Set<string> {
return new Set();
@@ -75,15 +70,10 @@ export abstract class AbstractPluginInitializer {
protected async loadAllLocalVersions(
uninstalledPluginNames: Set<string>,
): Promise<(BundledPluginDetails | InstalledPluginDetails)[]> {
this.bundledPlugins = Object.values(this.defaultPluginsIndex).map(
(defaultPluginEntry: any) => defaultPluginEntry.description,
const allLocalVersions = [...(await getDynamicPlugins())].filter(
(p) => !uninstalledPluginNames.has(p.name),
);
const allLocalVersions = [
...(await getDynamicPlugins()),
...this.bundledPlugins,
].filter((p) => !uninstalledPluginNames.has(p.name));
return allLocalVersions;
}
protected async filterAllLocalVersions(