fix: detect module graph change right before build_chunk_graph#9453
Merged
fix: detect module graph change right before build_chunk_graph#9453
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
CodSpeed Performance ReportMerging #9453 will not alter performanceComparing 🎉 Hooray!
|
c6b68bb to
506b32f
Compare
ahabhgk
reviewed
Feb 25, 2025
...spack-test-tools/tests/watchCases/build-chunk-graph/skip-building-chunk-graph/test.config.js
Outdated
Show resolved
Hide resolved
506b32f to
13bad2f
Compare
13bad2f to
9054048
Compare
jerrykingxyz
approved these changes
Feb 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Background
We have a way to skip re-building chunk graph, that is, when module graph has no change, no incoming outgoing changes, we can skip creating chunks for current compilation.
We detect module graph change in make phase before, which is not exactly accurate.
Issue
Many optimizations are applied after make phase, for example,
innerGraph,sideEffectsandusedExports, they can change module graph as well. To solve this, we did a lot of hack to detect change according to many aspects, evendependency.ids, as it can affect howsideEffectsoptimized.Current solution
Now I move this detection later right before
build_chunk_graph, and compare current outgoings with last compilation, in this stage, all optimizations are already applied.Long term solution
When incremental for
build_chunk_graphis stable, we no longer need to detect the changes and skip creating chunks, as incremental build chunks is performant enoughChecklist