Include default plugins into app bundle (#998)
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/998 After this diff all the default plugins (which are distributed with Flipper) will be included into the main app bundle instead of bundling each of them separately and then loading from file system. This is done by auto-generating plugins index in build-time and importing it from Flipper app bundle, so Metro can follow these imports and bundle all the plugins to the app bundle. This provides several benefits: 1) reduced Flipper bundle size (~10% reduction of zipped Flipper archive), because Metro bundles each of re-used dependencies only once instead of bundling them for each plugin where such dependency used. 2) Faster Flipper startup because of reduced bundle and the fact that we don't need to load each plugin bundle from disk - just need to load the single bundle where everything is already included. 3) Metro dev server for plugins works in the same way as for Flipper app itself, e.g. simple refresh automatically recompiles bundled plugins too if there are changes. This also potentially should allow us to enable "fast refresh" for quicker iterations while developing plugins. 4) Faster build ("yarn build --mac" is 2 times faster on my machine after this change) Potential downsides: 1) Currently all the plugins are identically loaded from disk. After this change some of plugins will be bundled, and some of them (third-party) will be loaded from disk. 2) In future when it will be possible to publish new versions of default plugins separately, installing new version of such plugin (e.g. with some urgent fix) will mean the "default" pre-built version will still be bundled (we cannot "unbundle" it :)), but we'll skip it and instead load new version from disk. Changelog: Internals: include default plugins into the main bundle instead producing separate bundles for them. Reviewed By: passy Differential Revision: D20864002 fbshipit-source-id: 2968f3b786cdd1767d6223996090143d03894b92
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cc96fc984c
commit
553c54b63e
@@ -12,3 +12,5 @@ website/build
|
||||
react-native/ReactNativeFlipperExample
|
||||
scripts/generate-changelog.js
|
||||
static/index.js
|
||||
static/defaultPlugins/index.json
|
||||
app/src/defaultPlugins/index.tsx
|
||||
|
||||
Reference in New Issue
Block a user