Skip to content

fix: preserve lazy compilation invalidation provenance#14753

Open
ScriptedAlchemy wants to merge 22 commits into
mainfrom
codex/lazy-compilation-watch-provenance
Open

fix: preserve lazy compilation invalidation provenance#14753
ScriptedAlchemy wants to merge 22 commits into
mainfrom
codex/lazy-compilation-watch-provenance

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

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

  • Rspack package build passed.
  • Focused watcher regression: 401 passed.
  • Focused MultiCompiler dependency/provenance regression: 401 passed.
  • E2E-tested canary: @rspack-canary/core@2.1.4-canary-447f6a85-20260711031950. Latest successful canary: @rspack-canary/core@2.1.4-canary-a938a49e-20260711045630.
  • Cross-repository Playwright route activation passed with linked previews.

Checklist

  • Tests updated.
  • Documentation updated (not required).

Copilot AI review requested due to automatic review settings July 11, 2026 02:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts Outdated
@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing b563d17 to fix: respect RSPACK_BINDING in loader workers (#14775) by hardfist

❌ Size increased by 12.00KB from 66.51MB to 66.52MB (⬆️0.02%)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/rspack/src/Watching.ts Outdated
@codspeed-hq

codspeed-hq Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 47 skipped benchmarks1


Comparing codex/lazy-compilation-watch-provenance (b563d17) with main (03465ca)

Open in CodSpeed

Footnotes

  1. 47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/rspack/src/MultiCompiler.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/rspack/src/Watching.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/rspack/src/Watching.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/rspack/src/NativeWatchFileSystem.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/rspack/src/NativeWatchFileSystem.ts Outdated
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

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

View logs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/rspack/src/MultiCompiler.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants