GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(esm): widen analyzable output to HMR, hashed and function chunk filenames by alexander-akait · Pull Request #21653 · webpack/webpack

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Aug 9, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

Follow-up to #21626. Analyzable ESM output still fell back to the runtime chunk loader for hot module replacement builds and for hashed chunk filenames — between them most development and most production builds — as well as for a function output.chunkFilename and for WebAssembly behind a URL public path. Each now emits a followable import("./chunk.<hash>.mjs"), and an analyzable chunk carrying css or resource hints no longer drags in the chunk loader it only needed for the handler map (−1739 bytes on configCases/analyzable/css-chunk-import).

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes — configCases/analyzable/{hashed-chunk-filename,function-chunk-filename,shared-depths-import}, configCases/wasm/analyzable-url-public-path, configCases/worker/worker-non-import-chunk-loading, hotCases/esm-output/analyzable-import, and updates to statsCases/analyzable-esm-fallbacks.

Does this PR introduce a breaking change?

No — every widened case previously emitted the runtime form, which stays the fallback wherever a literal cannot be resolved.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Two conditions worth documenting: a hashed chunk filename is only baked when optimization.realContentHash is enabled, since that is what corrects the referencing chunk's own hash after substitution; and a WebAssembly binary takes the public path into its literal only when that path is an absolute URL and the chunk loads with fetch, because readFile accepts a file: URL alone.

Use of AI

Yes. Written with Claude in an agentic setup, which produced the implementation and the tests. Design decisions were settled by measurement rather than assumption — istanbul branch counts to establish that a removed guard was unreachable, per-placeholder builds compared against the files actually emitted, and instrumented runs of createRequire and code generation to locate the HMR and hash-availability behaviour — and each change was reviewed and run against the suites before commit.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Improved analyzable ESM imports for hot module replacement and dynamic chunk loading.
    • Added support for hashed, function-based, and CSS-derived chunk filenames.
    • Added analyzable WebAssembly URLs with absolute public paths.
    • Improved CSS-only chunk loading by omitting unnecessary JavaScript code.
  • Bug Fixes
    • Prevented duplicate chunk-loading handlers and improved fallback handling for unresolved filenames.
  • Tests
    • Added coverage for HMR, chunk naming, CSS chunks, and WebAssembly loading.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@changeset-bot

changeset-bot Bot commented Aug 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4baf010

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 1 package
Name Type
webpack Minor

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added area: runtime Emitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm) area: watch Watching, HMR, lazy compilation (lib/hmr, hot/) labels Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@alexander-akait, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 03031895-17a5-4d04-9001-3a1e42b80377

📥 Commits

Reviewing files that changed from the base of the PR and between 6fe1c20 and 4baf010.

📒 Files selected for processing (1)
  • lib/esm/ModuleChunkLoadingPlugin.js

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "tools"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Changes

The compiler now resolves analyzable imports with static, function-based, and hashed chunk filenames. Runtime loading separates handler maps from full loaders. HMR and lazy compilation retain required loaders. Async WebAssembly supports absolute fetch URLs. New tests cover these cases.

Changes

Analyzable ESM loading

Layer / File(s) Summary
Chunk specifier resolution
.changeset/..., lib/RuntimeTemplate.js, lib/esm/AnalyzableChunkHashPlugin.js, lib/esm/ModuleChunkLoadingPlugin.js, test/configCases/analyzable/*
Chunk imports support deferred hash substitution and function-based filename templates. Tests cover hashed, CSS-derived, and dynamic chunk filenames.
Runtime loading and HMR wiring
lib/RuntimePlugin.js, lib/esm/ModuleChunkLoading*.js, lib/hmr/*, lib/runtime/EnsureChunkRuntimeModule.js, test/configCases/analyzable/css-chunk-import/*, test/hotCases/esm-output/analyzable-import/*, test/statsCases/analyzable-esm-fallbacks/*
Runtime modules separate handler-map generation from the full chunk loader. HMR and lazy compilation preserve required loading paths.
WebAssembly URL generation
lib/RuntimeTemplate.js, lib/web/FetchCompileAsyncWasmPlugin.js, test/configCases/wasm/analyzable-url-public-path/*
Fetch-based WebAssembly chunks use absolute public-path URLs. Tests cover fetch instantiation, source compilation, and async-node loading modes.

Possibly related issues

  • ESM Module Output #17121: The changes implement analyzable ESM import() chunk loading through statically resolvable specifiers and generated URL-style output.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required Conventional Commit format and accurately describes the analyzable ESM output changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Aug 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview is available (e3f177c).

Install it locally:

  • npm
npm i -D webpack@https://pkg.pr.new/webpack@e3f177c
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@e3f177c
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@e3f177c
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Aug 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.14286% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.47%. Comparing base (b599774) to head (4baf010).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/RuntimeTemplate.js 93.75% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #21653    +/-   ##
========================================
  Coverage   94.46%   94.47%            
========================================
  Files         629      630     +1     
  Lines       80967    81088   +121     
  Branches    23889    23927    +38     
========================================
+ Hits        76489    76605   +116     
- Misses       4478     4483     +5     
Flag Coverage Δ
css-parsing 26.27% <10.52%> (-0.02%) ⬇️
html5lib 30.78% <10.52%> (-0.02%) ⬇️
integration 88.51% <97.14%> (+0.01%) ⬆️
test262 50.54% <42.33%> (-0.02%) ⬇️
unit 53.99% <10.52%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Aug 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Generated code size

Comparing 4baf010 against b599774. Merging this PR will change the code webpack generates.

Changed New Deleted Unchanged Raw change
Cases 30 4 0 1498 🔴 ↑ +162.10 KiB
Assets 57 48 0 5886 🔴 ↑ +162.10 KiB
Runtimes 33 19 0 1836 —
105 asset(s) changed size, biggest 20 by raw change
Asset Before After Change Gzip (9) Brotli (11) Zstd (19)
➕ analyzable/css-content-hash-filename main.mjs — 14.30 KiB +14.30 KiB (new) new new new
➕ wasm/analyzable-url-public-path 2/bundle2.mjs — 13.06 KiB +13.06 KiB (new) new new new
➕ wasm/analyzable-url-public-path 0/bundle0.mjs — 13.06 KiB +13.06 KiB (new) new new new
➕ wasm/analyzable-url-public-path 1/bundle1.mjs — 12.33 KiB +12.33 KiB (new) new new new
➕ analyzable/hashed-chunk-filename 6/bundle6.mjs — 8.36 KiB +8.36 KiB (new) new new new
➕ analyzable/function-chunk-filename 1/bundle1.mjs — 8.16 KiB +8.16 KiB (new) new new new
➕ analyzable/function-chunk-filename 4/bundle4.mjs — 8.16 KiB +8.16 KiB (new) new new new
➕ analyzable/hashed-chunk-filename 5/bundle5.mjs — 7.75 KiB +7.75 KiB (new) new new new
➕ analyzable/hashed-chunk-filename 4/bundle4.mjs — 7.75 KiB +7.75 KiB (new) new new new
➕ analyzable/hashed-chunk-filename 0/bundle0.mjs — 7.74 KiB +7.74 KiB (new) new new new
➕ analyzable/hashed-chunk-filename 1/bundle1.mjs — 7.74 KiB +7.74 KiB (new) new new new
➕ analyzable/hashed-chunk-filename 2/bundle2.mjs — 7.74 KiB +7.74 KiB (new) new new new
➕ analyzable/hashed-chunk-filename 3/bundle3.mjs — 7.73 KiB +7.73 KiB (new) new new new
➕ analyzable/function-chunk-filename 3/bundle3.mjs — 7.64 KiB +7.64 KiB (new) new new new
➕ analyzable/function-chunk-filename 2/bundle2.mjs — 7.64 KiB +7.64 KiB (new) new new new
➕ analyzable/function-chunk-filename 7/bundle7.mjs — 7.64 KiB +7.64 KiB (new) new new new
➕ analyzable/function-chunk-filename 5/bundle5.mjs — 7.63 KiB +7.63 KiB (new) new new new
➕ analyzable/function-chunk-filename 6/bundle6.mjs — 7.63 KiB +7.63 KiB (new) new new new
➕ analyzable/function-chunk-filename 0/bundle0.mjs — 7.63 KiB +7.63 KiB (new) new new new
➕ wasm/analyzable-url-public-path 2/source-chunks/lazySource.mjs — 1.87 KiB +1.87 KiB (new) new new new
… 85 more asset(s), see the uploaded report
52 runtime(s) changed which runtime modules they carry, biggest 20 by number moved
Runtime Modules Added Removed
➕ analyzable/css-content-hash-filename main 0 → 9 compat get default export, css loading, define property getters, ensure chunk, get css chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ wasm/analyzable-url-public-path 0/main 0 → 8 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm compile, wasm loading —
➕ wasm/analyzable-url-public-path 1/main 0 → 8 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm compile, wasm loading —
➕ wasm/analyzable-url-public-path 2/main 0 → 8 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm compile, wasm loading —
➕ analyzable/function-chunk-filename 1/main 0 → 6 define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/function-chunk-filename 4/main 0 → 6 define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/hashed-chunk-filename 6/main 0 → 6 define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/function-chunk-filename 0/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/function-chunk-filename 2/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/function-chunk-filename 3/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/function-chunk-filename 5/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/function-chunk-filename 6/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/function-chunk-filename 7/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/hashed-chunk-filename 0/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/hashed-chunk-filename 1/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/hashed-chunk-filename 2/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/hashed-chunk-filename 3/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/hashed-chunk-filename 4/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/hashed-chunk-filename 5/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
🟢 ↓ wasm/analyzable-esm 2/main 9 → 7 — get javascript chunk filename, publicPath
… 32 more runtime(s), see the uploaded report

Built test/configCases with the defaults a user gets: 1532 case(s), 5991 asset(s), 40 emitted nothing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 9, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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.

Actionable comments posted: 3

🧹 Nitpick comments (6)
test/configCases/wasm/analyzable-url-public-path/webpack.config.js (1)

3-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten the configuration comment.

The comment spans four lines. Reduce it to at most two short lines.

As per coding guidelines, comments must be at most two short lines.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/configCases/wasm/analyzable-url-public-path/webpack.config.js` around
lines 3 - 6, Shorten the comment above the public-path configuration to no more
than two concise lines, preserving only the essential distinction between fetch
loading and readFile’s file URL behavior.

Sources: Coding guidelines, Path instructions

test/configCases/wasm/analyzable-url-public-path/index.js (1)

16-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the compileWasm runtime path.

This test checks only the instantiateWasm output through __webpack_require__.v. A regression in the compileWasm hook can still retain RuntimeGlobals.publicPath and pass this test. Add an integration case that emits RuntimeGlobals.compileWasm and asserts its URL does not require the public-path runtime.

As per coding guidelines, cover every changed line and branch with tests, preferably through integration cases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/configCases/wasm/analyzable-url-public-path/index.js` around lines 16 -
22, Extend the integration coverage in the existing wasm analyzable-url tests to
exercise the RuntimeGlobals.compileWasm hook, not only instantiateWasm via
__webpack_require__.v. Add a case that emits compileWasm and asserts the
generated URL is baked in without retaining RuntimeGlobals.publicPath or its
runtime URL construction.

Sources: Coding guidelines, Path instructions

lib/esm/AnalyzableChunkHashPlugin.js (2)

42-52: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use full local identifier names.

Rename _err, byId, and read to names that state their contents or purpose.

As per coding guidelines, “Spell function, variable, parameter, and property names out in full.”

Also applies to: 87-100

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/esm/AnalyzableChunkHashPlugin.js` around lines 42 - 52, Rename the catch
parameter in readSpecifier from _err to a fully descriptive identifier, and
apply the same full-name convention to the byId and read identifiers in the
referenced code. Preserve all existing behavior while choosing names that
clearly describe each value’s contents or purpose.

Source: Coding guidelines


20-23: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Keep new ordinary comments to two short lines.

  • lib/esm/AnalyzableChunkHashPlugin.js#L20-L23: split or shorten the placeholder-lifetime comment.
  • lib/esm/AnalyzableChunkHashPlugin.js#L55-L58: split or shorten the deferred-specifier comment.
  • lib/esm/AnalyzableChunkHashPlugin.js#L67-L70: split or shorten the plugin-order comment.
  • lib/esm/ModuleChunkLoadingPlugin.js#L131-L133: split or shorten the HMR handler comment.

As per coding guidelines, comments must be “no more than two short lines.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/esm/AnalyzableChunkHashPlugin.js` around lines 20 - 23, Shorten or split
each ordinary comment to no more than two short lines: the placeholder-lifetime,
deferred-specifier, and plugin-order comments in
lib/esm/AnalyzableChunkHashPlugin.js at lines 20-23, 55-58, and 67-70, plus the
HMR handler comment in lib/esm/ModuleChunkLoadingPlugin.js at lines 131-133.
Preserve each comment’s existing meaning.

Sources: Coding guidelines, Path instructions

test/configCases/analyzable/hashed-chunk-filename/index.js (1)

9-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Snapshot the emitted bundles after normalizing variable values.

  • test/configCases/analyzable/hashed-chunk-filename/index.js#L9-L33: snapshot the emitted bundle after normalizing hash-dependent values.
  • test/configCases/analyzable/css-chunk-import/index.js#L17-L42: snapshot main.mjs in addition to the targeted runtime assertions.

As per coding guidelines, snapshot generated output such as bundles and use explicit assertions for behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/configCases/analyzable/hashed-chunk-filename/index.js` around lines 9 -
33, Update the test around the emitted bundle in
test/configCases/analyzable/hashed-chunk-filename/index.js:9-33 to normalize
hash-dependent values and snapshot the resulting bundle, while preserving the
existing explicit assertions. In
test/configCases/analyzable/css-chunk-import/index.js:17-42, additionally read
and snapshot main.mjs alongside the targeted runtime assertions.

Source: Coding guidelines

lib/RuntimeTemplate.js (1)

1847-1855: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Shorten the new explanatory comments.

  • lib/RuntimeTemplate.js#L1847-L1855: retain only the deferral invariant.
  • test/configCases/analyzable/function-chunk-filename/webpack.config.js#L3-L8: retain only the test-case distinction.
  • test/configCases/analyzable/hashed-chunk-filename/webpack.config.js#L5-L11: retain only the realContentHash condition.
  • lib/hmr/HotModuleReplacement.runtime.js#L198-L200: reduce the comment to two short lines.
  • lib/hmr/LazyCompilationPlugin.js#L550-L552: reduce the comment to two short lines.

As per coding guidelines, comments must be no more than two short lines and add non-obvious information.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/RuntimeTemplate.js` around lines 1847 - 1855, Shorten only the
explanatory comments at lib/RuntimeTemplate.js lines 1847-1855,
test/configCases/analyzable/function-chunk-filename/webpack.config.js lines 3-8,
test/configCases/analyzable/hashed-chunk-filename/webpack.config.js lines 5-11,
lib/hmr/HotModuleReplacement.runtime.js lines 198-200, and
lib/hmr/LazyCompilationPlugin.js lines 550-552: keep only the deferral invariant
in RuntimeTemplate, the test-case distinction in the function chunk filename
config, the realContentHash condition in the hashed chunk filename config, and
reduce each HMR comment to two short lines while preserving non-obvious
information.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/021-analyzable-import-coverage.md:
- Line 5: Shorten the changeset entry to one imperative sentence of no more than
80 characters, ending with a period, while retaining the essential description
of the analyzable ESM output and loading fixes.

In `@lib/esm/AnalyzableChunkHashPlugin.js`:
- Around line 42-49: Update readSpecifier() to validate the parsed JSON before
returning it: accept only a two-item array whose first element is a string
prefix and whose second element satisfies the existing ChunkId validation;
return null for all other payloads. Ensure processAssets destructuring around
the affected lines only receives this validated shape and does not abort on
malformed or valid-but-unexpected JSON.

In `@lib/RuntimeTemplate.js`:
- Around line 1958-1961: Update the probe chunk setup near probeChunk so
contentHash returns HASH_PROBE for every requested content-hash type, rather
than defining only the javascript key. Add a regression case covering a
CSS-bearing async chunk whose chunkFilename callback reads contentHash.css, and
verify the callback is treated as dynamic and produces the correct filename.

---

Nitpick comments:
In `@lib/esm/AnalyzableChunkHashPlugin.js`:
- Around line 42-52: Rename the catch parameter in readSpecifier from _err to a
fully descriptive identifier, and apply the same full-name convention to the
byId and read identifiers in the referenced code. Preserve all existing behavior
while choosing names that clearly describe each value’s contents or purpose.
- Around line 20-23: Shorten or split each ordinary comment to no more than two
short lines: the placeholder-lifetime, deferred-specifier, and plugin-order
comments in lib/esm/AnalyzableChunkHashPlugin.js at lines 20-23, 55-58, and
67-70, plus the HMR handler comment in lib/esm/ModuleChunkLoadingPlugin.js at
lines 131-133. Preserve each comment’s existing meaning.

In `@lib/RuntimeTemplate.js`:
- Around line 1847-1855: Shorten only the explanatory comments at
lib/RuntimeTemplate.js lines 1847-1855,
test/configCases/analyzable/function-chunk-filename/webpack.config.js lines 3-8,
test/configCases/analyzable/hashed-chunk-filename/webpack.config.js lines 5-11,
lib/hmr/HotModuleReplacement.runtime.js lines 198-200, and
lib/hmr/LazyCompilationPlugin.js lines 550-552: keep only the deferral invariant
in RuntimeTemplate, the test-case distinction in the function chunk filename
config, the realContentHash condition in the hashed chunk filename config, and
reduce each HMR comment to two short lines while preserving non-obvious
information.

In `@test/configCases/analyzable/hashed-chunk-filename/index.js`:
- Around line 9-33: Update the test around the emitted bundle in
test/configCases/analyzable/hashed-chunk-filename/index.js:9-33 to normalize
hash-dependent values and snapshot the resulting bundle, while preserving the
existing explicit assertions. In
test/configCases/analyzable/css-chunk-import/index.js:17-42, additionally read
and snapshot main.mjs alongside the targeted runtime assertions.

In `@test/configCases/wasm/analyzable-url-public-path/index.js`:
- Around line 16-22: Extend the integration coverage in the existing wasm
analyzable-url tests to exercise the RuntimeGlobals.compileWasm hook, not only
instantiateWasm via __webpack_require__.v. Add a case that emits compileWasm and
asserts the generated URL is baked in without retaining
RuntimeGlobals.publicPath or its runtime URL construction.

In `@test/configCases/wasm/analyzable-url-public-path/webpack.config.js`:
- Around line 3-6: Shorten the comment above the public-path configuration to no
more than two concise lines, preserving only the essential distinction between
fetch loading and readFile’s file URL behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 29c9d25d-e1cf-4c9e-9196-f361f487daa8

📥 Commits

Reviewing files that changed from the base of the PR and between 1b246ec and 05b5ab0.

⛔ Files ignored due to path filters (1)
  • test/statsCases/analyzable-esm-fallbacks/__snapshots__/StatsTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
📒 Files selected for processing (28)
  • .changeset/021-analyzable-import-coverage.md
  • lib/RuntimePlugin.js
  • lib/RuntimeTemplate.js
  • lib/esm/AnalyzableChunkHashPlugin.js
  • lib/esm/ModuleChunkLoadingPlugin.js
  • lib/esm/ModuleChunkLoadingRuntimeModule.js
  • lib/hmr/HotModuleReplacement.runtime.js
  • lib/hmr/LazyCompilationPlugin.js
  • lib/runtime/EnsureChunkRuntimeModule.js
  • lib/web/FetchCompileAsyncWasmPlugin.js
  • test/configCases/analyzable/css-chunk-import/index.js
  • test/configCases/analyzable/function-chunk-filename/index.js
  • test/configCases/analyzable/function-chunk-filename/lazy.js
  • test/configCases/analyzable/function-chunk-filename/webpack.config.js
  • test/configCases/analyzable/hashed-chunk-filename/index.js
  • test/configCases/analyzable/hashed-chunk-filename/lazy.js
  • test/configCases/analyzable/hashed-chunk-filename/webpack.config.js
  • test/configCases/wasm/analyzable-url-public-path/index.js
  • test/configCases/wasm/analyzable-url-public-path/lazy.js
  • test/configCases/wasm/analyzable-url-public-path/wasm.wat
  • test/configCases/wasm/analyzable-url-public-path/webpack.config.js
  • test/hotCases/esm-output/analyzable-import/async-module.js
  • test/hotCases/esm-output/analyzable-import/index.js
  • test/hotCases/esm-output/analyzable-import/test.config.js
  • test/hotCases/esm-output/analyzable-import/test.filter.js
  • test/hotCases/esm-output/analyzable-import/webpack.config.js
  • test/statsCases/analyzable-esm-fallbacks/test.config.js
  • test/statsCases/analyzable-esm-fallbacks/webpack.config.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .changeset/021-analyzable-import-coverage.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/esm/AnalyzableChunkHashPlugin.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/RuntimeTemplate.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@codspeed

codspeed Bot commented Aug 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
❌ 1 regressed benchmark
✅ 216 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Memory benchmark "future-defaults", scenario '{"name":"mode-development","mode":"development"}' 817.3 KB 1,027.9 KB -20.48%
⚡ Memory benchmark "context-commonjs", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 2,635 KB 425 KB ×6.2
⚡ Memory benchmark "devtool-eval", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 950.8 KB 469.3 KB ×2
⚡ Memory benchmark "css-modules", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 1,231.1 KB 752.7 KB +63.55%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/analyzable-esm-hmr (4baf010) with main (b599774)

Open in CodSpeed
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 9, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/RuntimeTemplate.js`:
- Around line 104-109: The contentHash probe in RuntimeTemplate must preserve
the original chunk.contentHash key set while returning the probe hash for each
key. Build the proxy target from chunk.contentHash’s existing keys, retain the
fallback get behavior for unknown direct reads, and add a regression case where
the filename is derived from Object.keys(pathData.chunk.contentHash).
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 71e15662-7c3c-41cb-9c0a-8937e5a430ac

📥 Commits

Reviewing files that changed from the base of the PR and between 05b5ab0 and 61a4d42.

📒 Files selected for processing (18)
  • .changeset/021-analyzable-import-coverage.md
  • lib/RuntimeTemplate.js
  • lib/esm/AnalyzableChunkHashPlugin.js
  • lib/esm/ModuleChunkLoadingPlugin.js
  • lib/hmr/HotModuleReplacement.runtime.js
  • lib/hmr/LazyCompilationPlugin.js
  • test/configCases/analyzable/css-content-hash-filename/index.js
  • test/configCases/analyzable/css-content-hash-filename/lazy.js
  • test/configCases/analyzable/css-content-hash-filename/style.css
  • test/configCases/analyzable/css-content-hash-filename/test.config.js
  • test/configCases/analyzable/css-content-hash-filename/test.filter.js
  • test/configCases/analyzable/css-content-hash-filename/webpack.config.js
  • test/configCases/analyzable/function-chunk-filename/webpack.config.js
  • test/configCases/analyzable/hashed-chunk-filename/webpack.config.js
  • test/configCases/wasm/analyzable-url-public-path/index.js
  • test/configCases/wasm/analyzable-url-public-path/lazy-source.js
  • test/configCases/wasm/analyzable-url-public-path/webpack.config.js
  • test/hotCases/esm-output/analyzable-import/test.filter.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (6)
  • .changeset/021-analyzable-import-coverage.md
  • lib/hmr/LazyCompilationPlugin.js
  • lib/hmr/HotModuleReplacement.runtime.js
  • lib/esm/AnalyzableChunkHashPlugin.js
  • lib/esm/ModuleChunkLoadingPlugin.js
  • test/configCases/analyzable/hashed-chunk-filename/webpack.config.js

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/RuntimeTemplate.js
Comment on lines +104 to +109
probeChunk.contentHash = new Proxy(
{},
{
get: (target, key) => (typeof key === "string" ? hash : undefined),
has: () => true
}

@coderabbitai coderabbitai Bot Aug 9, 2026

Copy link
Copy Markdown
Contributor

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve the original contentHash key set in the probe.

Line 104 replaces contentHash with a Proxy over an empty object. A chunkFilename callback that uses Object.keys(), for...in, or hasOwnProperty() sees no hash keys in both probes. The callback can then appear hash-independent during code generation but produce a hash-based filename during asset emission.

Create the probe from the original chunk.contentHash keys and replace each key value with the probe hash. Keep a fallback get trap for unknown direct reads. Add a regression case that derives the filename from Object.keys(pathData.chunk.contentHash).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/RuntimeTemplate.js` around lines 104 - 109, The contentHash probe in
RuntimeTemplate must preserve the original chunk.contentHash key set while
returning the probe hash for each key. Build the proxy target from
chunk.contentHash’s existing keys, retain the fallback get behavior for unknown
direct reads, and add a regression case where the filename is derived from
Object.keys(pathData.chunk.contentHash).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderabbitai coderabbitai Bot mentioned this pull request Aug 9, 2026
perf: load webpack's own modules only when a build needs them #21652
Merged
alexander-akait added 12 commits August 10, 2026 04:37
@alexander-akait @claude
feat: emit analyzable ESM imports under hot module replacement
876d70d
The gate refused the analyzable form for any compilation with HMR applied.
The hot require special-cased `ensureChunk` (`.e`) to block an update on a
chunk load in flight and copied everything else through, so `.ei` escaped
that wrapper — and it defined `.e` even when the runtime had none.

Wrap `.ei` the same way and define each wrapper only when it exists. Lazy
compilation generates a proxy between builds rather than from changed source,
so one already loaded outlives the build that required `ensureChunk`; keep it
in the runtime there instead of refusing the analyzable form everywhere.
@alexander-akait @claude
feat: bake a url public path into the analyzable wasm binary reference
bf2cc12
`supportsAnalyzableWasm` chained through `supportsAnalyzableEsmUrl`, so it
inherited an `auto` public path requirement it does not have: a public path
that is a complete URL bakes just as well, because `new URL(...)` ignores its
base for an absolute specifier.

A root- or directory-relative one still cannot — the runtime form resolves it
against the document and a baked one against the chunk — and neither can a
loader that hands the result to `readFile`, which takes a `file:` URL alone.
Those keep addressing the binary relative to their chunk, as they already did.
@alexander-akait @claude
perf: drop the runtime chunk loader from analyzable css and hinted ch…
4158d5d
…unks

A chunk carrying css or resource-hint children asked for `ensureChunk` just to
get the `.f` map its handlers attach to, and that pulled in the js chunk loader
and the chunk id to filename table behind it — the runtime the analyzable form
exists to replace. `.ei` dispatches every handler but `.f.j` itself, so ask for
the map alone and let `EnsureChunkRuntimeModule` emit `.e` only where it is used.

The hot runtime registers its own handler on the map and force-loads through the
others by bare chunk id, so HMR keeps both the map and the loader — which an
all-analyzable graph had silently been dropping since HMR started emitting the
analyzable form.
@alexander-akait @claude
feat: support a function output.chunkFilename in analyzable ESM output
e22f8b0
A function was refused on its type alone, without asking what it returns. Call it
for its template instead, and apply the same hash test to the answer.

No hash is knowable at this point — during code generation `chunk.contentHash` is
still empty and `chunk.hash` unset — so a function reading one would name a file
that is never emitted. A second call against a stand-in chunk carrying sentinel
hashes says whether the answer depends on them; one that does keeps the runtime
form, as does a template with a hash placeholder in it.
@alexander-akait @claude
feat: bake a hashed chunk filename into the analyzable specifier
78d5e3d
A hashed name is settled long after the code referencing it is generated, so the
specifier is emitted as a stand-in and filled in once the hash exists. That covers
`output.chunkFilename` carrying any hash, and so `[fullhash]` in a WebAssembly
filename too — the last names the analyzable form could not address.

The stand-in carries the prefix and chunk id rather than an index into per-build
state: a module restored from the persistent cache is never generated again, and
one that outlived its registry would reach the bundle unreplaced.

Substituting rewrites a chunk after its own content hash was taken, so the form is
kept only where `optimization.realContentHash` brings the two back in line.
@alexander-akait @claude
fix: resolve a deferred chunk specifier with the runtime as well
09089c7
The stand-in was filled in from a path missing `runtime`, which the call naming
the asset passes. A `[runtime]` in the template then resolved to `_` rather than
the runtime's name, so the specifier addressed a file that is never emitted.

Cover every placeholder a chunk filename can carry, asserting the baked name is
one on disk instead of a string fixed in the test.
@alexander-akait @claude
feat: defer a hash-dependent function chunk filename instead of refus…
509c9c3
…ing it

The probe telling whether a function's answer depends on a hash meant "fall
back", from when nothing could resolve one later. The deferred pass asks the
function again with the hashes settled, so it now means "defer" — `null` stays
for a function that throws, which no later call rescues.

Both hash-bearing shapes bake as a result: a template carrying a placeholder,
and a name built from `pathData` directly.
@alexander-akait @claude
refactor: drop the unreachable chunk id guard from the analyzable import
160dcec
`blockPromise` drops any chunk without an id before it calls, so the check
never fired — measured across the config and stats suites, where the operand
was evaluated 296 times and was true none of them.

The one in `_getAnalyzableChunkSpecifier` stays: `WorkerDependency` reaches
that without the same filter, and an id-less stand-in would reach the bundle
verbatim instead of falling back. Says so now.
@alexander-akait @claude
fix(esm): probe every content-hash type when a chunk filename is a fu…
76779ce
…nction

A function `output.chunkFilename` reading `contentHash.css` saw the same missing
value in both calls, so the name looked constant and `undefined` was baked into
the specifier. Probe with two distinct hashes exposed for every type instead.

Also skip the analyzable HMR case where ESM output cannot build `require`, and
reject a stand-in payload that is not a chunk reference.
@alexander-akait @claude
fix(esm): resolve an analyzable chunk specifier with the runtime as well
12402cf
`[runtime]` and `pathData.runtime` were absent where the specifier is baked, so
both read back empty and the name looked settled — `src_lazy_js.undefined.mjs`
was emitted against a `src_lazy_js.main.mjs` on disk. Hand the runtime to every
site that resolves a chunk filename, as the deferred pass already does.
@alexander-akait @claude
chore: bring the changeset entry under the length limit
5c88042
@alexander-akait @claude
fix(esm): defer a chunk name built by enumerating the content hashes
592ffcd
Which content hashes a chunk carries is settled no earlier than their values
are, so a filename function reading `Object.keys(chunk.contentHash)` saw an
empty set in both probes and baked `src_lazy_js.none.mjs` against a
`src_lazy_js.javascript-css.mjs` on disk. The probes now disagree about which
hashes exist, so asking defers just as reading one does.
@alexander-akait
alexander-akait force-pushed the feat/analyzable-esm-hmr branch from 2d2cac3 to 592ffcd Compare August 10, 2026 04:48
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 10, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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.

🧹 Nitpick comments (1)
test/configCases/wasm/analyzable-url-public-path/index.js (1)

4-5: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Shorten the test comments.

State each reason in one short line. As per coding guidelines, "{lib,hot,tooling,test}/**/*.{js,mjs}: Keep comments as short as possible, generally one line and no more than two short lines; comments must add non-obvious information and must not narrate or restate code."

Also applies to: 10-11

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/configCases/wasm/analyzable-url-public-path/index.js` around lines 4 -
5, Shorten the comments in the analyzable-url-public-path test to one concise
line per reason, preserving only the non-obvious details that the binary is
intentionally referenced but not called and that the test verifies the URL
webpack embeds for the public path.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/configCases/wasm/analyzable-url-public-path/index.js`:
- Around line 4-5: Shorten the comments in the analyzable-url-public-path test
to one concise line per reason, preserving only the non-obvious details that the
binary is intentionally referenced but not called and that the test verifies the
URL webpack embeds for the public path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e5b5f5b5-1600-4e95-8b0f-6ec5b8debd04

📥 Commits

Reviewing files that changed from the base of the PR and between b599774 and 592ffcd.

⛔ Files ignored due to path filters (1)
  • test/statsCases/analyzable-esm-fallbacks/__snapshots__/StatsTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
📒 Files selected for processing (35)
  • .changeset/021-analyzable-import-coverage.md
  • lib/RuntimePlugin.js
  • lib/RuntimeTemplate.js
  • lib/esm/AnalyzableChunkHashPlugin.js
  • lib/esm/ModuleChunkLoadingPlugin.js
  • lib/esm/ModuleChunkLoadingRuntimeModule.js
  • lib/hmr/HotModuleReplacement.runtime.js
  • lib/hmr/LazyCompilationPlugin.js
  • lib/runtime/EnsureChunkRuntimeModule.js
  • lib/web/FetchCompileAsyncWasmPlugin.js
  • test/configCases/analyzable/css-chunk-import/index.js
  • test/configCases/analyzable/css-content-hash-filename/index.js
  • test/configCases/analyzable/css-content-hash-filename/lazy.js
  • test/configCases/analyzable/css-content-hash-filename/style.css
  • test/configCases/analyzable/css-content-hash-filename/test.config.js
  • test/configCases/analyzable/css-content-hash-filename/test.filter.js
  • test/configCases/analyzable/css-content-hash-filename/webpack.config.js
  • test/configCases/analyzable/function-chunk-filename/index.js
  • test/configCases/analyzable/function-chunk-filename/lazy.js
  • test/configCases/analyzable/function-chunk-filename/webpack.config.js
  • test/configCases/analyzable/hashed-chunk-filename/index.js
  • test/configCases/analyzable/hashed-chunk-filename/lazy.js
  • test/configCases/analyzable/hashed-chunk-filename/webpack.config.js
  • test/configCases/wasm/analyzable-url-public-path/index.js
  • test/configCases/wasm/analyzable-url-public-path/lazy-source.js
  • test/configCases/wasm/analyzable-url-public-path/lazy.js
  • test/configCases/wasm/analyzable-url-public-path/wasm.wat
  • test/configCases/wasm/analyzable-url-public-path/webpack.config.js
  • test/hotCases/esm-output/analyzable-import/async-module.js
  • test/hotCases/esm-output/analyzable-import/index.js
  • test/hotCases/esm-output/analyzable-import/test.config.js
  • test/hotCases/esm-output/analyzable-import/test.filter.js
  • test/hotCases/esm-output/analyzable-import/webpack.config.js
  • test/statsCases/analyzable-esm-fallbacks/test.config.js
  • test/statsCases/analyzable-esm-fallbacks/webpack.config.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (28)
  • test/configCases/wasm/analyzable-url-public-path/lazy.js
  • test/configCases/analyzable/css-content-hash-filename/style.css
  • lib/esm/ModuleChunkLoadingRuntimeModule.js
  • test/configCases/analyzable/css-content-hash-filename/webpack.config.js
  • test/configCases/wasm/analyzable-url-public-path/lazy-source.js
  • test/statsCases/analyzable-esm-fallbacks/webpack.config.js
  • test/hotCases/esm-output/analyzable-import/test.config.js
  • test/hotCases/esm-output/analyzable-import/test.filter.js
  • lib/hmr/LazyCompilationPlugin.js
  • test/configCases/analyzable/css-content-hash-filename/test.config.js
  • test/configCases/analyzable/css-content-hash-filename/test.filter.js
  • test/hotCases/esm-output/analyzable-import/index.js
  • test/hotCases/esm-output/analyzable-import/webpack.config.js
  • test/statsCases/analyzable-esm-fallbacks/test.config.js
  • test/configCases/wasm/analyzable-url-public-path/webpack.config.js
  • lib/runtime/EnsureChunkRuntimeModule.js
  • test/configCases/analyzable/css-content-hash-filename/lazy.js
  • test/configCases/analyzable/function-chunk-filename/lazy.js
  • lib/web/FetchCompileAsyncWasmPlugin.js
  • lib/RuntimePlugin.js
  • lib/esm/ModuleChunkLoadingPlugin.js
  • test/configCases/analyzable/hashed-chunk-filename/lazy.js
  • test/configCases/analyzable/hashed-chunk-filename/webpack.config.js
  • test/configCases/wasm/analyzable-url-public-path/wasm.wat
  • lib/esm/AnalyzableChunkHashPlugin.js
  • lib/RuntimeTemplate.js
  • .changeset/021-analyzable-import-coverage.md
  • lib/hmr/HotModuleReplacement.runtime.js

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
alexander-akait added 2 commits August 10, 2026 04:54
@alexander-akait
chore: tighten two comments in the wasm analyzable url case
6fe1c20
@alexander-akait
perf(esm): keep the runtime chunk loader out of HMR builds without as…
4baf010
…ync chunks

The hot runtime force-loads through the handler map by bare chunk id, so
the analyzable path keeps `.f.j` around — but only where there is an async
chunk to force-load. Requiring it unconditionally pulled the handler map,
the chunk-filename helper and the whole `import()` loader into every
`output.module` HMR build: +2.80 KiB on configCases/module/import-meta-hot-priority.
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Types Coverage

Coverage after merging feat/analyzable-esm-hmr into main will be
99.27%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
bin
   webpack.js98.82%100%100%98.82%103
examples
   build-common.js100%100%100%100%
   buildAll.js100%100%100%100%
   examples.js100%100%100%100%
   template-common.js98.21%100%100%98.21%72
examples/custom-javascript-parser
   test.filter.js100%100%100%100%
examples/custom-javascript-parser/internals
   acorn-parse.js100%100%100%100%
   meriyah-parse.js100%100%100%100%
   oxc-parse.js100%100%100%100%
examples/markdown
   webpack.config.mjs100%100%100%100%
examples/module-federation
   test.filter.js100%100%100%100%
examples/reexport-components
   test.filter.js100%100%100%100%
examples/typescript
   test.filter.js100%100%100%100%
examples/typescript-non-erasable
   test.filter.js50%100%100%50%5
examples/virtual-modules
   test.filter.js100%100%100%100%
examples/wasm-bindgen-esm
   test.filter.js100%100%100%100%
examples/wasm-complex
   test.filter.js100%100%100%100%
examples/wasm-emscripten
   test.filter.js100%100%100%100%
examples/wasm-simple
   test.filter.js100%100%100%100%
examples/wasm-simple-source-phase
   test.filter.js100%100%100%100%
lib
   APIPlugin.js100%100%100%100%
   AsyncDependenciesBlock.js100%100%100%100%
   AutomaticPrefetchPlugin.js100%100%100%100%
   BannerPlugin.js100%100%100%100%
   Cache.js98.21%100%100%98.21%101
   CacheFacade.js100%100%100%100%
   Chunk.js99.72%100%100%99.72%39
   ChunkGraph.js100%100%100%100%
   ChunkGroup.js100%100%100%100%
   ChunkTemplate.js100%100%100%100%
   CircularModulesPlugin.js98.81%100%100%98.81%136
   CleanPlugin.js99.12%100%100%99.12%214, 234
   CodeGenerationResults.js100%100%100%100%
   CompatibilityPlugin.js100%100%100%100%
   Compilation.js98.43%100%100%98.43%1673, 1992, 1999, 2007, 2029, 2032, 2971, 3450–3451, 3483, 4192, 4222, 4275–4276, 4280, 4285, 4301–4302, 4316–4317, 4322–4323, 4843, 4869, 549, 554, 5679, 5711, 5728, 5746, 5762, 5777, 5802–5803, 5805, 6139, 6144, 6150, 6153, 6160, 6172, 6174, 6178, 6196, 6211, 6245, 6301, 6325, 6441, 801–802
   Compiler.js99.56%100%100%99.56%1168–1169, 1177
   ConcatenationScope.js99.12%100%100%99.12%300
   ConditionalInitFragment.js100%100%100%100%
   ConstPlugin.js100%100%100%100%
   ContextExclusionPlugin.js100%100%100%100%
   ContextModule.js99.88%100%100%99.88%1461
   ContextModuleFactory.js97.20%100%100%97.20%266, 435, 456, 461, 501, 512, 514, 518, 527–528
   ContextReplacementPlugin.js100%100%100%100%
   DefinePlugin.js99.08%100%100%99.08%1080, 176–177, 193, 212, 286
   DependenciesBlock.js100%100%100%100%
   Dependency.js98.51%100%100%98.51%480, 527
   DependencyTemplate.js100%100%100%100%
   DependencyTemplates.js100%100%100%100%
   DotenvPlugin.js98.41%100%100%98.41%378, 391–392
   DynamicEntryPlugin.js100%100%100%100%
   EntryOptionPlugin.js100%100%100%100%
   EntryPlugin.js100%100%100%100%
   Entrypoint.js100%100%100%100%
   EnvironmentPlugin.js97.14%100%100%97.14%49
   ErrorHelpers.js100%100%100%100%
   EvalDevToolModulePlugin.js100%100%100%100%
   EvalSourceMapDevToolPlugin.js100%100%100%100%
   ExportsInfo.js100%100%100%100%
   ExportsInfoApiPlugin.js100%100%100%100%
   ExternalModule.js98.67%100%100%98.67%1220, 1223, 519–523, 525, 671
   ExternalModuleFactoryPlugin.js100%100%100%100%
   ExternalsPlugin.js100%100%100%100%
   FileSystemInfo.js99.53%100%100%99.53%186, 2454–2455, 2458, 2469, 2480, 2491, 284, 3928, 3943, 3967
   FlagAllModulesAsUsedPlugin.js100%100%100%100%
   FlagDependencyExportsPlugin.js98.36%100%100%98.36%504, 513, 516, 520, 532
   FlagDependencyUsagePlugin.js100%100%100%100%
   FlagEntryExportAsUsedPlugin.js100%100%100%100%
   Generator.js100%100%100%100%
   HotModuleReplacementPlugin.js100%100%100%100%
   HotUpdateChunk.js100%100%100%100%
   IgnorePlugin.js100%100%100%100%
   IgnoreWarningsPlugin.js100%100%100%100%
   InitFragment.js100%100%100%100%
   JavascriptMetaInfoPlugin.js100%100%100%100%
   LazyBarrel.js100%100%100%100%
   LibraryTemplatePlugin.js100%100%100%100%
   LoaderOptionsPlugin.js100%100%100%100%
   LoaderTargetPlugin.js100%100%100%100%
   MainTemplate.js100%100%100%100%
   ManifestPlugin.js100%100%100%100%
   Module.js98.51%100%100%98.51%1303, 1308, 1368, 1382, 1444, 1453
   ModuleFactory.js100%100%100%100%
   ModuleFilenameHelpers.js98.90%100%100%98.90%111, 113
   ModuleGraph.js99.78%100%100%99.78%1170
   ModuleGraphConnection.js100%100%100%100%
   ModuleInfoHeaderPlugin.js100%100%100%100%
   ModuleNotFoundError.js100%100%100%100%
   ModuleProfile.js100%100%100%100%
   ModuleSourceTypeConstants.js100%100%100%100%
   ModuleTemplate.js100%100%100%100%
   ModuleTypeConstants.js100%100%100%100%
   MultiCompiler.js99.72%100%100%99.72%721
   MultiStats.js100%100%100%100%
   MultiWatching.js100%100%100%100%
   NoEmitOnErrorsPlugin.js100%100%100%100%
   NodeStuffPlugin.js100%100%100%100%
   NormalModule.js97.99%100%100%97.99%1027, 1030, 1047, 1064, 1312, 1346, 1362, 1817, 2114, 2119–2129, 29
   NormalModuleFactory.js98.77%100%100%98.77%1142, 1410, 1421, 1431, 1482–1484, 1491, 536, 548
   NormalModuleReplacementPlugin.js100%100%100%100%
   NullFactory.js100%100%100%100%
   OptimizationStages.js100%100%100%100%
   OptionsApply.js100%100%100%100%
   Parser.js100%100%100%100%
   PlatformPlugin.js100%100%100%100%
   PrefetchPlugin.js100%100%100%100%
   ProgressPlugin.js99.80%100%100%99.80%690
   ProvidePlugin.js100%100%100%100%
   RawModule.js100%100%100%100%
   RecordIdsPlugin.js100%100%100%100%
   RequestShortener.js100%100%100%100%
   ResolverFactory.js100%100%100%100%
   RuntimeGlobals.js100%100%100%100%
   RuntimeModule.js100%100%100%100%
   RuntimePlugin.js95.70%100%100%95.70%319, 375, 384, 387, 411, 429, 450–451, 474, 494–495, 531–532, 555, 568–569, 641, 654, 675, 694
   RuntimeTemplate.js99.90%100%100%99.90%119
   SelfModuleFactory.js100%100%100%100%
   SingleEntryPlugin.js100%100%100%100%
   SourceMapDevToolModuleOptionsPlugin.js100%100%100%100%
   SourceMapDevToolPlugin.js98.63%100%100%98.63%220, 224, 226, 420, 431, 890
   Stats.js100%100%100%100%
   Template.js100%100%100%100%
   TemplatedPathPlugin.js99.47%100%100%99.47%352–353
   UseStrictPlugin.js100%100%100%100%
   WarnCaseSensitiveModulesPlugin.js100%100%100%100%
   WarnDeprecatedOptionPlugin.js100%100%100%100%
   WarnNoModeSetPlugin.js100%100%100%100%
   WatchIgnorePlugin.js100%100%100%100%
   Watching.js100%100%100%100%
   WebpackError.js100%100%100%100%
   WebpackIsIncludedPlugin.js100%100%100%100%
   WebpackOptionsApply.js100%100%100%100%
   WebpackOptionsDefaulter.js100%100%100%100%
   buildChunkGraph.js99.87%100%100%99.87%376
   cli.js98.63%100%100%98.63%10, 119, 549, 581, 631, 905
   index.js99.73%100%100%99.73%184
   validateSchema.js94.67%100%100%94.67%100, 87, 89, 98
   webpack.js97.12%100%100%97.12%10, 267, 289, 291
lib/asset
   AssetBytesGenerator.js100%100%100%100%
   AssetBytesParser.js100%100%100%100%
   AssetGenerator.js100%100%100%100%
   AssetModule.js100%100%100%100%
   AssetModulesPlugin.js98.03%100%100%98.03%324, 348, 351, 43, 48, 481
   AssetParser.js100%100%100%100%
   AssetSourceGenerator.js100%100%100%100%
   AssetSourceParser.js100%100%100%100%
   RawDataUrlModule.js100%100%100%100%
   WebManifestGenerator.js100%100%100%100%
   WebManifestParser.js100%100%100%100%
lib/async-modules
   AsyncModuleHelpers.js100%100%100%100%
   AwaitDependenciesInitFragment.js100%100%100%100%
   InferAsyncModulesPlugin.js100%100%100%100%
   isGeneratorLowered.js100%100%100%100%
lib/bun
   BunTargetPlugin.js100%100%100%100%
lib/cache
   AddBuildDependenciesPlugin.js100%100%100%100%
   AddManagedPathsPlugin.js100%100%100%100%
   IdleFileCachePlugin.js97.92%100%100%97.92%75, 87, 95
   MemoryCachePlugin.js92%100%100%92%34, 43
   MemoryWithGcCachePlugin.js93.42%100%100%93.42%108, 122–123, 132, 90
   PackFileCacheStrategy.js96.52%100%100%96.52%1310, 1410, 1414, 1476, 1712, 1796, 1819, 1851, 675, 694, 704–706, 708, 724–725, 730, 733, 735, 740, 745, 770, 776, 810,
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait merged commit e3f177c into main Aug 10, 2026
64 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait deleted the feat/analyzable-esm-hmr branch August 10, 2026 06:28
This was referenced Aug 10, 2026
CSS dependencies end up as [Object object] #21671
Closed
feat(esm): bake templated public paths and hashed wasm names into analyzable output #21669
Merged
feat(esm): widen where analyzable references bake, and report why they don't #21680
Merged
docs: multiple distinct changelog entries that all reference pull request two one four seven seven #21684
Closed
feat(esm): bake analyzable references per asset, and drop the asset wrapper no one reads #21688
Merged
fix(esm): correct analyzable references that could go stale, resolve wrongly, or fail the build #21699
Merged
fix(esm): bake analyzable imports for blocks that name no module of their own #21722
Merged
perf(context): stop shipping a chunk loader a context module never calls #21729
Merged
fix(analyzable): report the silent fallbacks, group wasm by shared binary, drop unread runtime #21742
Merged
This was referenced Aug 17, 2026
fix(analyzable): resolve a relative baseUri against the chunk, bake one direction of a hash cycle #21750
Merged
feat(analyzable): bake a wasm url under a relative public path #21760
Merged
feat(analyzable): bake a lazy context's chunk imports into its map #21772
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area: runtime Emitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm) area: watch Watching, HMR, lazy compilation (lib/hmr, hot/)

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@alexander-akait
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.