Skip to content

fix(angular-rspack): handler accumulation and watchOptions for double rebuilds#34154

Merged
Coly010 merged 1 commit intonrwl:masterfrom
faileon:fix/ng-rspack-handlers-accumulation
Jan 20, 2026
Merged

fix(angular-rspack): handler accumulation and watchOptions for double rebuilds#34154
Coly010 merged 1 commit intonrwl:masterfrom
faileon:fix/ng-rspack-handlers-accumulation

Conversation

@faileon
Copy link
Contributor

@faileon faileon commented Jan 20, 2026

Current Behavior

  1. Handler accumulation: The compilation, beforeCompile, and done hooks are registered inside watchRun, causing new handlers to be added on every rebuild cycle. This leads to performance degradation and duplicate operations during watch mode.
  2. Double rebuilds: Rapid filesystem events (e.g., editor backup/swap files) trigger multiple rebuilds because there's no aggregation timeout configured.
  3. No watchOptions configuration: Users cannot customize watcher behavior (aggregateTimeout, ignored patterns, etc.).

Expected Behavior

  1. Hooks should be registered once outside of watchRun to prevent accumulation. Shared state is used to pass data between watch cycles and compilation hooks.
  2. A default aggregateTimeout: 50 batches rapid filesystem events to prevent double rebuilds.
  3. Users can provide custom watchOptions to configure watcher behavior, with user options taking precedence over defaults.

Related Issue(s)

#34142 (comment)

@faileon faileon requested a review from a team as a code owner January 20, 2026 11:15
@faileon faileon requested a review from Coly010 January 20, 2026 11:15
@netlify
Copy link

netlify bot commented Jan 20, 2026

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 18d727b

@vercel
Copy link

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Jan 20, 2026 11:20am

Request Review

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Jan 20, 2026

View your CI Pipeline Execution ↗ for commit 18d727b

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 3m 32s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 30s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 11s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-20 13:24:49 UTC

@Coly010 Coly010 merged commit 2d7e24c into nrwl:master Jan 20, 2026
16 of 17 checks passed
@github-actions
Copy link
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants