Skip to content
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

Add support for loadConfig to resolver plugins #8847

Merged
merged 2 commits into from
Feb 28, 2023
Merged

Conversation

devongovett
Copy link
Member

This adds support for loadConfig to resolver plugins. Configs are loaded once per build, and passed to the resolve function. The default resolver uses this to create an instance of the NodeResolver once per build so that it can cache things like package.jsons and fs stat calls. This represents a pretty significant performance improvement.

We also seemed to be lacking some cache invalidation for dev dependencies in the PathRequest, so now that is added as well along with cache tests.

@parcel-benchmark
Copy link

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 2.12s -72.00ms
Cached 435.00ms -39.00ms 🚀

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/index.html 826.00b +0.00b 707.00ms -52.00ms 🚀
dist/modern/index.html 749.00b +0.00b 707.00ms -50.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 304.00ms -19.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 306.00ms -19.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 307.00ms -18.00ms 🚀
dist/legacy/index.2c76ad23.js 1.66kb +0.00b 525.00ms -31.00ms 🚀
dist/legacy/index.8aaa89c9.js 1.20kb +0.00b 526.00ms -31.00ms 🚀
dist/modern/index.6be20f01.js 1.13kb +0.00b 525.00ms -32.00ms 🚀
dist/legacy/index.b8ae99ba.css 94.00b +0.00b 319.00ms -26.00ms 🚀
dist/modern/index.31cedca9.css 94.00b +0.00b 319.00ms -25.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 14.95s +67.00ms
Cached 586.00ms +4.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 2.73m -2.61s
Cached 3.16s +141.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Three.js ✅

Timings

Description Time Difference
Cold 11.65s -71.00ms
Cached 376.00ms +15.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit b549779 into v2 Feb 28, 2023
@devongovett devongovett deleted the resolver-config branch February 28, 2023 20:38
lettertwo added a commit that referenced this pull request Nov 6, 2023
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants