Experimental inline / deferred requires optimiser#9221
Conversation
There was a problem hiding this comment.
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.
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-requireswhich 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