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
Experimental inline / deferred requires optimiser #9221
Conversation
yarn.lock
Outdated
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.
Not sure why this modification exists.. I saw this in another PR.. probably something that changed in an earlier PR and wasn't committed (or could be related to the fact it was pointing to the Atlassian registry..)
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
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 BundlesNo bundle changes detected. |
I realised I didn't flow type the new files - started working on that locally, but without types for EDIT: |
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.
This file is mostly generated with flowgen
from the TypeScript types that come with @swc/core.
I had to do a little massaging to make them work, but they pass for this repo.
Do we want "experimental" in the package name? Do you think this will ever be not experimental? If so, we'll have to change the name and deprecate the package. Would be it better to just indicate this in the readme or something? |
↪️ Pull Request
This PR implements a new optional and experimental optimiser
parcel-optimizer-experimental-inline-requires
which defers evaluation of required dependencies of a module until they are accessed.We are successfully using this plugin in our very large application to get 5-10% runtime startup performance improvements - it is likely this doesn't have the same benefit for all, or smaller projects, so it is also likely this functionality would always be optional.
See the README.md in this PR for details of how this works, and the caveats around things like side effects.
💻 Examples
See the README.md in this PR for details.
🚨 Test instructions
Can be tested by adding it to any project, and verifying that it has not broken anything at runtime.
✔️ PR Todo