Repository navigation
fix: reset the chunk graph when unsealing a compilation - #22888
Conversation
🦋 Changeset detectedLatest commit: 00cca13 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Reset chunk graph during unseal lib/Compilation.js, .changeset/050-reseal-chunk-graph.md |
Compilation.unseal() creates a new ChunkGraph from the existing module graph and output hash function. The changeset describes this reseal behavior. |
Exercise repeated sealing with split chunks test/configCases/split-chunks/reseal/* |
The fixture requests an additional seal, checks that module-associated chunks belong to the compilation, and verifies the shared and lazy module exports. |
Possibly related PRs
- webpack/webpack#22810: Both changes update per-compilation chunk state during
unseal(). - webpack/webpack#22885: Both changes cover additional sealing requests.
Suggested reviewers: alexander-akait
Priority:
Change: Bug fix
Merge Risk: 
Minimal · up to 62269
-
No actionable merge-blocking issue is established; the change is ready for normal merge checks.
Pre-merge checks: 
3 · 
1
-
Failed checks: 1 inconclusive Passed checks: 3 passedFull details: Title check
-
Explanation
The title uses valid Conventional Commit syntax with the allowed type
fixand clearly describes the main change. The branch prefix is not provided, so the required type-to-branch-prefix match cannot be verified.Resolution
Provide the branch name or confirm that its prefix is
fix.
-
- 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.
Comment @coderabbitai help to get the list of available commands.
|
This PR is packaged and the instant preview of its latest commit is available. Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@22888
yarn add -D webpack@https://pkg.pr.new/webpack@22888
pnpm add -D webpack@https://pkg.pr.new/webpack@22888 |
Types CoverageCoverage after merging fix/split-chunks-reseal into main will be
Coverage Report |
Generated code sizeComparing base (
Read No asset that both runs emit changed size — everything below is new or deleted. 3 asset(s) this pull request adds
No runtime that both runs build changed which runtime modules it carries. 1 runtime(s) this pull request adds or no longer builds
Built |
Merging this PR will improve performance by 21.28%2 warnings, 1 note
Performance Changes
Tip Curious why performance improved? Comment Comparing |
6226986 to
00cca13
Compare
Summary
Reset the chunk graph in
Compilation.unseal()so another seal cannot reuse references to removed chunks. This fixes a regression introduced by cc8e6a1, which moved graph initialization fromseal()to the constructor.With two entries sharing a module,
splitChunks.chunks: "all", and a plugin requesting another seal:TypeError: Cannot mix BigInt and other types, use explicit conversionsinSplitChunksPlugin42and43.Constructor counts in real builds confirm one graph for a normal compilation and one replacement for an additional seal.
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes:
test/configCases/split-chunks/reseal/checks repeated sealing, chunk graph integrity, and synchronous/asynchronous loading. All 38 targeted checks passed, including persistent-cache cases, along withyarn lint.Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
AI assisted with investigation, implementation, regression tests, and this description.
Summary by CodeRabbit