From 8dc5f4d3ea2e5549e2d8e7687767a4aeb0983d7c Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Thu, 15 Sep 2022 10:02:19 -0700 Subject: [PATCH] Remove stale build options Summary: Now that we build all plugins at all times and it is super-fast, these options are redundant Reviewed By: lblasa Differential Revision: D39542723 fbshipit-source-id: 1b30ba384267ec4fd0c35b4dc14f0223ffe414c9 --- .../flipper-server/src/attachDevServer.tsx | 6 ---- desktop/plugin-lib/src/pluginPaths.tsx | 6 ---- .../scripts/build-flipper-server-release.tsx | 34 ------------------- desktop/scripts/build-release.tsx | 22 ------------ desktop/scripts/build-utils.tsx | 4 +-- desktop/scripts/start-dev-server.tsx | 33 ------------------ desktop/scripts/start-flipper-server-dev.tsx | 33 ------------------ 7 files changed, 1 insertion(+), 137 deletions(-) diff --git a/desktop/flipper-server/src/attachDevServer.tsx b/desktop/flipper-server/src/attachDevServer.tsx index 2ba50d2a4..abb12b6b5 100644 --- a/desktop/flipper-server/src/attachDevServer.tsx +++ b/desktop/flipper-server/src/attachDevServer.tsx @@ -33,12 +33,6 @@ const uiSourceDirs = [ // copied from plugin-lib/src/pluginPaths export async function getPluginSourceFolders(): Promise { const pluginFolders: string[] = []; - if (process.env.FLIPPER_NO_DEFAULT_PLUGINS) { - console.log( - '🥫 Skipping default plugins because "--no-default-plugins" flag provided', - ); - return pluginFolders; - } const flipperConfigPath = path.join(homedir(), '.flipper', 'config.json'); if (await fs.pathExists(flipperConfigPath)) { const config = await fs.readJson(flipperConfigPath); diff --git a/desktop/plugin-lib/src/pluginPaths.tsx b/desktop/plugin-lib/src/pluginPaths.tsx index 10c45b20d..382f14087 100644 --- a/desktop/plugin-lib/src/pluginPaths.tsx +++ b/desktop/plugin-lib/src/pluginPaths.tsx @@ -28,12 +28,6 @@ export const pluginCacheDir = path.join(flipperDataDir, 'plugins'); export async function getPluginSourceFolders(): Promise { const pluginFolders: string[] = []; - if (process.env.FLIPPER_NO_DEFAULT_PLUGINS) { - console.log( - '🥫 Skipping default plugins because "--no-default-plugins" flag provided', - ); - return pluginFolders; - } const flipperConfigPath = path.join(homedir(), '.flipper', 'config.json'); if (await fs.pathExists(flipperConfigPath)) { const config = await fs.readJson(flipperConfigPath); diff --git a/desktop/scripts/build-flipper-server-release.tsx b/desktop/scripts/build-flipper-server-release.tsx index 249e01167..ecd44b63e 100644 --- a/desktop/scripts/build-flipper-server-release.tsx +++ b/desktop/scripts/build-flipper-server-release.tsx @@ -46,12 +46,6 @@ const argv = yargs .usage('yarn build-flipper-server [args]') .version(false) .options({ - 'default-plugins': { - describe: - 'Enables embedding of default plugins into Flipper package so they are always available. The flag is enabled by default. Env var FLIPPER_NO_DEFAULT_PLUGINS is equivalent to the command-line option "--no-default-plugins".', - type: 'boolean', - default: true, - }, 'public-build': { describe: '[FB-internal only] Will force using public sources only, to be able to iterate quickly on the public version. If sources are checked out from GitHub this is already the default. Setting env var "FLIPPER_FORCE_PUBLIC_BUILD" is equivalent.', @@ -98,12 +92,6 @@ const argv = yargs choices: ['stable', 'insiders'], default: 'stable', }, - 'bundled-plugins': { - describe: - 'Enables bundling of plugins into Flipper bundle. Env var FLIPPER_NO_BUNDLED_PLUGINS is equivalent to the command-line option "--no-bundled-plugins".', - type: 'boolean', - default: false, - }, 'default-plugins-dir': { describe: 'Directory with prepared list of default plugins which will be included into the Flipper distribution as "defaultPlugins" dir', @@ -149,24 +137,6 @@ if (isFB) { process.env.FLIPPER_RELEASE_CHANNEL = argv.channel; -if (argv['bundled-plugins'] === false) { - process.env.FLIPPER_NO_BUNDLED_PLUGINS = 'true'; -} else if (argv['bundled-plugins'] === true) { - delete process.env.FLIPPER_NO_BUNDLED_PLUGINS; -} - -if (argv['default-plugins'] === true) { - delete process.env.FLIPPER_NO_DEFAULT_PLUGINS; -} else if (argv['default-plugins'] === false) { - process.env.FLIPPER_NO_DEFAULT_PLUGINS = 'true'; -} -// Don't rebuild default plugins, mostly to speed up testing -if (argv['rebuild-plugins'] === false) { - process.env.FLIPPER_NO_REBUILD_PLUGINS = 'true'; -} else if (argv['rebuild-plugins'] === true) { - delete process.env.FLIPPER_NO_REBUILD_PLUGINS; -} - if (argv['default-plugins-dir']) { process.env.FLIPPER_DEFAULT_PLUGINS_DIR = argv['default-plugins-dir']; } @@ -184,10 +154,6 @@ if (argv['enabled-plugins'] !== undefined) { process.env.FLIPPER_ENABLED_PLUGINS = argv['enabled-plugins'].join(','); } -if (argv['default-plugins-dir']) { - process.env.FLIPPER_DEFAULT_PLUGINS_DIR = argv['default-plugins-dir']; -} - async function copyStaticResources(outDir: string, versionNumber: string) { console.log(`⚙️ Copying default plugins...`); diff --git a/desktop/scripts/build-release.tsx b/desktop/scripts/build-release.tsx index 54dbdabf5..bccc2b16d 100755 --- a/desktop/scripts/build-release.tsx +++ b/desktop/scripts/build-release.tsx @@ -78,16 +78,6 @@ const argv = yargs choices: ['stable', 'insiders'], default: 'stable', }, - 'bundled-plugins': { - describe: - 'Enables bundling of plugins into Flipper bundle. Env var FLIPPER_NO_BUNDLED_PLUGINS is equivalent to the command-line option "--no-bundled-plugins".', - type: 'boolean', - }, - 'rebuild-plugins': { - describe: - 'Enables rebuilding of default plugins on Flipper build. Only make sense in conjunction with "--no-bundled-plugins". Enabled by default, but if disabled using "--no-plugin-rebuild", then plugins are just released as is without rebuilding. This can save some time if you know plugin bundles are already up-to-date.', - type: 'boolean', - }, 'default-plugins-dir': { describe: 'Directory with prepared list of default plugins which will be included into the Flipper distribution as "defaultPlugins" dir', @@ -121,18 +111,6 @@ if (isFB) { process.env.FLIPPER_RELEASE_CHANNEL = argv.channel; -if (argv['bundled-plugins'] === false) { - process.env.FLIPPER_NO_BUNDLED_PLUGINS = 'true'; -} else if (argv['bundled-plugins'] === true) { - delete process.env.FLIPPER_NO_BUNDLED_PLUGINS; -} - -if (argv['rebuild-plugins'] === false) { - process.env.FLIPPER_NO_REBUILD_PLUGINS = 'true'; -} else if (argv['rebuild-plugins'] === true) { - delete process.env.FLIPPER_NO_REBUILD_PLUGINS; -} - if (argv['default-plugins-dir']) { process.env.FLIPPER_DEFAULT_PLUGINS_DIR = argv['default-plugins-dir']; } diff --git a/desktop/scripts/build-utils.tsx b/desktop/scripts/build-utils.tsx index ad8592a57..878b3d8d5 100644 --- a/desktop/scripts/build-utils.tsx +++ b/desktop/scripts/build-utils.tsx @@ -87,9 +87,7 @@ export async function prepareDefaultPlugins(isInsidersBuild: boolean = false) { }); console.log('✅ Copied the provided default plugins dir.'); } else { - const sourcePlugins = process.env.FLIPPER_NO_DEFAULT_PLUGINS - ? [] - : await getSourcePlugins(); + const sourcePlugins = await getSourcePlugins(); const defaultPlugins = sourcePlugins // we only include headless plugins and a predefined set of regular plugins into insiders release .filter( diff --git a/desktop/scripts/start-dev-server.tsx b/desktop/scripts/start-dev-server.tsx index 6d8d45e95..68cf88c19 100644 --- a/desktop/scripts/start-dev-server.tsx +++ b/desktop/scripts/start-dev-server.tsx @@ -34,21 +34,6 @@ import {startWatchPlugins, Watchman} from 'flipper-pkg-lib'; const argv = yargs .usage('yarn start [args]') .options({ - 'default-plugins': { - describe: - 'Enables embedding of default plugins into Flipper package so they are always available. The flag is enabled by default. Env var FLIPPER_NO_DEFAULT_PLUGINS is equivalent to the command-line option "--no-default-plugins".', - type: 'boolean', - }, - 'bundled-plugins': { - describe: - 'Enables bundling of plugins into Flipper bundle. This is useful for debugging, because it makes Flipper dev mode loading faster and unblocks fast refresh. The flag is enabled by default. Env var FLIPPER_NO_BUNDLED_PLUGINS is equivalent to the command-line option "--no-bundled-plugins".', - type: 'boolean', - }, - 'rebuild-plugins': { - describe: - 'Enables rebuilding of default plugins on Flipper build. Only make sense in conjunction with "--no-bundled-plugins". Enabled by default, but if disabled using "--no-plugin-rebuild", then plugins are just released as is without rebuilding. This can save some time if you know plugin bundles are already up-to-date.', - type: 'boolean', - }, 'fast-refresh': { describe: 'Enable Fast Refresh - quick reload of UI component changes without restarting Flipper. The flag is disabled by default. Env var FLIPPER_FAST_REFRESH is equivalent to the command-line option "--fast-refresh".', @@ -120,24 +105,6 @@ if (isFB) { process.env.FLIPPER_FB = 'true'; } -if (argv['default-plugins'] === true) { - delete process.env.FLIPPER_NO_DEFAULT_PLUGINS; -} else if (argv['default-plugins'] === false) { - process.env.FLIPPER_NO_DEFAULT_PLUGINS = 'true'; -} - -if (argv['bundled-plugins'] === true) { - delete process.env.FLIPPER_NO_BUNDLED_PLUGINS; -} else if (argv['bundled-plugins'] === false) { - process.env.FLIPPER_NO_BUNDLED_PLUGINS = 'true'; -} - -if (argv['rebuild-plugins'] === false) { - process.env.FLIPPER_NO_REBUILD_PLUGINS = 'true'; -} else if (argv['rebuild-plugins'] === true) { - delete process.env.FLIPPER_NO_REBUILD_PLUGINS; -} - if (argv['fast-refresh'] === true) { process.env.FLIPPER_FAST_REFRESH = 'true'; } else if (argv['fast-refresh'] === false) { diff --git a/desktop/scripts/start-flipper-server-dev.tsx b/desktop/scripts/start-flipper-server-dev.tsx index 8154ea992..9e9623cb4 100644 --- a/desktop/scripts/start-flipper-server-dev.tsx +++ b/desktop/scripts/start-flipper-server-dev.tsx @@ -23,21 +23,6 @@ import {Watchman} from 'flipper-pkg-lib'; const argv = yargs .usage('yarn flipper-server [args]') .options({ - 'default-plugins': { - describe: - 'Enables embedding of default plugins into Flipper package so they are always available. The flag is enabled by default. Env var FLIPPER_NO_DEFAULT_PLUGINS is equivalent to the command-line option "--no-default-plugins".', - type: 'boolean', - }, - 'bundled-plugins': { - describe: - 'Enables bundling of plugins into Flipper bundle. This is useful for debugging, because it makes Flipper dev mode loading faster and unblocks fast refresh. The flag is enabled by default. Env var FLIPPER_NO_BUNDLED_PLUGINS is equivalent to the command-line option "--no-bundled-plugins".', - type: 'boolean', - }, - 'rebuild-plugins': { - describe: - 'Enables rebuilding of default plugins on Flipper build. Only make sense in conjunction with "--no-bundled-plugins". Enabled by default, but if disabled using "--no-plugin-rebuild", then plugins are just released as is without rebuilding. This can save some time if you know plugin bundles are already up-to-date.', - type: 'boolean', - }, 'plugin-marketplace': { describe: 'Enable plugin marketplace - ability to install plugins from NPM or other sources. Without the flag Flipper will only show default plugins. The flag is disabled by default in dev mode. Env var FLIPPER_NO_PLUGIN_MARKETPLACE is equivalent to the command-line option "--no-plugin-marketplace"', @@ -79,24 +64,6 @@ if (isFB) { process.env.FLIPPER_RELEASE_CHANNEL = argv.channel; -if (argv['default-plugins'] === true) { - delete process.env.FLIPPER_NO_DEFAULT_PLUGINS; -} else if (argv['default-plugins'] === false) { - process.env.FLIPPER_NO_DEFAULT_PLUGINS = 'true'; -} - -if (argv['bundled-plugins'] === true) { - delete process.env.FLIPPER_NO_BUNDLED_PLUGINS; -} else if (argv['bundled-plugins'] === false) { - process.env.FLIPPER_NO_BUNDLED_PLUGINS = 'true'; -} - -if (argv['rebuild-plugins'] === false) { - process.env.FLIPPER_NO_REBUILD_PLUGINS = 'true'; -} else if (argv['rebuild-plugins'] === true) { - delete process.env.FLIPPER_NO_REBUILD_PLUGINS; -} - if (argv['public-build'] === true) { // we use a separate env var for forced_public builds, since // FB_FLIPPER / isFB reflects whether we are running on FB sources / infra