-
-
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
Selective lazy compilation #9166
Conversation
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.
Just some small fixes here that helped me debug this feature, as some attributes were missing from graphviz.
Benchmark ResultsKitchen Sink ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached Bundles
AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
|
This is a cool feature! My only feedback is that the naming of the CLI options is a bit confusing potentially. e.g. does "include" mean "in addition to the default" or "only these ones". Maybe we could make it so |
Thanks for this feedback - I've now had a chance to revise this. |
↪️ Pull Request
This PR adds a feature to lazy compilation to allow specifying which file paths should be (or should not be) compiled lazily.
The use case is, in a large code base you might have several levels of async imports used for lazy rendering of functionality, as well as for routing. With lazy compilation enabled this can cause a waterfall of lazy requests that can affect the usability of the feature, as several round-trips may be required for the compilation to "settle" - and as the visible dependency graph grows, so do the build times between each step.
While at least for our use case only
--lazy-include
is required,--lazy-exclude
has also been implemented should a user desire to have a particular part of the dependency graph never be lazy compiled irrespective of other options.💻 Examples
With selective lazy compilation you can, for example, choose to only have the lazy boundary at the route level. This means your "shell" and router always compile, then you request just the route bundle that you're currently on, and all child async bundles are included in this compilation (e.g.
parcel serve --lazy --lazy-include "src/routes/**"
).🚨 Test instructions
Integration tests for the new functionality have been added.
✔️ PR Todo