-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Split large runtime manifest into separate bundles #8837
Conversation
Will fix up the broken tests next week. 👍 |
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
Cached Bundles
React HackerNews ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. AtlasKit Editor ✅
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
|}; | ||
|
||
let defaultConfig: JSRuntimeConfig = { | ||
splitManifestThreshold: 100000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did we determine 100kb as the threshold?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, not a lot of thought went into this and it's more of a "finger in the air" guess. We'll merge and potentially refine it later after some tests.
This appears to have broken HTML pages that contain the |
* upstream/v2: Missing edge for multiple targets (parcel-bundler#8854) Split large runtime manifest into separate bundles (parcel-bundler#8837) Improvements to new resolver (parcel-bundler#8844) Fix published files for resolver New resolver implementation in Rust (parcel-bundler#8807) Update yarn.lock (parcel-bundler#8843) Bump napi-rs to latest (parcel-bundler#8838)
* upstream/v2: (128 commits) [webextension] Add support for `chrome_style` (#8867) Switch to SWC minifier by default (#8860) Use BitSet for bundler intersections (#8862) best key logic truncating package names (#8865) Add support for loadConfig to resolver plugins (#8847) Missing edge for multiple targets (#8854) Split large runtime manifest into separate bundles (#8837) Improvements to new resolver (#8844) Fix published files for resolver New resolver implementation in Rust (#8807) Update yarn.lock (#8843) Bump napi-rs to latest (#8838) Support .proxyrc.cjs (#8833) Sort global deps before injecting imports (#8818) Sort CSS module exports (#8817) fix: add extra information to unique bundles (#8784) Don't blow up HMR when <link />s don't have hrefs (#8800) v2.8.3 Changelog for v2.8.3 Address bug by updating an asset reference and merge conditions (#8762) ...
↪️ Pull Request
To prevent unnecessary cache invalidation, Parcel currently inlines manifests into entry bundles. However, in projects where the entries are very large this still leads to large amounts of unnecessary cache invalidation. To address this, this PR adds a new configurable feature to Parcel that can split runtime manifest assets out into their own bundles.
Basic implementation is as follows:
moveToSeparateBundle
) that signifies a runtime asset should have it's own bundlemoveToSeparateBundle
is set then create a new bundle inside the current bundle group and add the asset to that bundle instead.To allow for this change,
createBundle
needed to be moved to the internal bundle graph.Improvement
After making a small change to a commonly used dynamic import in a very large project here's the different in outputs.
No manifest splitting
35 / 3290 (1.1%) bundles changed
32490 / 217051 (15%) bytes changed
With manifest splitting
35 / 3322 (1.1%) bundles changed
2376 / 217062 (1.1%) bytes changed
Questions/Discussions
splitManifestThreshold
. Not sure this is a great name. We could also just hard code a value if we don't think the config is useful.runtime-manifest.HASH.js
). Maybe we should add a new property toBundle
to let namer plugins know this is a runtime/manifest bundle?🚨 Test instructions
I've added a couple of new tests but happy to add more if we feel there's anything missing.
✔️ PR Todo