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:
committed by
Facebook GitHub Bot
parent
3a65f86c68
commit
c14bab3677
@@ -262,7 +262,7 @@ function downloadIcons(buildFolder: string) {
|
||||
console.log('Created build directory', dir);
|
||||
|
||||
await compileMain();
|
||||
await generatePluginEntryPoints();
|
||||
await generatePluginEntryPoints(argv.channel === 'insiders');
|
||||
await copyStaticFolder(dir);
|
||||
await downloadIcons(dir);
|
||||
await compileRenderer(dir);
|
||||
|
||||
@@ -30,24 +30,58 @@ const {version} = require('../package.json');
|
||||
|
||||
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) {
|
||||
console.error(err.stack);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
export async function generatePluginEntryPoints() {
|
||||
console.log('⚙️ Generating plugin entry points...');
|
||||
const sourcePlugins = await getSourcePlugins();
|
||||
const bundledPlugins = sourcePlugins.map(
|
||||
(p) =>
|
||||
({
|
||||
...p,
|
||||
isBundled: true,
|
||||
version: p.version === '0.0.0' ? version : p.version,
|
||||
flipperSDKVersion:
|
||||
p.flipperSDKVersion === '0.0.0' ? version : p.flipperSDKVersion,
|
||||
} as BundledPluginDetails),
|
||||
export async function generatePluginEntryPoints(
|
||||
isInsidersBuild: boolean = false,
|
||||
) {
|
||||
console.log(
|
||||
`⚙️ Generating plugin entry points (isInsidersBuils=${isInsidersBuild})...`,
|
||||
);
|
||||
const sourcePlugins = await getSourcePlugins();
|
||||
const bundledPlugins = sourcePlugins
|
||||
// we only include predefined set of plugins into insiders release
|
||||
.filter((p) => !isInsidersBuild || hardcodedPlugins.has(p.id))
|
||||
.map(
|
||||
(p) =>
|
||||
({
|
||||
...p,
|
||||
isBundled: true,
|
||||
version: p.version === '0.0.0' ? version : p.version,
|
||||
flipperSDKVersion:
|
||||
p.flipperSDKVersion === '0.0.0' ? version : p.flipperSDKVersion,
|
||||
} as BundledPluginDetails),
|
||||
);
|
||||
if (await fs.pathExists(defaultPluginsIndexDir)) {
|
||||
await fs.remove(defaultPluginsIndexDir);
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ function checkDevServer() {
|
||||
|
||||
(async () => {
|
||||
checkDevServer();
|
||||
await generatePluginEntryPoints();
|
||||
await generatePluginEntryPoints(argv.channel === 'insiders');
|
||||
await ensurePluginFoldersWatchable();
|
||||
const port = await detect(DEFAULT_PORT);
|
||||
const {app, server} = await startAssetServer(port);
|
||||
|
||||
Reference in New Issue
Block a user