Skip to content

feat: add compilation.hooks.chunkHashDependencies - #22810

Merged
alexander-akait merged 11 commits into
mainfrom
feat/chunk-hash-dependencies
Oct 23, 2026
Merged

alexander-akait merged 11 commits into
mainfrom
feat/chunk-hash-dependencies

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Stacked on #22804; review that first, and this diff shows only the hook.

#19439 and #22803 were the same bug: a chunk names another chunk's hashed file, but nothing makes its hash follow that chunk's. Each fix patched one format and relied on createHash's order without saying so. This PR adds one hook that declares the dependency instead:

compilation.hooks.chunkHashDependencies.tap("MyPlugin", (chunk, dependencies) => {
	if (chunk.name === "main") dependencies.add(otherChunk); // main's output names otherChunk's file
});

This also fixes a stale import, in ESM and CommonJS, when the runtime chunk's name depends on the compilation hash (runtimeChunk: "multiple", publicPath: "/[fullhash]/", then change another entry):

before  ESM  a.ff4e…js -> runtime~a.a0893c…js (not emitted)
before  CJS  a.0541…js -> runtime~a.4fc414…js (not emitted)
before  realContentHash: true → RealContentHashPlugin "unexpected caching problem"
after   every import and require resolves to an emitted file

Cost, measured against the base branch on a stress fixture (300 ESM/CommonJS entries in dependOn chains, shared split chunks, async imports; 6 builds per process, --cpu-prof at 100 µs):

createHash time per build new code per build heap after GC
ESM, runtimeChunk: "single" 29.3 → 31.3 ms ≈ 7 ms, mostly sorting moved out of createHash 53.1 → 52.0 MB
ESM, runtime inlined 49.9 → 33.0 ms ≈ 3.5 ms 53.3 → 53.7 MB
CommonJS, runtimeChunk: "single" 22.7 → 22.4 ms ≈ 3.3 ms 51.9 → 51.7 MB

Build times overlap across arms (596–1,829 ms per build). ESM output is byte-identical to the base branch. CommonJS entry chunks get new hashes once, because the runtime chunk's hash now enters through the hook. With realContentHash: false, and with publicPath: "/[fullhash]/" on top, every one of the 590 names in the runtime's filename map and every static require resolves to an emitted file.

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes. Each one fails when its part of the change is disabled:

  • test/watchCases/cache/entry-full-hash-runtime/: ESM and CommonJS × realContentHash, with a runtime chunk renamed by [fullhash] (late rehash).
  • test/watchCases/cache/chunk-hash-dependencies-plugin/: a third-party plugin names another chunk's file and only declares the dependency (ordering and hash mixing).
  • test/configCases/hash/chunk-hash-dependencies-order/: exact hashing order for entry and runtime chunks, getChunkHashDependencies, and RuntimeTemplate agreeing with createHash for every pair in a round.
  • test/configCases/hash/chunk-hash-dependencies-warnings/: cycle warning and later-round warning.
  • test/watchCases/cache/esm-entry-imported-chunk-hash/ from fix(esm): rehash entry chunks when a chunk they import changes #22804 still passes on the hook.

Does this PR introduce a breaking change?

No. CommonJS and ESM entry chunks may get new hashes once.

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

The new hook compilation.hooks.chunkHashDependencies (SyncHook<[Chunk, Set<Chunk>]>) and compilation.getChunkHashDependencies(chunk) belong in the compilation hooks page on webpack.js.org.

Use of AI

Claude Code designed the hook with the requester, wrote the tests first, implemented the change, found the [fullhash] runtime case and the RuntimeTemplate order mismatch, checked that each test fails when its mechanism is disabled, and measured CPU and memory. The requester reviewed the work.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added a hook for plugins to declare which chunks’ hashes other chunks depend on. Declared dependencies are reflected in chunk hash ordering, helping generated assets stay consistent when chunks reference one another.
  • Bug Fixes
    • Improved hash handling for runtime and imported chunks, including watch builds, so generated references point to assets from the current compilation.
    • Builds can continue when hash dependencies are circular or cannot be ordered; warnings identify those cases.

@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a1866dd

The changes in this PR will be included in the next version bump.

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

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions Bot added area: parser JavaScript parsing and dependency analysis (lib/javascript, lib/dependencies) area: runtime Emitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm) area: types types.d.ts, JSDoc annotations, hand-maintained declarations labels Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 90a7e89 and a1866dd.

⛔ Files ignored due to path filters: 1
  • types.d.ts is excluded by !types.d.ts
📒 Files selected for processing: 4
  • lib/Compilation.js
  • lib/javascript/CommonJsChunkFormatPlugin.js
  • lib/template/RuntimeTemplate.js
  • test/unitCases/javascript/parser.unittest.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

Compilation adds a hook for declaring chunk-hash dependencies. It uses declared dependencies to order chunk hashing and include referenced chunk hashes. Chunk-format integrations and configuration and watch-cache tests cover dependency ordering, warnings, and emitted asset references.

Changes: Chunk Hash Dependency Processing

Layer / File(s) Summary
Dependency tracking and hash ordering
.changeset/020-chunk-hash-dependencies-hook.md, lib/Compilation.js
Compilation adds and caches the dependency hook, computes chunk order across four hash rounds, reports ordering warnings, and propagates full-hash requirements.
Chunk formats and hash consumers
lib/esm/ModuleChunkFormatPlugin.js, lib/javascript/*, lib/template/RuntimeTemplate.js
ESM and CommonJS formats register hash dependencies. JavaScript chunk hashing includes dependency hashes, and RuntimeTemplate uses the computed chunk order.
Ordering and warning configuration tests
test/configCases/hash/chunk-hash-dependencies-order/*, test/configCases/hash/chunk-hash-dependencies-warnings/*, test/unitCases/javascript/parser.unittest.js
Tests check dependency-aware ordering, compare runtime-template order with hash order, and cover warnings for circular and later-round dependencies. The parser unit test adds a ParserOptions typedef.
Watch-cache declared dependency test
test/watchCases/cache/chunk-hash-dependencies-plugin/*
The test checks that a filename written into a chunk from a declared dependency exists among the current compilation’s assets.
Watch-cache hashed asset reference tests
test/watchCases/cache/chunk-kinds-imported-hash/*, test/watchCases/cache/entry-full-hash-runtime/*
Tests check that emitted JavaScript, CSS, HTML, module, and runtime references resolve to assets in the current compilation across multiple compiler settings.

Possibly related PRs

Suggested reviewers: hai-x

Priority: ➖ Normal

Change: Feature

Merge Risk: ⚪ Minimal · up to a1866

No identified issue currently blocks merging after normal checks.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Inconclusive The title uses valid Conventional Commit syntax with the allowed type feat and clearly describes the main change. The branch prefix is not provided, so the required type-prefix match cannot be verif… Provide the branch name or confirm that its prefix is feat.}]} ува? Wait JSON malformed due missing quote? Need exact valid. Also response format says resolution string. Let's formulate. Ensure no stray. Output only JSON. encased proper. …
Passed Passed checks: 3 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Full details: Title check

Explanation

The title uses valid Conventional Commit syntax with the allowed type feat and clearly describes the main change. The branch prefix is not provided, so the required type-prefix match cannot be verified.

Resolution

Provide the branch name or confirm that its prefix is feat.}]} ува? Wait JSON malformed due missing quote? Need exact valid. Also response format says resolution string. Let's formulate. Ensure no stray. Output only JSON. encased proper. [

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Base automatically changed from fix/esm-entry-imported-chunk-hash to main October 19, 2026 17:47
@github-actions github-actions Bot added the area: config Options, defaults, validation (lib/config, schemas/) label Oct 19, 2026
@alexander-akait
alexander-akait force-pushed the feat/chunk-hash-dependencies branch from e9c4ce1 to e4d731a Compare October 19, 2026 18:21
@github-actions

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview of its latest commit is available.

Install it locally:

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

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Types Coverage

Coverage after merging feat/chunk-hash-dependencies into main will be
99.28%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
bin
   webpack.js98.84%100%100%98.84%113
declarations
   WebpackOptions.ts99.94%100%100%99.94%4240
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/ssr
   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
   Chunk.js100%100%100%100%
   Compilation.js98.74%100%100%98.74%1823, 2135, 2142, 2150, 2172, 2175, 3161, 3720, 3763, 4354, 4358, 4484, 4505, 4630, 4667, 4674, 4727–4728, 4732, 4737, 4753–4754, 4768–4769, 4774–4775, 5303, 5329, 6250, 6267, 6285, 6301, 6316, 6341, 6344, 6756, 6759–6760, 6765, 6780, 6863, 6887, 883–884
   Compiler.js98.81%100%100%98.81%1107, 1144, 1147, 1323–1324, 1332, 848, 932, 972
   Dependency.js100%100%100%100%
   DependencyTemplate.js100%100%100%100%
   EntryPlugin.js100%100%100%100%
   Entrypoint.js100%100%100%100%
   ExternalsPlugin.js100%100%100%100%
   FileSystemInfo.js100%100%100%100%
   InitFragment.js100%100%100%100%
   LibraryTemplatePlugin.js100%100%100%100%
   ModuleFilenameHelpers.js100%100%100%100%
   ModuleNotFoundError.js100%100%100%100%
   MultiCompiler.js98.91%100%100%98.91%489, 561, 748, 813
   NormalModule.js100%100%100%100%
   NullFactory.js100%100%100%100%
   ProgressPlugin.js100%100%100%100%
   RawModule.js100%100%100%100%
   RequestShortener.js100%100%100%100%
   SingleEntryPlugin.js100%100%100%100%
   WebpackError.js100%100%100%100%
   index.js100%100%100%100%
   webpack.js98.59%100%100%98.59%306, 308
lib/asset
   AssetBytesGenerator.js100%100%100%100%
   AssetBytesParser.js91.67%100%100%91.67%27
   AssetGenerator.js100%100%100%100%
   AssetModule.js100%100%100%100%
   AssetModulesPlugin.js98.45%100%100%98.45%334, 360, 363, 493, 58
   AssetParser.js96.15%100%100%96.15%47
   AssetSourceGenerator.js100%100%100%100%
   AssetSourceParser.js91.67%100%100%91.67%27
   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%
   Cache.js98.25%100%100%98.25%104
   CacheFacade.js100%100%100%100%
   IdleFileCachePlugin.js97.92%100%100%97.92%75, 87, 95
   MemoryCachePlugin.js92%100%100%92%33, 42
   MemoryWithGcCachePlugin.js93.42%100%100%93.42%106, 120–121, 130, 88
   PackFileCacheStrategy.js96.54%100%100%96.54%1304, 1404, 1408, 1470, 1716, 1796, 1819, 1849, 684, 703, 713–715, 717, 733–734, 739, 742, 744, 749, 754, 779, 785, 819, 825, 831, 836, 847, 856, 861–862, 864, 881, 887–888, 890
   ResolverCachePlugin.js100%100%100%100%
   getLazyHashedEtag.js100%100%100%100%
   mergeEtags.js100%100%100%100%
lib/config
   OptionsApply.js100%100%100%100%
   PlatformPlugin.js100%100%100%100%
   WebpackOptionsApply.js100%100%100%100%
   WebpackOptionsDefaulter.js100%100%100%100%
   browserslistTargetHandler.js100%100%100%100%
   cli.js98.89%100%100%98.89%114, 549, 581, 631
   defaults.js99.59%100%100%99.59%1633–1635, 1643, 288, 548
   defineConfig.js100%100%100%100%
   getClaimedAssetTypes.js100%100%100%100%
   normalization.js99.14%100%100%99.14%285–286, 356, 371
   target.js100%100%100%100%
   validateSchema.js94.67%100%100%94.67%100, 87, 89, 98
lib/container
   ContainerEntryDependency.js100%100%100%100%
   ContainerEntryModule.js100%100%100%100%
   ContainerEntryModuleFactory.js100%100%100%100%
   ContainerExposedDependency.js100%100%100%100%
   ContainerPlugin.js100%100%100%100%
   ContainerReferencePlugin.js100%100%100%100%
   FallbackDependency.js100%100%100%100%
   FallbackItemDependency.js100%100%100%100%
   FallbackModule.js100%100%100%100%
   FallbackModuleFactory.js100%100%100%100%
   HoistContainerReferencesPlugin.js100%100%100%100%
   ModuleFederationPlugin.js100%100%100%100%
   RemoteModule.js100%100%100%100%
   RemoteRuntimeModule.js100%100%100%100%
   RemoteToExternalDependency.js100%100%100%100%
   declaredRemotes.js100%100%100%100%
   moduleFederationHooks.js100%100%100%100%
   options.js100%100%100%100%
lib/context
   ContextExclusionPlugin.js100%100%100%100%
   ContextModule.js99.88%100%100%99.88%1495
   ContextModuleFactory.js95.70%100%100%95.70%230, 257, 276, 280–281, 289, 466, 487, 492, 534, 543, 545, 549, 552, 558–559
   ContextReplacementPlugin.js100%100%100%100%
lib/css
   CssGenerator.js99.29%100%100%99.29%1085, 129, 305, 837
   CssInjectStyleRuntimeModule.js100%100%100%100%
   CssLoadingRuntimeModule.js100%100%100%100%
   CssModule.js100%100%100%100%
   CssModulesPlugin.js98.72%100%100%98.72%217, 418, 432, 445, 458, 481, 494, 507, 520
   CssParser.js99.76%100%100%99.76%1090, 2425, 3072, 3075, 3081, 3514, 943
   CssServerStylesRuntimeModule.js100%100%100%100%
   conventions.js100%100%100%100%
   cssMinify.js100%100%100%100%
   data.js99.84%100%100%99.84%229, 5605
   syntax-parser.js99.69%100%100%99.69%11236–11237, 11789–11790, 11827, 12037, 12086, 14482, 14543–14546, 14651–14652, 14750–14751, 15524, 15820, 15822, 16377, 16769, 16811, 19152, 2631, 3338, 3340, 3345, 3364, 4113, 4119
   syntax-printer.js99.33%100%100%99.33%2610–2611, 2613–2614, 2616–2617, 2622, 2892–2895, 2988, 356, 3689, 4114, 4250, 4927, 5241, 6138, 730
   syntax.js100%100%100%100%
   topologicalSort.js100%100%100%100%
lib/debug
   ProfilingPlugin.js100%100%100%100%
lib/define
   DefinePlugin.js99.42%100%100%99.42%1488, 936, 938, 943, 967
   DotenvPlugin.js97.61%100%100%97.61%276, 395, 443, 456–457
   EnvironmentPlugin.js100%100%100%100%
lib/deno
   DenoTargetPlugin.js100%100%100%100%
lib/dependencies
   ConstDependency.js100%100%100%100%
   ContextElementDependency.js100%100%100%100%
   NullDependency.js100%100%100%100%
lib/dependencies/amd
   AMDDefineDependency.js100%100%100%100%
   AMDDefineDependencyParserPlugin.js100%100%100%100%
   AMDPlugin.js99.31%100%100%99.31%54
   AMDRequireArrayDependency.js100%100%100%100%
   AMDRequireContextDependency.js100%100%100%100%
   AMDRequireDependenciesBlock.js100%100%100%100%
   AMDRequireDependenciesBlockParserPlugin.js100%100%100%100%
   AMDRequireDependency.js100%100%100%100%
   AMDRequireItemDependency.js100%100%100%100%
   AMDRuntimeModules.js95.45%100%100%95.45%65
   LocalModule.js100%100%100%100%
   LocalModuleDependency.js100%100%100%100%
   LocalModulesHelpers.js100%100%100%100%
   RequireJsStuffPlugin.js100%100%100%100%
   UnsupportedDependency.js100%100%100%100%
lib/dependencies/commonjs
   CommonJsDependencyHelpers.js98.63%100%100%98.63%43
   CommonJsExportRequireDependency.js99.21%100%100%99.21%413, 415,

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Generated code size

Comparing base (74f38b7) to head (a1866dd). Merging this pull request adds 14 new asset(s).

What moved Tests Assets Gzip Raw Test edit
Changed, test untouched 0 0 — — —
Changed, test edited 0 0 — — —
New 2 14 ⚪ added +6.91 KiB ⚪ added +21.23 KiB —
Deleted 0 0 — — —
Unchanged — 9109 — — —

Read Changed, test untouched first: the test is byte-identical on both sides, so webpack generated the difference. Changed, test edited moved partly because the test did — Test edit is how many bytes the test gained, and a bundle that grew by less is not a regression. New and Deleted are whole files, not deltas — a new asset was created, not grown, so it reads gray (⚪ added) — and adding tests cannot bury a real change. Gzip decides, because that is what users download; raw is the tiebreak, and brotli and zstd are per asset below.

No asset that both runs emit changed size — everything below is new or deleted.

14 asset(s) this pull request adds
Asset Raw Gzip (9) Brotli (11) Zstd (19)
⚪ added hash/chunk-hash-dependencies-warnings runtime.js 5.03 KiB 1.33 KiB 1.16 KiB 1.32 KiB
⚪ added hash/chunk-hash-dependencies-order runtime~bundle.js 3.47 KiB 979 B 856 B 984 B
⚪ added hash/chunk-hash-dependencies-order runtime~a.js 2.61 KiB 740 B 667 B 752 B
⚪ added hash/chunk-hash-dependencies-order runtime~b.js 2.61 KiB 741 B 665 B 752 B
⚪ added hash/chunk-hash-dependencies-order runtime~c.js 2.61 KiB 740 B 665 B 752 B
⚪ added hash/chunk-hash-dependencies-order bundle.js 1.80 KiB 742 B 642 B 745 B
⚪ added hash/chunk-hash-dependencies-warnings a.js 721 B 343 B 296 B 340 B
⚪ added hash/chunk-hash-dependencies-warnings b.js 721 B 343 B 296 B 341 B
⚪ added hash/chunk-hash-dependencies-warnings bundle.js 436 B 262 B 246 B 254 B
⚪ added hash/chunk-hash-dependencies-order a.js 347 B 205 B 170 B 197 B
⚪ added hash/chunk-hash-dependencies-order b.js 347 B 204 B 169 B 196 B
⚪ added hash/chunk-hash-dependencies-order c.js 347 B 205 B 180 B 197 B
⚪ added hash/chunk-hash-dependencies-order order.json 152 B 117 B 107 B 104 B
⚪ added hash/chunk-hash-dependencies-warnings shared.js 100 B 98 B 83 B 93 B

No runtime that both runs build changed which runtime modules it carries.

5 runtime(s) this pull request adds or no longer builds
Runtime Modules
➕ hash/chunk-hash-dependencies-warnings runtime 7
➕ hash/chunk-hash-dependencies-order runtime~bundle 4
➕ hash/chunk-hash-dependencies-order runtime~a 2
➕ hash/chunk-hash-dependencies-order runtime~b 2
➕ hash/chunk-hash-dependencies-order runtime~c 2

Built test/configCases with the defaults a user gets: 2282 test(s), 9123 asset(s), 101 emitted nothing.

@codspeed

codspeed Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 54.75%

2 warnings, 1 note

⚠️ 111 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

ℹ️ 46 benchmarks have no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

⚡ 1 improved benchmark
✅ 338 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Memory benchmark "hmr", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 176.9 KB 114.3 KB +54.75%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/chunk-hash-dependencies (a1866dd) with main (74f38b7)

Open in CodSpeed

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.93814% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.54%. Comparing base (74f38b7) to head (a1866dd).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/Compilation.js 97.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main   #22810       +/-   ##
===========================================
+ Coverage   77.15%   96.54%   +19.39%     
===========================================
  Files         601      778      +177     
  Lines      133153   141164     +8011     
  Branches    46098    48311     +2213     
===========================================
+ Hits       102733   136289    +33556     
+ Misses      30420     4875    -25545     
Flag Coverage Δ
css-html-xml 28.87% <66.66%> (?)
integration 74.80% <97.93%> (?)
minify-corpora 89.88% <ø> (?)
syntax-equivalence 79.05% <ø> (?)
test262 54.43% <72.16%> (?)
test262-parser 72.12% <ø> (?)
unit 77.15% <71.13%> (+<0.01%) ⬆️

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.

Cases for a chunk naming another chunk's file: a runtime chunk renamed by
the compilation hash, a plugin declaring the dependency, the hashing order
and the warnings for dependencies that cannot be honored.
A chunk declares the chunks whose hashes its output reads. createHash
hashes them first, in a shared order RuntimeTemplate reads too, and
JavascriptModulesPlugin mixes their hashes into the chunk's. The ESM and
CommonJS chunk formats declare what their startup imports or requires.
Positions run across the hashing rounds, so RuntimeTemplate compares them
instead of classifying rounds itself; the walk positions chunks as it goes
and JavascriptModulesPlugin mixes dependency hashes in one tap. A watch
case covers HTML, CSS and worker chunks naming other chunks' files.
Recomputing the round per dependency edge walks the chunk's groups in
canBeInitial; a map filled while sorting chunks into rounds is cheaper.
node-commonjs externals import createRequire, which Node 10 lacks.
@alexander-akait
alexander-akait force-pushed the feat/chunk-hash-dependencies branch from 90a7e89 to a1866dd Compare October 23, 2026 13:42
@alexander-akait
alexander-akait merged commit 0bd77d3 into main Oct 23, 2026
70 checks passed
@alexander-akait
alexander-akait deleted the feat/chunk-hash-dependencies branch October 23, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: config Options, defaults, validation (lib/config, schemas/) area: parser JavaScript parsing and dependency analysis (lib/javascript, lib/dependencies) area: runtime Emitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm) area: types types.d.ts, JSDoc annotations, hand-maintained declarations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant