-
-
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
Lazily install sharp only when needed #6816
Conversation
This pull request has been linked to and will mark 1 task as "Done" when merged:
|
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 Bundles
Cached Bundles
Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
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.
Looks good to me.
I thought there was originally a reason we didn't lazily install it though, pretty sure it was even based on feedback from users, sharp is a pretty large package and installs native code so maybe it was freezing the process for multiple minutes for some users
Hmm, well at least it will only be installed if actually used... let's see how it goes. |
* v2: (69 commits) Use yarnpkg registry for all the things (#6908) Fix issue about loading configs from tsconfig.json (#6881) Add `@section` to Compressor type (#6885) Parcel API improvements (#6866) Use stream-browserify for polyfilling instead (#6863) Add support for compressor plugins (#6776) Support for inline style attributes and inline scripts in SVG (#6797) Bump less (#6852) Make sure (non-React) SVGs are in separate bundles (#6757) Add support for injecting manifest into service workers (#6798) Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803) Remaining cargo clippy fixes (#6829) Lazily install sharp only when needed (#6816) More cargo clippy suggestions (#6811) Don't emit runtime manifest for inline child bundles (#6807) Apply suggestions from rust-clippy (#6256) Fix add directoryExists function to matchFiles call. (#6784) Upgrade to Flow 158 (#6763) Revert "added cio headers (#6404)" (#6789) Process CSS in SVGs (#6743) ...
* v2: (38 commits) Use yarnpkg registry for all the things (#6908) Fix issue about loading configs from tsconfig.json (#6881) Add `@section` to Compressor type (#6885) Parcel API improvements (#6866) Use stream-browserify for polyfilling instead (#6863) Add support for compressor plugins (#6776) Support for inline style attributes and inline scripts in SVG (#6797) Bump less (#6852) Make sure (non-React) SVGs are in separate bundles (#6757) Add support for injecting manifest into service workers (#6798) Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803) Remaining cargo clippy fixes (#6829) Lazily install sharp only when needed (#6816) More cargo clippy suggestions (#6811) Don't emit runtime manifest for inline child bundles (#6807) Apply suggestions from rust-clippy (#6256) Fix add directoryExists function to matchFiles call. (#6784) Upgrade to Flow 158 (#6763) Revert "added cio headers (#6404)" (#6789) Process CSS in SVGs (#6743) ...
* bdo/number-edgetypes: (70 commits) Use yarnpkg registry for all the things (#6908) Fix issue about loading configs from tsconfig.json (#6881) Add `@section` to Compressor type (#6885) Parcel API improvements (#6866) Use stream-browserify for polyfilling instead (#6863) Add support for compressor plugins (#6776) Support for inline style attributes and inline scripts in SVG (#6797) Bump less (#6852) Make sure (non-React) SVGs are in separate bundles (#6757) Add support for injecting manifest into service workers (#6798) Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803) Remaining cargo clippy fixes (#6829) Lazily install sharp only when needed (#6816) More cargo clippy suggestions (#6811) Don't emit runtime manifest for inline child bundles (#6807) Apply suggestions from rust-clippy (#6256) Fix add directoryExists function to matchFiles call. (#6784) Upgrade to Flow 158 (#6763) Revert "added cio headers (#6404)" (#6789) Process CSS in SVGs (#6743) ...
* v2: (38 commits) Use yarnpkg registry for all the things (#6908) Fix issue about loading configs from tsconfig.json (#6881) Add `@section` to Compressor type (#6885) Parcel API improvements (#6866) Use stream-browserify for polyfilling instead (#6863) Add support for compressor plugins (#6776) Support for inline style attributes and inline scripts in SVG (#6797) Bump less (#6852) Make sure (non-React) SVGs are in separate bundles (#6757) Add support for injecting manifest into service workers (#6798) Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803) Remaining cargo clippy fixes (#6829) Lazily install sharp only when needed (#6816) More cargo clippy suggestions (#6811) Don't emit runtime manifest for inline child bundles (#6807) Apply suggestions from rust-clippy (#6256) Fix add directoryExists function to matchFiles call. (#6784) Upgrade to Flow 158 (#6763) Revert "added cio headers (#6404)" (#6789) Process CSS in SVGs (#6743) ...
* bdo/number-edgetypes: (70 commits) Use yarnpkg registry for all the things (#6908) Fix issue about loading configs from tsconfig.json (#6881) Add `@section` to Compressor type (#6885) Parcel API improvements (#6866) Use stream-browserify for polyfilling instead (#6863) Add support for compressor plugins (#6776) Support for inline style attributes and inline scripts in SVG (#6797) Bump less (#6852) Make sure (non-React) SVGs are in separate bundles (#6757) Add support for injecting manifest into service workers (#6798) Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803) Remaining cargo clippy fixes (#6829) Lazily install sharp only when needed (#6816) More cargo clippy suggestions (#6811) Don't emit runtime manifest for inline child bundles (#6807) Apply suggestions from rust-clippy (#6256) Fix add directoryExists function to matchFiles call. (#6784) Upgrade to Flow 158 (#6763) Revert "added cio headers (#6404)" (#6789) Process CSS in SVGs (#6743) ...
* v2: (42 commits) Remove dead link to docs in diagnostic (#6913) Fix engines.parcel in SVG packager (#6911) Use imported Readable flow type instead of global (#6910) Use non-deprecated SVGO options in HTMLNanoOptimizer (#6785) Use yarnpkg registry for all the things (#6908) Fix issue about loading configs from tsconfig.json (#6881) Add `@section` to Compressor type (#6885) Parcel API improvements (#6866) Use stream-browserify for polyfilling instead (#6863) Add support for compressor plugins (#6776) Support for inline style attributes and inline scripts in SVG (#6797) Bump less (#6852) Make sure (non-React) SVGs are in separate bundles (#6757) Add support for injecting manifest into service workers (#6798) Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803) Remaining cargo clippy fixes (#6829) Lazily install sharp only when needed (#6816) More cargo clippy suggestions (#6811) Don't emit runtime manifest for inline child bundles (#6807) Apply suggestions from rust-clippy (#6256) ...
* v2: (42 commits) Remove dead link to docs in diagnostic (#6913) Fix engines.parcel in SVG packager (#6911) Use imported Readable flow type instead of global (#6910) Use non-deprecated SVGO options in HTMLNanoOptimizer (#6785) Use yarnpkg registry for all the things (#6908) Fix issue about loading configs from tsconfig.json (#6881) Add `@section` to Compressor type (#6885) Parcel API improvements (#6866) Use stream-browserify for polyfilling instead (#6863) Add support for compressor plugins (#6776) Support for inline style attributes and inline scripts in SVG (#6797) Bump less (#6852) Make sure (non-React) SVGs are in separate bundles (#6757) Add support for injecting manifest into service workers (#6798) Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803) Remaining cargo clippy fixes (#6829) Lazily install sharp only when needed (#6816) More cargo clippy suggestions (#6811) Don't emit runtime manifest for inline child bundles (#6807) Apply suggestions from rust-clippy (#6256) ...
* bdo/number-edgetypes: (74 commits) Remove dead link to docs in diagnostic (#6913) Fix engines.parcel in SVG packager (#6911) Use imported Readable flow type instead of global (#6910) Use non-deprecated SVGO options in HTMLNanoOptimizer (#6785) Use yarnpkg registry for all the things (#6908) Fix issue about loading configs from tsconfig.json (#6881) Add `@section` to Compressor type (#6885) Parcel API improvements (#6866) Use stream-browserify for polyfilling instead (#6863) Add support for compressor plugins (#6776) Support for inline style attributes and inline scripts in SVG (#6797) Bump less (#6852) Make sure (non-React) SVGs are in separate bundles (#6757) Add support for injecting manifest into service workers (#6798) Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803) Remaining cargo clippy fixes (#6829) Lazily install sharp only when needed (#6816) More cargo clippy suggestions (#6811) Don't emit runtime manifest for inline child bundles (#6807) Apply suggestions from rust-clippy (#6256) ...
Fixes T-1107.
This moves
@parcel/transformer-image
to be a dependency of the default config rather than installed on demand. Sinceurl:
is no longer required for images, any time you had an image this was installed, even if you didn't have any query params. Now sharp is required lazily from within the image transformer to avoid it being installed unless needed.To do this with caching in mind, I used a Proxy to intercept
require
calls on the package manager and add them as dev deps of the transformation request.