-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundler Refactor #8170
Bundler Refactor #8170
Conversation
Builds ready [915c7c8]
Page Load Metrics (629 ± 29 ms)
|
Builds ready [aaedd5f]
Page Load Metrics (621 ± 41 ms)
|
Builds ready [b43fc43]
Page Load Metrics (590 ± 43 ms)
|
Builds ready [ce9c9aa]
Page Load Metrics (688 ± 31 ms)
|
Builds ready [89a1802]
Page Load Metrics (871 ± 92 ms)
|
Builds ready [f8b0107]
Page Load Metrics (703 ± 67 ms)
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Builds ready [fa96846]
Page Load Metrics (646 ± 11 ms)
|
* origin/develop: (582 commits) Use async/await for seedPhraseVerifier.verifyAccounts (#9100) Use async/await for getRestrictedMethods (#9099) Update dependencies (#9105) update email us to contact us (#9104) Improve source maps (#9101) Update font family globally (#9073) rpc-cap@3.1.0 (#9103) Use environment variable for production Sentry DSN (#9097) Only log error on first occurrence of missing substitution (#9096) Use mixins for typography instead of placeholder selectors (#9072) Update css folder structure (#9071) Disable Sentry in development (#9095) Use environment variable for MetaMetrics project ID (#9094) Use development metametrics project during tests (#9093) json-rpc-engine@5.2.0 (#9091) fixup! call initializeProvider where necessary call initializeProvider where necessary Add euclid fontface (#9018) fix timing-reliant network controller test Robustify permissions controller requestUserApproval tests (#9064) ...
Builds ready [1e042f2]
Page Load Metrics (502 ± 40 ms)
|
The bundles produced by this branch look good, but the sourcemaps for I'll try and reduce the size of this PR first by getting a few of these changes merged separately, then I'll investigate that problem. Edit: Done. This PR is as small as it'll get for now. It might still be able to be split between the build changes and the new lavamoat build step; TBD. |
There are no functional changes. This was extracted from #8170
There are no functional changes. This was extracted from #8170
* origin/develop: Factor out `getEnvironment` function in build script (#9114) Update `browserify` from v16.2.3 to v16.5.1 (#9113) Update `sesify-viz` from v3.0.9 to v3.0.10 (#9111) Update `gulp-rename` from v1.4.0 to v2.0.0 (#9112) Update `source-map-explorer` from v2.0.1 to v2.4.2 (#9110) Add `build-artifacts` to .gitignore (#9109)
`browserify-transform-tools` is now used indirectly via `lavamoat-browserify`, which has also replaced `sesify`.
Builds ready [4b77117]
Page Load Metrics (514 ± 45 ms)
|
* origin/develop: Update `brfs` from v1.6.1 to v2.0.2 (#9115)
It looks like the source maps for all of the bundles are messed up. The Edit: It turns out that just the three "factored" bundles are affected ( |
Builds ready [8b8bce8]
Page Load Metrics (421 ± 52 ms)
|
I tried looking at the direct output of |
* origin/develop: Fix connection removal bug (#9137) Add source map validator to CI (#9135) Update source map validator target files (#9133) Improve sourcemap validator console report (#9131) Add `validate-source-maps` npm script (#9134) Non-zero exit code upon failure to validate source maps (#9132) remove unused tx-list styles (#9121) delete unused confirm styles (#9118)
I've just merged |
There are no functional changes. This was extracted from #8170
this PR is super stale now, but has some potentially useful stuff |
i want to revert this to a draft pr but i dont see an option for that? |
rip |
status: ready for additional feedback or merge 🎸
refactor of the bundler using lavamoat-friendly bundle factoring. this does not add lavamoat to the bundles.
changes to bundle result
ui-libs
andbg-libs
have been replaced by thecommon
bundle.common
contains all packages that are used by both thebackground
and theui
. the "factoring" into thecommon
bundle is automatic and does not need any adjustment as modules are added/removed.here is a breakdown of the resultant bundle sizes under different minification strategies. the current configuration is the strategy all the way to the right. compare the size of bg/ui/common.
changes to bundling process
I tried to refactor the bundler so that it was easier to follow without having too much repeated code, but im not sure that I succeeded. part of what complicates this is that certain things (e.g. sourcemaps) need to configure both:
its additionally complicated because a watchify re-build involves creating a new build pipeline. my proposed solution is as follows
a basic bundle+build config obj
events
will fire a'pipeline'
event when the build pipeline is ready to be augmented. The pipeline is based on browserify's own internal pipeline, alabeled-stream-splicer
. It is essentially a nested array of streams that you can pop into position, and it handles all the plumbing for you. it may be slightly over-engineered, but it allows our very different build configurations (inpage+contentscript standalone, ui+background factor) share the same interface, and makes applying some feature (e.g. sourcemaps) able to happen in one placeetc
moved the lavamoat dashboard (sesify-viz) to a separate process that runs parallel with the other builds, should speed up CI ~3min