8000 Use `acorn-import-phases` plugin by nicolo-ribaudo · Pull Request #19659 · webpack/webpack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use acorn-import-phases plugin #19659

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

Merged
merged 1 commit into from
Jul 8, 2025

Conversation

nicolo-ribaudo
Copy link
Contributor
@nicolo-ribaudo nicolo-ribaudo commented Jul 4, 2025

What kind of change does this PR introduce?

The parsing logic for import defer was copy-pasted from the https://www.npmjs.com/acorn-import-defer. I now:

  • updated that package to also support parsing the import source proposal (https://github.com/tc39/proposal-source-phase-imports)
  • renamed it to acorn-import-phases
  • it's tested on Node.js 10.x+
  • added proper type definitions, so that it can be easily used in the Webpack codebase.

My goal with that package was to share an implementation for import defer parsing across tools, so that parsing bugs don't need to be fixed across multiple repos. Let's use it? :)

Note that this PR explicitly disables import source parsing in that plugin, since webpack doesn't support it yet. It will make however implementing import source simpler, since you don't have to think about how to parse it.

Did you add tests for your changes?

Not needed

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

Nothing

Copy link
codspeed-hq bot commented Jul 4, 2025

CodSpeed Performance Report

Merging #19659 will degrade performances by 77.72%

Comparing nicolo-ribaudo:acorn-plugin (d0db538) with main (a113022)

Summary

⚡ 86 improvements
❌ 1 regressions
✅ 46 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
benchmark "cache-filesystem", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 227.4 ms 11.5 ms ×20
benchmark "devtool-eval", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 43.1 ms 35.6 ms +21.18%
benchmark "devtool-source-map", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 43.5 ms 10.6 ms ×4.1
benchmark "future-defaults", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 12.1 ms 10 ms +20.78%
benchmark "many-chunks-esm", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 61.2 ms 51.9 ms +17.84%
benchmark "many-modules-commonjs", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 53 ms 10 ms ×5.3
benchmark "many-modules-esm", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 9.8 ms 43.9 ms -77.72%
md4 buffer benchmark (size: 10000) 114.2 µs 72.9 µs +56.74%
md4 buffer benchmark (size: 100000) 447.8 µs 406.5 µs +10.15%
md4 buffer benchmark (size: 120) 76.2 µs 34.8 µs ×2.2
md4 buffer benchmark (size: 160) 76.3 µs 34.8 µs ×2.2
md4 buffer benchmark (size: 16366) 138.6 µs 97.3 µs +42.53%
md4 buffer benchmark (size: 16368) 138.6 µs 97.3 µs +42.47%
md4 buffer benchmark (size: 16370) 138.8 µs 97.3 µs +42.63%
md4 buffer benchmark (size: 2) 76.4 µs 34.9 µs ×2.2
md4 buffer benchmark (size: 20) 76.3 µs 32.4 µs ×2.4
md4 buffer benchmark (size: 200) 76.5 µs 35 µs ×2.2
md4 buffer benchmark (size: 2000) 82.1 µs 40.6 µs ×2
md4 buffer benchmark (size: 20000) 152.7 µs 111.4 µs +37.06%
md4 buffer benchmark (size: 2002) 82 µs 40.6 µs ×2
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@alexander-akait alexander-akait enabled auto-merge (squash) July 8, 2025 12:49
@alexander-akait alexander-akait disabled auto-merge July 8, 2025 12:49
@alexander-akait alexander-akait merged commit 1c82f98 into webpack:main Jul 8, 2025
42 of 44 checks passed
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.

2 participants
0