fix: preserve lazy compilation invalidation provenance#14753
fix: preserve lazy compilation invalidation provenance#14753ScriptedAlchemy wants to merge 22 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves watch-mode correctness around lazy compilation by tracking whether an invalidation was explicitly triggered by lazy compilation middleware vs. a “normal” invalidation, and by snapshotting that provenance at each watch-cycle boundary so it can be consumed reliably by hooks/stats.
Changes:
- Track “lazy” vs “normal” invalidation provenance across invalidations and snapshot it per watch cycle in
Watching. - Update lazy compilation dev-server middleware to tag invalidations on the activated child compiler in multi-compiler mode.
- Adjust entrypoint auto-detection in stats to rely on chunk-group asset data (snapshot-safe) rather than
Chunk.files.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/rspack-test/compilerCases/watching.js | Adds a regression test asserting lazy invalidation provenance is snapshotted per watch cycle. |
| packages/rspack/src/Watching.ts | Records invalidation provenance via internal Symbol.for(...) flags and snapshots it at the start of each watch compilation. |
| packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts | Switches entrypoint simplification heuristics to use chunk-group assets/auxiliaryAssets rather than chunk file sets. |
| packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts | Ensures only the activated child compiler is tagged as a lazy invalidation source in multi-compiler middleware. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Binary Size-limit
❌ Size increased by 12.00KB from 66.51MB to 66.52MB (⬆️0.02%) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7e9b6712c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 447f6a8585
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a938a49ea3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 457c779f94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3611f8a33c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a3a2232cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfceff3ebc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…n-watch-provenance # Conflicts: # tests/rspack-test/hotCases/sharing/share-plugin/__snapshots__/web/1.snap.txt
Deploying rspack with
|
| Latest commit: |
3c20a6b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://09c9267e.rspack-v2.pages.dev |
| Branch Preview URL: | https://codex-lazy-compilation-watch.rspack-v2.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c20a6bb78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Records explicit lazy invalidations separately from normal invalidations and snapshots that provenance at each watch-cycle boundary. MultiCompiler resumes already-recorded child invalidations without reclassifying them as normal, lazy middleware tags only the activated child compiler, and entrypoint stats use snapshot-safe chunk-group asset data.
Related links
Tests
Checklist