Repository navigation
Fix/rsbuild static chunk availability - #8780
LadyBluenotes wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 3e09e47 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
|
View your CI Pipeline Execution ↗ for commit 3e09e47
☁️ Nx Cloud last updated this comment at |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
🚀 Changeset Version Preview11 package(s) bumped directly, 12 bumped as dependents. 🟩 Patch bumps
|
Merging this PR will improve performance by 3%2 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
Bundle Size BenchmarksThis pull request does not affect bundle size in any measured scenario. |
…cross loading paths A shared chunk recorded static imports to every chunk in the union of its groups and their ancestors, so it pointed at each sibling route's copy of a duplicated module. Compute availability per chunk group as its own chunks plus the intersection of its parents, iterate to a shrinking fixed point for cyclic async graphs, and intersect across the chunk's groups.
… own loading context
96b2c48 to
3e09e47
Compare
🎯 Changes
Follow-up to #8695 (#8415, #8511).
computeStaticDependencyChunks()treated a chunk as available if any group of the importing chunk, or any ancestor, contained it. A shared chunk in sibling route groups therefore got import edges to each route's copy of a duplicated module, and the manifest gave route A route C's CSS and preloads.Rspack and webpack combine availability across parents with intersection (
intersect_withincode_splitter.rs;minAvailableModules &= availableModulesinbuildChunkGraph.js). This PR does the same per chunk group: own chunks plus the intersection of the parents' availability. It iterates to a fixed point that only shrinks, so cyclic async graphs terminate and give the same result in any order. A chunk's availability is the intersection across its groups.New Rspack-fixture tests: sibling duplication, a two-parent lazy group, a dependency available on every path, and a ping/pong cycle in both orders.
AI disclosure: drafted with an AI assistant; reviewed and verified by me.
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
Tests