Skip to content

fix(angular-rspack): stats serialization and configuration#34155

Merged
Coly010 merged 2 commits intonrwl:masterfrom
faileon:fix/ng-rspack-stats-json-bottleneck
Jan 21, 2026
Merged

fix(angular-rspack): stats serialization and configuration#34155
Coly010 merged 2 commits intonrwl:masterfrom
faileon:fix/ng-rspack-stats-json-bottleneck

Conversation

@faileon
Copy link
Contributor

@faileon faileon commented Jan 20, 2026

Current Behavior

  1. Performance bottleneck: statsValue.toJson() is called with no options, causing full serialization of all stats data on every build. This is expensive and unnecessary when only budget checking is needed.
  2. Redundant work: Budget checking code runs even when no budgets are configured or when targeting server platform.
  3. User stats config ignored: Custom stats configuration provided via rspackConfigOverrides is not respected by the stats logger.
  4. Double serialization: rspackStatsLogger calls stats.toJson() without passing the stats options, ignoring user preferences.

Expected Behavior

  1. Only serialize what's needed for budget checking (assets and chunks), significantly reducing overhead.
  2. Early exit when budgets are not configured or on server platform, skipping expensive toJson() entirely.
  3. User's stats configuration is merged with defaults and respected throughout the build output.
  4. rspackStatsLogger uses the provided statOptions when serializing stats.

Related Issue(s)

Fixes #34145

@faileon faileon requested a review from a team as a code owner January 20, 2026 11:16
@faileon faileon requested a review from jaysoo January 20, 2026 11:16
@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 b5026f4

@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 4:45pm

Request Review

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Jan 20, 2026

View your CI Pipeline Execution ↗ for commit b5026f4

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

☁️ Nx Cloud last updated this comment at 2026-01-20 17:22:09 UTC

@Coly010
Copy link
Contributor

Coly010 commented Jan 20, 2026

Hey @faileon The merge of one of the other PRs has led to a conflict here :)

@faileon
Copy link
Contributor Author

faileon commented Jan 20, 2026

Hey @faileon The merge of one of the other PRs has led to a conflict here :)

I have resolved the merge conflicts and pushed an update to my forked repo.

@Coly010 Coly010 merged commit 5f51a4b into nrwl:master Jan 21, 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 27, 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.

angular-rspack Performance Issue: stats.toJson() causes ~5s delay on every incremental rebuild

2 participants