fix(start-plugin-core): Rsbuild manifests list only a route's own chunks #8876
main fromstart-plugin-core/rsbuild-manifest-own-chunks·opened The bug#
On Rsbuild, Start's client manifest gave a route the chunks and CSS of a sibling route.
computeStaticDependencyChunks (packages/start-plugin-core/src/rsbuild/normalized-client-build.ts) counted a chunk as available to a chunk when any one of that chunk's groups (or their ancestors) had it. Take two split routes, /alpha and /beta. Both import shared.js, which has a chunk of its own, and shared.js imports widget.js, which Rspack duplicates into each route's chunk. Then the shared chunk "depends on" both alpha.js and beta.js, and each route's manifest entry pulls in the other route's chunk.
Main's manifest for that app:
"/alpha": { "css": ["/beta.css", "/alpha.css"], "preloads": ["/alpha.js", "/shared.js", "/beta.js"] }
"/beta": { "css": ["/alpha.css", "/beta.css"], "preloads": ["/beta.js", "/shared.js", "/alpha.js"] }
So /alpha's page preloads /beta.js and links /beta.css, ahead of its own stylesheet: the other route's styles apply on this page, and an extra chunk is downloaded.
The fix (from #8817)#
A chunk counts as available only when every group of the shared chunk (or one of that group's ancestors) has it. A module duplicated into each route's chunk is satisfied in each group by that group's own copy, so neither route's chunk is a dependency of the shared chunk. With the fix:
"/alpha": { "css": ["/alpha.css"], "preloads": ["/alpha.js", "/shared.js"] }
"/beta": { "css": ["/beta.css"], "preloads": ["/beta.js", "/shared.js"] }
This is #8817's hunk, unchanged: after this PR, the file is identical to #8817's. #8817 and #8780 also address this bug.
Test#
tests/rsbuild/normalized-client-build.test.ts: "does not import a sibling route chunk through a module duplicated into each route". It builds the app above with Rspack and checks the manifest entries of both routes. It fails on main (shared.js imports ['alpha.js', 'beta.js']; /alpha's CSS is ['/beta.css', '/alpha.css']) and passes with the fix.
This is #8817's own test, copied verbatim into main's existing file at the same place. It runs on main's fixture helpers, so it stays the single long-term home: when #8817 merges main, the two copies merge into one.
Validation#
pnpm format.@tanstack/start-plugin-core:test:unit(876 passed, 1 expected fail),test:integration,test:types,test:eslint,test:build.- React Start Rsbuild e2e:
basic(rsbuild-ssr,-ssr--iife,-spa,-spa--dev,-prerender,-preview),css-modules,css-inline(rsbuild-ssr,--transform-assets),deferred-hydration,rsbuild. All pass. - Bundle size:
react-start.rsbuild.minimal,minimal-iifeandfullare byte-identical to main, hashes included (gzip 102763 / 103184 / 106020). These apps have no module shared between two routes in a chunk of its own, so their manifests don't change.
Merging with #8817#
I merged this branch into main, then merged #8817's head (eb1a7841bb) on top. There are no new conflicts: the same 26 files conflict as for main + #8817 alone. normalized-client-build.ts and its test merge to exactly #8817's content, and the test appears only once.
Afterwards, #8817 drops:
- the bullet in
.changeset/start-compiler-yuku.md: "the client manifest lists only the chunks a route loads (#8780)"; - the description line "manifests list only a route's own chunks".
🤖 Generated with Claude Code
Summary by CodeRabbit#
- Bug Fixes
- Route client manifests now list only each route’s own CSS and chunks, rather than including assets from sibling routes that share a dependency.
- Shared chunks remain available to routes that need them, reducing unnecessary stylesheet and chunk preloads.
- 1
View your CI Pipeline Execution ↗ for commit 6df3b5d04e60804efb937967916b351b4842349b
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 16m 29s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 19s View ↗
☁️ Nx Cloud last updated this comment at
2026-11-04 20:12:45UTCNo actionable comments were generated in the recent review.
Walkthrough
-
The Rsbuild static dependency calculation now intersects chunks available through each relevant chunk group and its ancestors. A regression test checks that routes sharing a chunk retain their own stylesheet and preload entries.
Changes: Rsbuild route client manifest
Layer / File(s) Summary Chunk availability and route manifest regression
packages/start-plugin-core/src/rsbuild/normalized-client-build.ts,packages/start-plugin-core/tests/rsbuild/normalized-client-build.test.ts,.changeset/rsbuild-manifest-own-chunks.mdThe calculation now intersects available chunks across relevant groups and ancestors. The regression test checks route-specific stylesheets and preloads when two routes share a chunk. The changeset describes the manifest behavior. Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- TanStack/router#8810: The issue describes sibling routes receiving each other’s CSS and preload entries when they share a chunk. The PR changes the Rsbuild chunk-availability calculation for this behavior.
Possibly related PRs
- TanStack/router#8780: This PR addresses the same Rsbuild route-manifest behavior by changing
computeStaticDependencyChunks.
Suggested labels:
package: start-plugin-coreSuggested reviewers:
ladybluenotes
Merge Risk:
Low · up to6df3b-
An asymmetric chunk split can leave a route’s stylesheet and preload out of its manifest. The impact on client loading remains unverified.
Pre-merge checks:
5-
Check name Status Explanation Title check The title clearly and concisely identifies the main change: Rsbuild manifests now list only a route's own chunks. Description check The description is detailed and relevant. It explains the bug, fix, regression test, validation results, release context, and AI authorship. It does not reproduce the template's explicit checklist or … Docstring Coverage Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Description check
-
Explanation
The description is detailed and relevant. It explains the bug, fix, regression test, validation results, release context, and AI authorship. It does not reproduce the template's explicit checklist or release-impact headings, but the required information is mostly present.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: TanStack/router
- Branch: start-plugin-core/rsbuild-manifest-own-chunks
- File: .coderabbit.yaml
- Commit: 6df3b5d
- Layers: Repository YAML
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3e23f76a-21b0-4ac3-8337-c6471caffb37
Commits-
Reviewing files that changed from the base of the PR and between c5320d7ca23eca82d720ac5629d2bad5cf7d9b02 and 6df3b5d04e60804efb937967916b351b4842349b.
Files selected for processing: 3-
.changeset/rsbuild-manifest-own-chunks.mdpackages/start-plugin-core/src/rsbuild/normalized-client-build.tspackages/start-plugin-core/tests/rsbuild/normalized-client-build.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
-
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-plugin-core
Bundle Size Benchmarks#
This pull request does not affect bundle size in any measured scenario.
More templates
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-router-react-example-basic-authjs
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-rsbuild
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-example-next-migration
- tanstack-start-example-rscs
- tanstack-start-streaming-data-from-server-functions
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
- tanstack-router-vue-example-basic-jsx
- tanstack-router-vue-example-basic-file-based-jsx
- tanstack-router-vue-example-basic-file-based-sfc
- tanstack-router-solid-example-authenticated-routes
- tanstack-router-solid-example-authenticated-routes-firebase
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-default-search-params
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-basic-virtual-file-based
- tanstack-router-solid-example-basic-virtual-inside-file-based
- tanstack-router-solid-example-deferred-data
- tanstack-router-solid-i18n-paraglide
- tanstack-router-solid-example-kitchen-sink
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-kitchen-sink-solid-query
- tanstack-router-solid-example-kitchen-sink-solid-query-file-based
- tanstack-router-solid-example-large-file-based
- tanstack-router-solid-example-location-masking
- tanstack-router-solid-example-navigation-blocking
- tanstack-router-solid-example-quickstart
- tanstack-router-solid-example-quickstart-esbuild-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-router-solid-example-quickstart-rspack-file-based
- tanstack-router-solid-example-quickstart-webpack-file-based
- @tanstack/router-solid-mono-simple
- router-solid-mono-simple-lazy
- router-solid-monorepo-solid-query
- tanstack-router-solid-example-scroll-restoration
- tanstack-solid-router-search-validator-adapters
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-auth
- tanstack-solid-start-example-basic-authjs
- tanstack-solid-start-example-basic-cloudflare
- tanstack-solid-start-example-basic-netlify
- tanstack-solid-start-example-basic-nitro
- tanstack-start-example-basic-solid-query
- tanstack-solid-start-example-basic-static
- tanstack-solid-start-bun-hosting
- tanstack-solid-start-example-convex-better-auth
- tanstack-solid-start-example-counter
- tanstack-solid-start-i18n-paraglide
- tanstack-solid-start-example-large
- tanstack-solid-start-streaming-data-from-server-functions
- tanstack-solid-start-example-supabase-basic
- tanstack-solid-start-tailwind-v4
- tanstack-router-solid-example-view-transitions
- tanstack-router-solid-example-with-framer-motion
- tanstack-router-solid-example-with-trpc
@tanstack/arktype-adapter
npm i https://pkg.pr.new/@tanstack/arktype-adapter@8876@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8876@tanstack/eslint-plugin-start
npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8876@tanstack/history
npm i https://pkg.pr.new/@tanstack/history@8876@tanstack/react-router
npm i https://pkg.pr.new/@tanstack/react-router@8876@tanstack/react-router-devtools
npm i https://pkg.pr.new/@tanstack/react-router-devtools@8876@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8876@tanstack/react-start
npm i https://pkg.pr.new/@tanstack/react-start@8876@tanstack/react-start-client
npm i https://pkg.pr.new/@tanstack/react-start-client@8876@tanstack/react-start-rsc
npm i https://pkg.pr.new/@tanstack/react-start-rsc@8876@tanstack/react-start-server
npm i https://pkg.pr.new/@tanstack/react-start-server@8876@tanstack/router-cli
npm i https://pkg.pr.new/@tanstack/router-cli@8876@tanstack/router-core
npm i https://pkg.pr.new/@tanstack/router-core@8876@tanstack/router-devtools
npm i https://pkg.pr.new/@tanstack/router-devtools@8876@tanstack/router-devtools-core
npm i https://pkg.pr.new/@tanstack/router-devtools-core@8876@tanstack/router-generator
npm i https://pkg.pr.new/@tanstack/router-generator@8876@tanstack/router-plugin
npm i https://pkg.pr.new/@tanstack/router-plugin@8876@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8876@tanstack/router-utils
npm i https://pkg.pr.new/@tanstack/router-utils@8876@tanstack/router-vite-plugin
npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8876@tanstack/solid-router
npm i https://pkg.pr.new/@tanstack/solid-router@8876@tanstack/solid-router-devtools
npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8876@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8876@tanstack/solid-start
npm i https://pkg.pr.new/@tanstack/solid-start@8876@tanstack/solid-start-client
npm i https://pkg.pr.new/@tanstack/solid-start-client@8876@tanstack/solid-start-server
npm i https://pkg.pr.new/@tanstack/solid-start-server@8876@tanstack/start-client-core
npm i https://pkg.pr.new/@tanstack/start-client-core@8876@tanstack/start-fn-stubs
npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8876@tanstack/start-plugin-core
npm i https://pkg.pr.new/@tanstack/start-plugin-core@8876@tanstack/start-server-core
npm i https://pkg.pr.new/@tanstack/start-server-core@8876@tanstack/start-static-server-functions
npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8876@tanstack/start-storage-context
npm i https://pkg.pr.new/@tanstack/start-storage-context@8876@tanstack/valibot-adapter
npm i https://pkg.pr.new/@tanstack/valibot-adapter@8876@tanstack/virtual-file-routes
npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8876@tanstack/vue-router
npm i https://pkg.pr.new/@tanstack/vue-router@8876@tanstack/vue-router-devtools
npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8876@tanstack/vue-router-ssr-query
npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8876@tanstack/vue-start
npm i https://pkg.pr.new/@tanstack/vue-start@8876@tanstack/vue-start-client
npm i https://pkg.pr.new/@tanstack/vue-start-client@8876@tanstack/vue-start-server
npm i https://pkg.pr.new/@tanstack/vue-start-server@8876@tanstack/zod-adapter
npm i https://pkg.pr.new/@tanstack/zod-adapter@8876commit:
6df3b5d🚀 Changeset Version Preview#
9 package(s) bumped directly, 2 bumped as dependents.
🟨 Minor bumps#
Package Version Reason @tanstack/router-cli1.167.46 → 1.168.0 Changeset @tanstack/router-generator1.167.46 → 1.168.0 Changeset @tanstack/router-plugin1.168.48 → 1.169.0 Changeset @tanstack/router-utils1.162.4 → 1.163.0 Changeset 🟩 Patch bumps#
Package Version Reason @tanstack/react-start1.169.4 → 1.169.5 Changeset @tanstack/react-start-client1.168.44 → 1.168.45 Changeset @tanstack/solid-start1.169.4 → 1.169.5 Changeset @tanstack/start-plugin-core1.171.55 → 1.171.56 Changeset @tanstack/vue-start1.169.4 → 1.169.5 Changeset @tanstack/react-start-rsc0.1.65 → 0.1.66 Dependent @tanstack/router-vite-plugin1.167.48 → 1.167.49 Dependent Merging this PR will degrade performance by 4.9%#
2 warnings
:warning: 58 benchmarks are dominated by system calls
System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.
:warning: 2 benchmarks with a significant change ran on different hardware
Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.
❌ 2regressed benchmarks✅ 192untouched benchmarks⏩ 3skipped benchmarks1Warning
Please fix the performance issues or acknowledge them on CodSpeed.
Performance Changes#
Mode Benchmark BASEHEADEfficiency ❌ Memory mem client unique-location-churn (vue)80.2 KB 84.6 KB -5.21% ❌ Memory mem server error-paths redirect (solid)10.7 KB 11.2 KB -4.59% Tip
Investigate this regression by commenting
@codspeedbot fix this regressionon this PR, or directly use the CodSpeed MCP with your agent.
Comparingstart-plugin-core/rsbuild-manifest-own-chunks(6df3b5d) withmain(c5320d7)Footnotes#
-
3 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. ↩
-
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 6df3b5d04e60804efb937967916b351b4842349b
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR