Unbundle less popular plugins for Insiders builds

Summary: Unbundle most of plugins from Insiders version of Flipper. Users will need to install them from Marketplace.

Reviewed By: passy

Differential Revision: D25558043

fbshipit-source-id: 648b0d4c83d9096972b5463cdcaa3de23426bdda
This commit is contained in:
Anton Nikolaev
2020-12-15 09:28:58 -08:00
committed by Facebook GitHub Bot
parent 3a65f86c68
commit c14bab3677
3 changed files with 48 additions and 14 deletions

View File

@@ -262,7 +262,7 @@ function downloadIcons(buildFolder: string) {
console.log('Created build directory', dir); console.log('Created build directory', dir);
await compileMain(); await compileMain();
await generatePluginEntryPoints(); await generatePluginEntryPoints(argv.channel === 'insiders');
await copyStaticFolder(dir); await copyStaticFolder(dir);
await downloadIcons(dir); await downloadIcons(dir);
await compileRenderer(dir); await compileRenderer(dir);

View File

@@ -30,15 +30,49 @@ const {version} = require('../package.json');
const dev = process.env.NODE_ENV !== 'production'; const dev = process.env.NODE_ENV !== 'production';
// For insiders builds we bundle into them all the device plugins,
// plus top 10 "universal" plugins starred by more than 100 users.
const hardcodedPlugins = new Set<string>([
// Device plugins
'DeviceLogs',
'CrashReporter',
'MobileBuilds',
'DeviceCPU',
'Tracery',
'Hermesdebuggerrn',
'kaios-big-allocations',
'kaios-graphs',
'React',
// Popular client plugins
'Inspector',
'Network',
'AnalyticsLogging',
'GraphQL',
'UIPerf',
'MobileConfig',
'Databases',
'FunnelLogger',
'Navigation',
'Fresco',
'Preferences',
]);
export function die(err: Error) { export function die(err: Error) {
console.error(err.stack); console.error(err.stack);
process.exit(1); process.exit(1);
} }
export async function generatePluginEntryPoints() { export async function generatePluginEntryPoints(
console.log('⚙️ Generating plugin entry points...'); isInsidersBuild: boolean = false,
) {
console.log(
`⚙️ Generating plugin entry points (isInsidersBuils=${isInsidersBuild})...`,
);
const sourcePlugins = await getSourcePlugins(); const sourcePlugins = await getSourcePlugins();
const bundledPlugins = sourcePlugins.map( const bundledPlugins = sourcePlugins
// we only include predefined set of plugins into insiders release
.filter((p) => !isInsidersBuild || hardcodedPlugins.has(p.id))
.map(
(p) => (p) =>
({ ({
...p, ...p,

View File

@@ -381,7 +381,7 @@ function checkDevServer() {
(async () => { (async () => {
checkDevServer(); checkDevServer();
await generatePluginEntryPoints(); await generatePluginEntryPoints(argv.channel === 'insiders');
await ensurePluginFoldersWatchable(); await ensurePluginFoldersWatchable();
const port = await detect(DEFAULT_PORT); const port = await detect(DEFAULT_PORT);
const {app, server} = await startAssetServer(port); const {app, server} = await startAssetServer(port);