feat(start): support rsbuild iife client output #7477
main fromrefs/pull/7477/head·merged by schiller-manuel(GitHub profile, opens in a new tab) also fix serverfns with rsbuild cache
Summary by CodeRabbit#
New Features
- Rsbuild client output: supports module and IIFE formats; SSR emits matching preload/link/script markers and manifest scriptFormat entries.
Bug Fixes
- Server-function metadata preserved and replayed across warm restarts to prevent lost registrations.
- Dev-style marker handling refined for more reliable SSR/CSR behavior.
Behavior Changes
- Start manifests now expose separate css, scripts, and preloads (not generic assets); cross-origin config uses per-kind
script/stylesheet. - Early Hints and preload semantics follow the selected client output (module vs IIFE).
- Start manifests now expose separate css, scripts, and preloads (not generic assets); cross-origin config uses per-kind
Documentation
- Clarified asset cross-origin, transformAssets kinds, and preload/early-hint guidance.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsdocumentation
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: react-router
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-core
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: solid-router
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-plugin-core
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-server-core
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-storage-context
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: vue-router
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: react-start-rsc
View your CI Pipeline Execution ↗ for commit 20dde7f3d0c7b06e365f17e5c58099ab7348ee41
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 11m 16s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 2m 10s View ↗
☁️ Nx Cloud last updated this comment at
2026-05-24 00:01:14UTC🚀 Changeset Version Preview#
9 package(s) bumped directly, 14 bumped as dependents.
🟩 Patch bumps#
Package Version Reason @tanstack/react-router1.170.7 → 1.170.8 Changeset @tanstack/react-start1.168.10 → 1.168.11 Changeset @tanstack/router-core1.171.5 → 1.171.6 Changeset @tanstack/solid-router1.170.7 → 1.170.8 Changeset @tanstack/solid-start1.168.10 → 1.168.11 Changeset @tanstack/start-plugin-core1.171.3 → 1.171.4 Changeset @tanstack/start-server-core1.169.2 → 1.169.3 Changeset @tanstack/vue-router1.170.7 → 1.170.8 Changeset @tanstack/vue-start1.168.10 → 1.168.11 Changeset @tanstack/react-start-client1.168.2 → 1.168.3 Dependent @tanstack/react-start-rsc0.1.10 → 0.1.11 Dependent @tanstack/react-start-server1.167.7 → 1.167.8 Dependent @tanstack/router-cli1.167.9 → 1.167.10 Dependent @tanstack/router-generator1.167.9 → 1.167.10 Dependent @tanstack/router-plugin1.168.10 → 1.168.11 Dependent @tanstack/router-vite-plugin1.167.10 → 1.167.11 Dependent @tanstack/solid-start-client1.168.2 → 1.168.3 Dependent @tanstack/solid-start-server1.167.7 → 1.167.8 Dependent @tanstack/start-client-core1.170.2 → 1.170.3 Dependent @tanstack/start-static-server-functions1.167.7 → 1.167.8 Dependent @tanstack/start-storage-context1.167.7 → 1.167.8 Dependent @tanstack/vue-start-client1.167.7 → 1.167.8 Dependent @tanstack/vue-start-server1.167.7 → 1.167.8 Dependent Bundle Size Benchmarks#
- Commit:
c82084c5d500 - Measured at:
2026-05-23T23:49:17.335Z - Baseline source:
history:b47b338d15de - Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend react-router.minimal87.29 KiB 0 B (0.00%) 87.16 KiB 274.02 KiB 75.93 KiB █████▁▁▁▁▁▁ react-router.full90.73 KiB -91 B (-0.10%) 90.60 KiB 285.39 KiB 78.83 KiB ▇▇▇▇█▆▆▆▆▆▆▁ solid-router.minimal35.53 KiB 0 B (0.00%) 35.41 KiB 106.33 KiB 31.95 KiB ▅████▁▁▁▁▁▁ solid-router.full40.24 KiB -40 B (-0.10%) 40.11 KiB 120.53 KiB 36.21 KiB ▆▆▆▆▇▇▇▇▇██▁ vue-router.minimal53.33 KiB 0 B (0.00%) 53.20 KiB 151.46 KiB 47.88 KiB ▇▇▇▇▁▅▅▅▅██ vue-router.full58.79 KiB +347 B (+0.58%) 58.66 KiB 168.64 KiB 52.70 KiB ▁▁▁▁▁▁▁▁▁▁▁█ react-start.minimal101.92 KiB -106 B (-0.10%) 101.79 KiB 322.34 KiB 88.14 KiB ▇▇▇▇▇██████▁ react-start.deferred-hydration102.96 KiB -118 B (-0.11%) 102.08 KiB 323.99 KiB 89.13 KiB ██████████▁ react-start.full105.31 KiB -116 B (-0.11%) 105.18 KiB 332.66 KiB 91.00 KiB █████▆▆▆▆▇▇▁ react-start.rsbuild.minimal99.61 KiB -32 B (-0.03%) 99.43 KiB 316.79 KiB 85.75 KiB ████▆██████▁ react-start.rsbuild.full102.88 KiB -55 B (-0.05%) 102.71 KiB 327.18 KiB 88.51 KiB ████▇▇▇▇▇██▁ solid-start.minimal49.63 KiB -45 B (-0.09%) 49.50 KiB 152.40 KiB 43.84 KiB ▅████▆▆▆▆▆▆▁ solid-start.deferred-hydration53.70 KiB -41 B (-0.07%) 50.36 KiB 160.94 KiB 47.81 KiB ████▄▄▄▄▄▄▁ solid-start.full55.42 KiB -41 B (-0.07%) 55.29 KiB 169.34 KiB 48.74 KiB ▄███▇▇▇▇▇▇▇▁ Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.
- Commit:
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-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-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@7477@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7477@tanstack/eslint-plugin-start
npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7477@tanstack/history
npm i https://pkg.pr.new/@tanstack/history@7477@tanstack/nitro-v2-vite-plugin
npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7477@tanstack/react-router
npm i https://pkg.pr.new/@tanstack/react-router@7477@tanstack/react-router-devtools
npm i https://pkg.pr.new/@tanstack/react-router-devtools@7477@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7477@tanstack/react-start
npm i https://pkg.pr.new/@tanstack/react-start@7477@tanstack/react-start-client
npm i https://pkg.pr.new/@tanstack/react-start-client@7477@tanstack/react-start-rsc
npm i https://pkg.pr.new/@tanstack/react-start-rsc@7477@tanstack/react-start-server
npm i https://pkg.pr.new/@tanstack/react-start-server@7477@tanstack/router-cli
npm i https://pkg.pr.new/@tanstack/router-cli@7477@tanstack/router-core
npm i https://pkg.pr.new/@tanstack/router-core@7477@tanstack/router-devtools
npm i https://pkg.pr.new/@tanstack/router-devtools@7477@tanstack/router-devtools-core
npm i https://pkg.pr.new/@tanstack/router-devtools-core@7477@tanstack/router-generator
npm i https://pkg.pr.new/@tanstack/router-generator@7477@tanstack/router-plugin
npm i https://pkg.pr.new/@tanstack/router-plugin@7477@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7477@tanstack/router-utils
npm i https://pkg.pr.new/@tanstack/router-utils@7477@tanstack/router-vite-plugin
npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7477@tanstack/solid-router
npm i https://pkg.pr.new/@tanstack/solid-router@7477@tanstack/solid-router-devtools
npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7477@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7477@tanstack/solid-start
npm i https://pkg.pr.new/@tanstack/solid-start@7477@tanstack/solid-start-client
npm i https://pkg.pr.new/@tanstack/solid-start-client@7477@tanstack/solid-start-server
npm i https://pkg.pr.new/@tanstack/solid-start-server@7477@tanstack/start-client-core
npm i https://pkg.pr.new/@tanstack/start-client-core@7477@tanstack/start-fn-stubs
npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7477@tanstack/start-plugin-core
npm i https://pkg.pr.new/@tanstack/start-plugin-core@7477@tanstack/start-server-core
npm i https://pkg.pr.new/@tanstack/start-server-core@7477@tanstack/start-static-server-functions
npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7477@tanstack/start-storage-context
npm i https://pkg.pr.new/@tanstack/start-storage-context@7477@tanstack/valibot-adapter
npm i https://pkg.pr.new/@tanstack/valibot-adapter@7477@tanstack/virtual-file-routes
npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7477@tanstack/vue-router
npm i https://pkg.pr.new/@tanstack/vue-router@7477@tanstack/vue-router-devtools
npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7477@tanstack/vue-router-ssr-query
npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7477@tanstack/vue-start
npm i https://pkg.pr.new/@tanstack/vue-start@7477@tanstack/vue-start-client
npm i https://pkg.pr.new/@tanstack/vue-start-client@7477@tanstack/vue-start-server
npm i https://pkg.pr.new/@tanstack/vue-start-server@7477@tanstack/zod-adapter
npm i https://pkg.pr.new/@tanstack/zod-adapter@7477commit:
53498e8Actionable comments posted: 5
🧹 Nitpick comments (3)
packages/solid-router/src/Scripts.tsx (1)
11-11: ⚡ Quick winReplace
Array<any>with typed match inputs.Using
anyhere weakens safety exactly where manifest route/script fields are accessed.As per coding guidelines, "
**/*.{ts,tsx}: Use TypeScript strict mode with extensive type safety".Also applies to: 38-38
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/solid-router/src/Scripts.tsx` at line 11, Replace the loose Array<any> on the getAssetScripts parameter with a proper typed Match[] (or the exact route match interface used across the router) so callers and property accesses (e.g., manifest route/script fields) get compile-time safety; update the function signature getAssetScripts(matches: Match[]) and any other similar signatures in this file to use the shared Match/RouteManifest type instead of any, and adjust imports/types where needed to reference the correct match/interface.packages/vue-router/src/HeadContent.tsx (1)
12-38: ⚡ Quick winTighten the attribute matcher type.
Record<string, any>opts this hydration-matching path out of strict checking. UsingRouterManagedTag['attrs']or a narrow attribute-value union here will keep bad attr shapes from silently flowing into reconciliation. As per coding guidelines**/*.{ts,tsx}: Use TypeScript strict mode with extensive type safety.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/vue-router/src/HeadContent.tsx` around lines 12 - 38, The attrsMatch function currently accepts a permissive Record<string, any> which bypasses TS strict checks; change its parameter type to the specific RouterManagedTag['attrs'] (or a narrow union of allowed attribute value types) so invalid attr shapes are caught at compile time, update any callers that pass loose objects to satisfy the new type, and ensure the logic within attrsMatch still handles undefined/false/null/true and string conversions as before.packages/vue-router/src/Scripts.tsx (1)
22-67: ⚡ Quick winStop threading
anythrough script collection.These helpers sit on the manifest-to-DOM boundary, so
Array<any>drops exactly the type information strict mode should preserve. Reusing the match type fromrouter.stores.matcheshere would keep route access and script normalization checked end-to-end. As per coding guidelines**/*.{ts,tsx}: Use TypeScript strict mode with extensive type safety.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/vue-router/src/Scripts.tsx` around lines 22 - 67, The helpers getAssetScripts and getScripts currently use Array<any> for matches; change their signatures and callers to use the concrete match type from router.stores.matches (e.g. the array item type: typeof router.stores.matches[number] or a named Match type exported from the store) so script access is statically checked; update both getAssetScripts(matches: ...) and getScripts(matches: ...) and the computed calls that pass matches.value to accept that match type, and ensure any internal usages (routeId, scripts, etc.) conform to the actual match shape so TypeScript strict mode verifies manifest-to-DOM boundaries.🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@packages/react-router/src/headContentUtils.tsx`: - Around line 105-153: The manifest-derived tag arrays manifestCssTags and preloadLinks can contain duplicates when multiple matches reference the same chunk; dedupe before appending to the final head list by keying on a stable identifier (e.g. attrs.href for link tags or a stringified attrs object for preload/link entries). Update the logic that builds manifestCssTags (using resolveManifestCssLink) and preloadLinks (using getScriptPreloadAttrs) to record seen keys in a Set and only push a RouterManagedTag when its key is not already present; apply the same dedup approach to the other mentioned blocks (around the other ranges that push manifest-derived tags) so SSR and client head lists never emit duplicate stylesheet/preload tags. In `@packages/router-core/src/ssr/ssr-server.ts`: - Around line 462-478: The code calls stripInlinedStylesheetAssets(manifest, nextFilteredRoutes) after populating nextFilteredRoutes with unmatched routes when includeUnmatchedRouteAssets is true, which causes inlinable CSS for unmatched routes to be stripped; fix by ensuring stripInlinedStylesheetAssets is only applied to the subset of routes that are current matches (or otherwise known to be inlined) — e.g., compute a routesToStrip object from nextFilteredRoutes that contains only matched route IDs (using the current match list/variable used elsewhere in this flow) and pass routesToStrip to stripInlinedStylesheetAssets(manifest, routesToStrip), leaving unmatched route entries in nextFilteredRoutes untouched before assignment to filteredRoutes. In `@packages/solid-router/src/headContentUtils.tsx`: - Around line 213-216: The code currently pushes preloadLinks() and manifestCssTags() directly into next, which bypasses deduplication; replace those direct pushes with calls to appendUniqueUserTags to dedupe against existing tags (i.e., use appendUniqueUserTags(next, preloadLinks()) instead of next.push(...preloadLinks()) and appendUniqueUserTags(next, manifestCssTags()) instead of next.push(...manifestCssTags())), keeping the existing calls that already dedupe links() and styles(). In `@packages/solid-router/src/Scripts.tsx`: - Line 70: Keep the nullish coalescing in the server check (do not change isServer ?? router.isServer) and replace the overly broad Array<any> in the getAssetScripts and getScripts signatures with the concrete match type used by the router stores (a type/interface that includes at least routeId and scripts); update the function params for getAssetScripts(matches: /* router match type */) and getScripts(matches: /* router match type */) and adjust any internal property accesses to use that typed shape so the TypeScript strict checks pass while preserving the isServer ?? router.isServer server gate. In `@packages/vue-router/src/Scripts.tsx`: - Line 91: The checks using the nullish coalescing (isServer ?? router.isServer) short-circuit when imported isServer is false and thus ignore router.isServer; update both occurrences in Scripts.tsx to use a boolean OR so router.isServer is honored when isServer is false (replace (isServer ?? router.isServer) with (isServer || router.isServer) in the if conditions that reference isServer, including the one combined with mounted). --- Nitpick comments: In `@packages/solid-router/src/Scripts.tsx`: - Line 11: Replace the loose Array<any> on the getAssetScripts parameter with a proper typed Match[] (or the exact route match interface used across the router) so callers and property accesses (e.g., manifest route/script fields) get compile-time safety; update the function signature getAssetScripts(matches: Match[]) and any other similar signatures in this file to use the shared Match/RouteManifest type instead of any, and adjust imports/types where needed to reference the correct match/interface. In `@packages/vue-router/src/HeadContent.tsx`: - Around line 12-38: The attrsMatch function currently accepts a permissive Record<string, any> which bypasses TS strict checks; change its parameter type to the specific RouterManagedTag['attrs'] (or a narrow union of allowed attribute value types) so invalid attr shapes are caught at compile time, update any callers that pass loose objects to satisfy the new type, and ensure the logic within attrsMatch still handles undefined/false/null/true and string conversions as before. In `@packages/vue-router/src/Scripts.tsx`: - Around line 22-67: The helpers getAssetScripts and getScripts currently use Array<any> for matches; change their signatures and callers to use the concrete match type from router.stores.matches (e.g. the array item type: typeof router.stores.matches[number] or a named Match type exported from the store) so script access is statically checked; update both getAssetScripts(matches: ...) and getScripts(matches: ...) and the computed calls that pass matches.value to accept that match type, and ensure any internal usages (routeId, scripts, etc.) conform to the actual match shape so TypeScript strict mode verifies manifest-to-DOM boundaries.🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
e1c7592f-439e-44d6-82b6-0d4c5714d33d📥 Commits
Reviewing files that changed from the base of the PR and between 31f5684aa27fdbffc918115f2eed8c7219605413 and 23e4e61172a26e03e7e6cacff860209fd4b4ee24.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (68)
.changeset/gentle-pandas-clap.md.changeset/slow-badgers-remember.mddocs/router/guide/document-head-management.mddocs/start/framework/react/guide/cdn-asset-urls.mddocs/start/framework/react/guide/early-hints.mde2e/react-router/basic-file-based/src/routeTree.gen.tse2e/react-start/basic/package.jsone2e/react-start/basic/playwright.config.tse2e/react-start/basic/start-mode-config.tse2e/react-start/basic/tests/client-output.spec.tse2e/react-start/dev-ssr-styles/package.jsone2e/react-start/dev-ssr-styles/tests/app.spec.tse2e/react-start/server-functions/package.jsone2e/react-start/server-functions/playwright.rsbuild-cache.config.tse2e/react-start/server-functions/rsbuild.config.tse2e/react-start/server-functions/tests/rsbuild-cache.spec.tse2e/react-start/start-manifest/tests/start-manifest.spec.tse2e/react-start/transform-asset-urls/src/routes/__root.tsxe2e/react-start/transform-asset-urls/src/server.tse2e/react-start/transform-asset-urls/tests/transform-asset-urls.spec.tse2e/solid-start/start-manifest/tests/start-manifest.spec.tse2e/vue-start/start-manifest/tests/start-manifest.spec.tspackages/react-router/src/Asset.tsxpackages/react-router/src/HeadContent.dev.tsxpackages/react-router/src/Scripts.tsxpackages/react-router/src/headContentUtils.tsxpackages/react-router/tests/Scripts.test.tsxpackages/react-start-rsc/src/serialization.server.tspackages/router-core/src/index.tspackages/router-core/src/manifest.tspackages/router-core/src/router.tspackages/router-core/src/ssr/createRequestHandler.tspackages/router-core/src/ssr/ssr-server.tspackages/router-core/tests/hydrate.test.tspackages/router-core/tests/manifest.test.tspackages/router-core/tests/ssr-server-manifest.test.tspackages/solid-router/src/HeadContent.dev.tsxpackages/solid-router/src/Scripts.tsxpackages/solid-router/src/headContentUtils.tsxpackages/solid-router/tests/Scripts.test.tsxpackages/start-plugin-core/src/rsbuild/COMPILER_ARCHITECTURE.mdpackages/start-plugin-core/src/rsbuild/planning.tspackages/start-plugin-core/src/rsbuild/plugin.tspackages/start-plugin-core/src/rsbuild/schema.tspackages/start-plugin-core/src/rsbuild/start-compiler-host.tspackages/start-plugin-core/src/rsbuild/start-compiler-metadata-loader.tspackages/start-plugin-core/src/rsbuild/start-compiler-metadata.tspackages/start-plugin-core/src/rsbuild/virtual-modules.tspackages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.tspackages/start-plugin-core/src/vite/start-manifest-plugin/plugin.tspackages/start-plugin-core/tests/rsbuild-output-directory.test.tspackages/start-plugin-core/tests/start-manifest-plugin/manifestBuilder.test.tspackages/start-plugin-core/vite.config.tspackages/start-server-core/src/early-hints.tspackages/start-server-core/src/finalManifest.tspackages/start-server-core/src/request-handler.tspackages/start-server-core/src/router-manifest.tspackages/start-server-core/src/tanstack-start.d.tspackages/start-server-core/src/transformAssetUrls.tspackages/start-server-core/tests/early-hints.test.tspackages/start-server-core/tests/finalManifest.test.tspackages/start-server-core/tests/transformAssets.test.tspackages/start-storage-context/src/async-local-storage.tspackages/vue-router/src/HeadContent.dev.tsxpackages/vue-router/src/HeadContent.tsxpackages/vue-router/src/Scripts.tsxpackages/vue-router/src/headContentUtils.tsxpackages/vue-router/tests/Scripts.test.tsx
@@ -141,3 +134,20 @@134+ children: manifest.inlineStyle.children,135+ inlineCss: true,136+ })137+ }138+ }141139142- return []140+ const preloadLinks: Array<RouterManagedTag> = []141+ if (manifest) {142+ matches.forEach((match) => {143+ manifest.routes[match.routeId]?.preloads?.forEach((preload) => {144+ preloadLinks.push({145+ tag: 'link',146+ attrs: {147+ ...getScriptPreloadAttrs(manifest, preload, assetCrossOrigin),148+ nonce,149+ },150+ })151+ })143152 })153+ }⚠️ Potential issue | 🟠 Major | ⚡ Quick win
Restore deduplication for manifest-derived head tags.
The previous implementation deduped the combined head tag list, but these paths now append
preloadLinksandmanifestCssTagsdirectly. If the same chunk is referenced by multiple active matches, we'll emit duplicate preload/stylesheet tags on both SSR and the client.Suggested direction
+function appendUniqueTags( + target: Array<RouterManagedTag>, + tags: Array<RouterManagedTag>, +) { + const seen = new Set(target.map((tag) => JSON.stringify(tag))) + for (const tag of tags) { + const key = JSON.stringify(tag) + if (seen.has(key)) continue + seen.add(key) + target.push(tag) + } +} + const tags: Array<RouterManagedTag> = [] appendUniqueUserTags(tags, resultMeta) - tags.push(...preloadLinks) + appendUniqueTags(tags, preloadLinks) appendUniqueUserTags(tags, constructedLinks) - tags.push(...manifestCssTags) + appendUniqueTags(tags, manifestCssTags) appendUniqueUserTags(tags, styles) appendUniqueUserTags(tags, headScripts) return tagsAlso applies to: 179-186, 310-378, 421-428
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/react-router/src/headContentUtils.tsx` around lines 105 - 153, The manifest-derived tag arrays manifestCssTags and preloadLinks can contain duplicates when multiple matches reference the same chunk; dedupe before appending to the final head list by keying on a stable identifier (e.g. attrs.href for link tags or a stringified attrs object for preload/link entries). Update the logic that builds manifestCssTags (using resolveManifestCssLink) and preloadLinks (using getScriptPreloadAttrs) to record seen keys in a Set and only push a RouterManagedTag when its key is not already present; apply the same dedup approach to the other mentioned blocks (around the other ranges that push manifest-derived tags) so SSR and client head lists never emit duplicate stylesheet/preload tags.this deduplication is supposed to happen at build time already. check this!
🧩 Analysis chain
Good question — let me check whether the manifest builder already deduplicates cross-route entries at build time before concluding.
🏁 Script executed:
#!/bin/bash # Look at the deduplication logic in manifestBuilder.ts rg -n "dedupe\|dedup\|unique\|preloads\|css" packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts | head -80 echo "---" # Check the nested/ancestor dedup logic ast-grep --pattern 'route.preloads' packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts echo "---" # Look for where preloads and css are deduplicated in build routes rg -n "preloads\|\.css" packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts | head -60Length of output: 380
🏁 Script executed:
#!/bin/bash # Get full context around the dedup logic for preloads and css in manifestBuilder.ts sed -n '620,720p' packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts echo "=== CSS dedup ===" rg -n "css\|dedupe\|dedup" packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts | head -60Length of output: 2641
🏁 Script executed:
#!/bin/bash # See more of dedupeNestedRouteManifestEntries - the recursive part and how it's called sed -n '720,800p' packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts echo "=== How dedupeNestedRouteManifestEntries is called ===" rg -n "dedupeNestedRouteManifestEntries" packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.tsLength of output: 1742
@schiller-manuel, you're right — the build-time deduplication fully covers this.dedupeNestedRouteManifestEntries(called fromrootRouteIdat line 237 ofmanifestBuilder.ts) does a parent-first recursive traversal of the route tree with sharedseenPreloads,seenScripts, andseenStylesheetssets. Any entry already present in an ancestor route is stripped from child routes before the manifest is written. So at runtime, iterating over all active matches (root → layout → leaf) will never yield the same preload or CSS entry twice.My concern was unfounded — no runtime deduplication guard is needed here. Apologies for the noise!
🐇 (`゚▽゚)
✏️ Learnings added
Learnt from: schiller-manuel Repo: TanStack/router PR: 7477 File: packages/react-router/src/headContentUtils.tsx:105-153 Timestamp: 2026-05-23T22:09:30.386Z Learning: In TanStack Router's `packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts`, `dedupeNestedRouteManifestEntries` performs a parent-first recursive traversal of the route tree at build time using shared `seenPreloads`, `seenScripts`, and `seenStylesheets` Sets. It strips any preload/CSS/script entry from a child route that is already present in an ancestor route. This means that at runtime, iterating `manifest.routes[match.routeId]?.preloads` / `.css` / `.scripts` over all active matches will never produce cross-match duplicates — no additional runtime deduplication is needed for these manifest-derived head tags.Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
packages/router-core/src/ssr/ssr-server.ts lines 462 to 478OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -383,16 +462,17 @@383462 } else if (384463 includeUnmatchedRouteAssets &&385- routeManifest.assets &&386- routeManifest.assets.length > 0464+ hasRouteAssets(routeManifest)387465 ) {388466 nextFilteredRoutes[routeId] = {389- assets: routeManifest.assets,467+ ...(routeManifest.scripts468+ ? { scripts: routeManifest.scripts }469+ : {}),470+ ...(routeManifest.css ? { css: routeManifest.css } : {}),390471 }391472 }392473 }393474394475 filteredRoutes = stripInlinedStylesheetAssets(395476 manifest,396477 nextFilteredRoutes,397- matchesToDehydrate,398478 )⚠️ Potential issue | 🟠 Major | ⚡ Quick win
Avoid stripping inlinable CSS from unmatched routes during dehydration.
When
includeUnmatchedRouteAssetsis true,nextFilteredRoutesincludes unmatched routes, butstripInlinedStylesheetAssets(...)strips their inlinable CSS too. Inline CSS is only emitted for current matches, so later client navigation can miss styles for previously-unmatched routes.Suggested fix
- filteredRoutes = stripInlinedStylesheetAssets( - manifest, - nextFilteredRoutes, - ) + const matchedOnlyRoutes: FilteredRoutes = {} + for (const routeId of currentRouteIds) { + const route = nextFilteredRoutes[routeId] + if (route) matchedOnlyRoutes[routeId] = route + } + + const strippedMatchedRoutes = stripInlinedStylesheetAssets( + manifest, + matchedOnlyRoutes, + ) + + filteredRoutes = { + ...nextFilteredRoutes, + ...strippedMatchedRoutes, + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/router-core/src/ssr/ssr-server.ts` around lines 462 - 478, The code calls stripInlinedStylesheetAssets(manifest, nextFilteredRoutes) after populating nextFilteredRoutes with unmatched routes when includeUnmatchedRouteAssets is true, which causes inlinable CSS for unmatched routes to be stripped; fix by ensuring stripInlinedStylesheetAssets is only applied to the subset of routes that are current matches (or otherwise known to be inlined) — e.g., compute a routesToStrip object from nextFilteredRoutes that contains only matched route IDs (using the current match list/variable used elsewhere in this flow) and pass routesToStrip to stripInlinedStylesheetAssets(manifest, routesToStrip), leaving unmatched route entries in nextFilteredRoutes untouched before assignment to filteredRoutes.✅ Addressed in commits 2a67c81 to a9bf7f3
give me an example on where that would fail
@schiller-manuelHere's a concrete failure scenario:Setup:
- Routes:
/and/about /abouthasabout.css, which qualifies as inlinable (it appears inmanifest.inlineCss.styles— set at build time for small, critical stylesheets)- User first requests
/(only root is a current match)
Step-by-step through the dehydration code:
currentRouteIds = { '/' }— only root is matchednextFilteredRoutesis built:'/'→ full route entry (current match)'/about'→{ css: ['about.css'] }← included becauseincludeUnmatchedRouteAssets && hasRouteAssets
stripInlinedStylesheetAssets(manifest, nextFilteredRoutes)runs on all entries, including/about:- Checks
isInlinableStylesheet(manifest, 'about.css')→ true (it's inmanifest.inlineCss.styles) - Strips
about.cssfrom/about'scssarray
- Checks
- Dehydrated manifest sent to client:
/aboutnow has no CSS
Why this breaks:
getInlineCssAssetForMatchesonly inlines CSS for currently matched routes — it never inlines/about's CSS because/aboutisn't matched. Soabout.css:- ❌ Was NOT inlined into the HTML (unmatched route)
- ❌ Was stripped from the client manifest (marked as "inlinable")
When the user then navigates to
/abouton the client, the router checks the manifest for route assets, finds nothing for/about, and the stylesheet is never loaded — the page renders without styles.The fix is to only strip inlinable CSS from the routes that are actually matched (those whose CSS was inlined into the HTML), leaving unmatched route entries untouched.
we dont send anything about unmatched routes to the client. so this wont break IMO. but we should nevertheless reduce work for unmatched routes. give me a prompt for that
@schiller-manuelHere's a prompt for that optimization:
In
packages/router-core/src/ssr/ssr-server.ts, insideattachRouterServerSsrUtils→router.serverSsr.dehydrate, the call tostripInlinedStylesheetAssets(manifest, nextFilteredRoutes)iterates over all entries innextFilteredRoutes— including unmatched routes added whenincludeUnmatchedRouteAssetsis true. SincestripInlinedStylesheetAssetsonly needs to run for currently matched routes (only their CSS is actually inlined into the HTML), processing unmatched entries is wasted work.Refactor so that
stripInlinedStylesheetAssetsis called only on the matched-route subset ofnextFilteredRoutes, then merge the result back with the unmatched entries:- filteredRoutes = stripInlinedStylesheetAssets( - manifest, - nextFilteredRoutes, - ) + const matchedRoutes: FilteredRoutes = {} + for (const routeId of currentRouteIds) { + const route = nextFilteredRoutes[routeId] + if (route) matchedRoutes[routeId] = route + } + const strippedMatchedRoutes = stripInlinedStylesheetAssets( + manifest, + matchedRoutes, + ) + filteredRoutes = { ...nextFilteredRoutes, ...strippedMatchedRoutes }currentRouteIdsis already in scope as aSetbuilt fromcurrentRouteIdsList. The unmatched entries innextFilteredRoutesare left as-is — they are not inlined so stripping them is unnecessary. After the change, validate that existing tests inpackages/router-core/tests/ssr-server-manifest.test.tsstill pass.@@ -219,14 +208,9 @@208+ })219209220210 return Solid.createMemo((prev: Array<RouterManagedTag> | undefined) => {221- const next = uniqBy(222- [223- ...meta(),224- ...preloadLinks(),225- ...links(),226- ...styles(),227- ...headScripts(),228- ] as Array<RouterManagedTag>,229- (d) => {230- return JSON.stringify(d)231- },232- )211+ const next: Array<RouterManagedTag> = []212+ appendUniqueUserTags(next, meta())213+ next.push(...preloadLinks())214+ appendUniqueUserTags(next, links())215+ next.push(...manifestCssTags())216+ appendUniqueUserTags(next, styles())⚠️ Potential issue | 🟠 Major | ⚡ Quick win
Preload and manifest CSS tags are no longer deduped.
next.push(...preloadLinks())andnext.push(...manifestCssTags())can emit duplicates across active matches (e.g., shared root+child CSS), which regresses previous global dedupe behavior.Suggested fix
- next.push(...preloadLinks()) + appendUniqueUserTags(next, preloadLinks()) appendUniqueUserTags(next, links()) - next.push(...manifestCssTags()) + appendUniqueUserTags(next, manifestCssTags())📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change213- next.push(...preloadLinks())214- appendUniqueUserTags(next, links())215- next.push(...manifestCssTags())216- appendUniqueUserTags(next, styles())213+ appendUniqueUserTags(next, preloadLinks())214+ appendUniqueUserTags(next, links())215+ appendUniqueUserTags(next, manifestCssTags())216+ appendUniqueUserTags(next, styles())🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/solid-router/src/headContentUtils.tsx` around lines 213 - 216, The code currently pushes preloadLinks() and manifestCssTags() directly into next, which bypasses deduplication; replace those direct pushes with calls to appendUniqueUserTags to dedupe against existing tags (i.e., use appendUniqueUserTags(next, preloadLinks()) instead of next.push(...preloadLinks()) and appendUniqueUserTags(next, manifestCssTags()) instead of next.push(...manifestCssTags())), keeping the existing calls that already dedupe links() and styles().packages/solid-router/src/Scripts.tsx line 70Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -52,12 +59,12 @@525953- if (router.serverSsr) {54- serverBufferedScript = router.serverSsr.takeBufferedScripts()55- }60+ return renderScripts(router, scripts(), assetScripts())61+}566257- const allScripts = [58- ...scripts(),59- ...assetScripts(),60- ] as Array<RouterManagedTag>63+function renderScripts(64+ router: ReturnType<typeof useRouter>,65+ scripts: Array<RouterManagedTag>,66+ assetScripts: Array<RouterManagedTag>,67+) {68+ const allScripts = [...scripts, ...assetScripts] as Array<RouterManagedTag>616962- if (serverBufferedScript) {63- allScripts.unshift(serverBufferedScript)70+ if ((isServer ?? router.isServer) && router.serverSsr) {⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
Keep the
??server gate; fix the remainingArray<any>type-safety regressionisServerfrom@tanstack/router-core/isServerisboolean | undefinedin dev/test, soisServer ?? router.isServeris a correct fallback and shouldn’t be changed to||.packages/solid-router/src/Scripts.tsxusesgetAssetScripts(matches: Array<any>)andgetScripts(matches: Array<any>); replaceArray<any>with the concrete match type from the router stores (covering at leastrouteIdandscripts) to meet the strict type-safety guideline.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/solid-router/src/Scripts.tsx` at line 70, Keep the nullish coalescing in the server check (do not change isServer ?? router.isServer) and replace the overly broad Array<any> in the getAssetScripts and getScripts signatures with the concrete match type used by the router stores (a type/interface that includes at least routeId and scripts); update the function params for getAssetScripts(matches: /* router match type */) and getScripts(matches: /* router match type */) and adjust any internal property accesses to use that typed shape so the TypeScript strict checks pass while preserving the isServer ?? router.isServer server gate.✅ Addressed in commits 2a67c81 to a9bf7f3
check again, we are adding the nullish coalescing here
@schiller-manuel, you're right — I apologize for the confusion. Looking at the diff again, the old code only hadif (router.serverSsr), and this PR is adding theisServer ?? router.isServerguard. That part of my comment was incorrect.The only still-valid concern is the
Array<any>ingetAssetScriptsandgetScripts— replacing those with the concrete match type (with at leastrouteIdandscripts) would improve type safety. That said, if you'd prefer to address that separately, happy to leave it.(ᵔ◡ᵔ)🐰
give ma a prompt for the type issue
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Find what type router.stores.matches returns in solid-router rg -n "stores.*matches\|matches.*stores\|AnyRouteMatch\|RouteMatch" packages/solid-router/src --include="*.ts" --include="*.tsx" -A2 -B2 | head -80 # Find the type used for matches in the router stores ast-grep --pattern 'matches: $_' packages/solid-router/src/Length of output: 442
🏁 Script executed:
#!/bin/bash # Find what type router.stores.matches returns rg -n "AnyRouteMatch\|RouteMatch" packages/solid-router/src/ -A2 -B2 | head -80 # Find match type usage rg -n "stores\.matches" packages/solid-router/src/ -A2 -B2 | head -40 # Check router-core for AnyRouteMatch definition rg -n "AnyRouteMatch\|type RouteMatch" packages/router-core/src/ -A3 | head -60Length of output: 2190
🏁 Script executed:
#!/bin/bash # Confirm AnyRouteMatch is exported from router-core and check its shape rg -n "export.*AnyRouteMatch\|AnyRouteMatch\s*=" packages/router-core/src/ -A5 | head -40 # Check what fields a RouteMatch has (routeId, scripts) rg -n "routeId\|scripts" packages/router-core/src/Matches.tsx -A1 -B1 | head -40 rg -n "routeId\|scripts" packages/router-core/src/ -A1 | head -60Length of output: 77
🏁 Script executed:
#!/bin/bash # Find AnyRouteMatch in router-core rg -rn "AnyRouteMatch" packages/router-core/src/ | head -20 # Find RouteMatch type definition rg -rn "type RouteMatch\b\|interface RouteMatch\b" packages/router-core/src/ -A 10 | head -60 # Check what scripts field looks like on a match rg -rn "scripts\?" packages/router-core/src/ -A2 -B2 | head -40Length of output: 3900
🏁 Script executed:
#!/bin/bash # Find the Matches module in router-core fd "Matches" packages/router-core/src/ # Check AnyRouteMatch fields in route.ts rg -n "AnyRouteMatch" packages/router-core/src/route.ts -B2 -A5 | head -40 # Check how headContentUtils.tsx in solid-router types activeMatches cat packages/solid-router/src/headContentUtils.tsx | head -60Length of output: 2751
@schiller-manuel, here's the prompt:In `packages/solid-router/src/Scripts.tsx`: 1. Add `AnyRouteMatch` to the existing import from `@tanstack/router-core`: - Change: `import type { RouterManagedTag } from '`@tanstack/router-core`'` - To: `import type { AnyRouteMatch, RouterManagedTag } from '`@tanstack/router-core`'` 2. Replace `Array<any>` with `Array<AnyRouteMatch>` in both helper signatures: - `getAssetScripts(matches: Array<any>)` → `getAssetScripts(matches: Array<AnyRouteMatch>)` - `getScripts(matches: Array<any>): Array<RouterManagedTag>` → `getScripts(matches: Array<AnyRouteMatch>): Array<RouterManagedTag>` 3. Inside `getAssetScripts`, the existing access `match.routeId` is already correct for `AnyRouteMatch`. No other property accesses need changing. 4. Inside `getScripts`, the existing `match.scripts!` access is already correct for `AnyRouteMatch`. No other property accesses need changing. 5. Do NOT change the `isServer ?? router.isServer` guard in `renderScripts` — it is intentional. Validate that TypeScript strict checks pass after the change. Make no other modifications.@@ -96,10 +79,13 @@79+ mounted: mounted.value,80+ nonce,81+ })82+ },83+})968497- for (const script of scripts.value.scripts) {98- allScripts.push(script as RouterManagedTag)99- }85+function renderScripts(86+ router: ReturnType<typeof useRouter>,87+ { scripts, assetScripts, mounted, nonce }: ScriptsRenderState,88+) {89+ const allScripts: Array<RouterManagedTag> = []10090101- if (mounted.value || router.serverSsr) {102- for (const asset of assetScripts.value) {103- allScripts.push(asset)104- }105- }91+ if ((isServer ?? router.isServer) && router.serverSsr) {⚠️ Potential issue | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash set -euo pipefail ls -la rg -n "isServer" packages/vue-router/src/Scripts.tsx sed -n '1,220p' packages/vue-router/src/Scripts.tsxRepository: TanStack/router
Length of output: 7157
🏁 Script executed:
#!/bin/bash set -euo pipefail sed -n '70,160p' packages/vue-router/src/Scripts.tsxRepository: TanStack/router
Length of output: 1677
🏁 Script executed:
#!/bin/bash set -euo pipefail sed -n '80,150p' packages/vue-router/src/Scripts.tsxRepository: TanStack/router
Length of output: 1428
🏁 Script executed:
#!/bin/bash set -euo pipefail # show around both referenced lines, and also find exact line numbers for the snippet nl -ba packages/vue-router/src/Scripts.tsx | sed -n '80,140p'Repository: TanStack/router
Length of output: 102
🏁 Script executed:
#!/bin/bash set -euo pipefail # search for other occurrences of "?? router.isServer" and "router.isServer" rg -n "\?\?\s*router\.isServer" packages/vue-router/src/Scripts.tsx rg -n "router\.isServer" packages/vue-router/src/Scripts.tsxRepository: TanStack/router
Length of output: 335
🏁 Script executed:
#!/bin/bash set -euo pipefail # locate how isServer is computed/declared in this file nl -ba packages/vue-router/src/Scripts.tsx | sed -n '1,110p'Repository: TanStack/router
Length of output: 102
🏁 Script executed:
#!/bin/bash set -euo pipefail # also inspect the rest for context after line 140 nl -ba packages/vue-router/src/Scripts.tsx | sed -n '140,240p'Repository: TanStack/router
Length of output: 102
Honor
router.isServerwhen importedisServerisfalse(avoid??short-circuiting).In
packages/vue-router/src/Scripts.tsx, both checks useif ((isServer ?? router.isServer) && router.serverSsr)andif (mounted || ((isServer ?? router.isServer) && router.serverSsr)). With??, when importedisServerisfalse, the fallback never runs, sorouter.isServeris ignored—sending script handling down the client path (skipping server buffered scripts and deferringassetScripts) even in SSR configurations whererouter.isServeristrue.Suggested fix
- if ((isServer ?? router.isServer) && router.serverSsr) { + if ((isServer || router.isServer) && router.serverSsr) { @@ - if (mounted || ((isServer ?? router.isServer) && router.serverSsr)) { + if (mounted || ((isServer || router.isServer) && router.serverSsr)) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/vue-router/src/Scripts.tsx` at line 91, The checks using the nullish coalescing (isServer ?? router.isServer) short-circuit when imported isServer is false and thus ignore router.isServer; update both occurrences in Scripts.tsx to use a boolean OR so router.isServer is honored when isServer is false (replace (isServer ?? router.isServer) with (isServer || router.isServer) in the if conditions that reference isServer, including the one combined with mounted).Merging this PR will not alter performance#
✅ 5untouched benchmarks⏩ 1skipped benchmark1
Comparingrsbuild-iife-cache(53498e8) withmain(b47b338)[^unexpected-base]Footnotes#
-
1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩
-
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/vue-router/src/Scripts.tsx (1)
22-22: 💤 Low valueConsider using proper match type instead of
Array<any>.Both
getAssetScriptsandgetScriptsuseArray<any>for thematchesparameter. For better type safety, consider importing and usingAnyRouteMatchfrom@tanstack/router-core, similar to how it's done in the Solid router implementation.Suggested type improvement
+import type { AnyRouteMatch, RouterManagedTag } from '`@tanstack/router-core`' -import type { RouterManagedTag } from '`@tanstack/router-core`' - const getAssetScripts = (matches: Array<any>) => { + const getAssetScripts = (matches: Array<AnyRouteMatch>) => { - const getScripts = (matches: Array<any>): Array<RouterManagedTag> => + const getScripts = (matches: Array<AnyRouteMatch>): Array<RouterManagedTag> =>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/vue-router/src/Scripts.tsx` at line 22, Replace the loose Array<any> parameter types with the proper route-match type: import AnyRouteMatch from `@tanstack/router-core` and change the signatures of getAssetScripts and getScripts to use Array<AnyRouteMatch> (or AnyRouteMatch[]); update any internal uses that assume the shape of match objects to the stronger type so TypeScript can validate fields accessed on match elements.packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts (1)
149-160: ⚡ Quick winAvoid
anyinnormalizeAttrsto preserve strict typing.Record<string, any>weakens compile-time guarantees for manifest script attrs. A narrow union (orunknown) keeps this strict-safe without changing behavior.Suggested change
-function normalizeAttrs(attrs: Record<string, any> | undefined) { +type ScriptAttrValue = string | number | boolean | null | undefined + +function normalizeAttrs( + attrs: Record<string, ScriptAttrValue> | undefined, +) { if (!attrs) { return null }As per coding guidelines: "
**/*.{ts,tsx}: Use TypeScript strict mode with extensive type safety".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts` around lines 149 - 160, normalizeAttrs currently accepts Record<string, any>, weakening type safety; change its signature to accept Record<string, unknown> | undefined and return Record<string, unknown> | null, then update internal handling to preserve runtime behavior: use Object.entries(attrs as Record<string, unknown>) so entries are typed [string, unknown], sort by key the same way, and return Object.fromEntries(entries) typed as Record<string, unknown>. Ensure any places calling normalizeAttrs are compatible with the new narrower type (or cast at call sites) and add any minimal runtime checks/casts for values if callers expect specific shapes.🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@e2e/react-start/transform-asset-urls/tests/transform-asset-urls.spec.ts`: - Around line 48-53: The current regex that builds scriptPreloads assumes rel="modulepreload" appears before href, making the test order-sensitive; update the match logic in the test (the scriptPreloads extraction and the subsequent href extraction) to be attribute-order-agnostic — e.g. match elements that contain rel="modulepreload" regardless of attribute order (use a single regex with a lookahead for rel="modulepreload" and then capture href, or a regex that alternates both orderings) and then extract the href from the correct capture group (update the loop that uses match.match(...) accordingly). --- Nitpick comments: In `@packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.ts`: - Around line 149-160: normalizeAttrs currently accepts Record<string, any>, weakening type safety; change its signature to accept Record<string, unknown> | undefined and return Record<string, unknown> | null, then update internal handling to preserve runtime behavior: use Object.entries(attrs as Record<string, unknown>) so entries are typed [string, unknown], sort by key the same way, and return Object.fromEntries(entries) typed as Record<string, unknown>. Ensure any places calling normalizeAttrs are compatible with the new narrower type (or cast at call sites) and add any minimal runtime checks/casts for values if callers expect specific shapes. In `@packages/vue-router/src/Scripts.tsx`: - Line 22: Replace the loose Array<any> parameter types with the proper route-match type: import AnyRouteMatch from `@tanstack/router-core` and change the signatures of getAssetScripts and getScripts to use Array<AnyRouteMatch> (or AnyRouteMatch[]); update any internal uses that assume the shape of match objects to the stronger type so TypeScript can validate fields accessed on match elements.🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
f9e95558-0f0d-4cb8-9b81-d742657331f2📥 Commits
Reviewing files that changed from the base of the PR and between 9461e80656461f474bb3bc1a8a21146b2d570ed4 and a9bf7f3f18e301f03a3d7b498217a26974cef54c.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (74)
.changeset/gentle-pandas-clap.md.changeset/slow-badgers-remember.mddocs/router/guide/document-head-management.mddocs/start/framework/react/guide/cdn-asset-urls.mddocs/start/framework/react/guide/early-hints.mde2e/react-router/basic-file-based/src/routeTree.gen.tse2e/react-start/basic/package.jsone2e/react-start/basic/playwright.config.tse2e/react-start/basic/start-mode-config.tse2e/react-start/basic/tests/client-output.spec.tse2e/react-start/csp/tests/csp.spec.tse2e/react-start/dev-ssr-styles/package.jsone2e/react-start/dev-ssr-styles/tests/app.spec.tse2e/react-start/rsc-deferred-hydration/tests/hydration.spec.tse2e/react-start/scroll-restoration/tests/ssr-scroll-key.spec.tse2e/react-start/server-functions/package.jsone2e/react-start/server-functions/playwright.rsbuild-cache.config.tse2e/react-start/server-functions/rsbuild.config.tse2e/react-start/server-functions/tests/rsbuild-cache.spec.tse2e/react-start/server-functions/tests/server-functions.spec.tse2e/react-start/start-manifest/tests/start-manifest.spec.tse2e/react-start/transform-asset-urls/src/routes/__root.tsxe2e/react-start/transform-asset-urls/src/server.tse2e/react-start/transform-asset-urls/tests/transform-asset-urls.spec.tse2e/solid-start/csp/tests/csp.spec.tse2e/solid-start/start-manifest/tests/start-manifest.spec.tse2e/vue-start/start-manifest/tests/start-manifest.spec.tspackages/react-router/src/Asset.tsxpackages/react-router/src/HeadContent.dev.tsxpackages/react-router/src/Scripts.tsxpackages/react-router/src/headContentUtils.tsxpackages/react-router/tests/Scripts.test.tsxpackages/react-start-rsc/src/serialization.server.tspackages/router-core/src/index.tspackages/router-core/src/manifest.tspackages/router-core/src/router.tspackages/router-core/src/ssr/createRequestHandler.tspackages/router-core/src/ssr/ssr-server.tspackages/router-core/tests/hydrate.test.tspackages/router-core/tests/manifest.test.tspackages/router-core/tests/ssr-server-manifest.test.tspackages/solid-router/src/HeadContent.dev.tsxpackages/solid-router/src/Scripts.tsxpackages/solid-router/src/headContentUtils.tsxpackages/solid-router/tests/Scripts.test.tsxpackages/start-plugin-core/src/rsbuild/COMPILER_ARCHITECTURE.mdpackages/start-plugin-core/src/rsbuild/planning.tspackages/start-plugin-core/src/rsbuild/plugin.tspackages/start-plugin-core/src/rsbuild/schema.tspackages/start-plugin-core/src/rsbuild/start-compiler-host.tspackages/start-plugin-core/src/rsbuild/start-compiler-metadata-loader.tspackages/start-plugin-core/src/rsbuild/start-compiler-metadata.tspackages/start-plugin-core/src/rsbuild/virtual-modules.tspackages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.tspackages/start-plugin-core/src/vite/start-manifest-plugin/plugin.tspackages/start-plugin-core/tests/rsbuild-output-directory.test.tspackages/start-plugin-core/tests/start-manifest-plugin/manifestBuilder.test.tspackages/start-plugin-core/vite.config.tspackages/start-server-core/src/createStartHandler.tspackages/start-server-core/src/early-hints.tspackages/start-server-core/src/finalManifest.tspackages/start-server-core/src/request-handler.tspackages/start-server-core/src/router-manifest.tspackages/start-server-core/src/tanstack-start.d.tspackages/start-server-core/src/transformAssetUrls.tspackages/start-server-core/tests/early-hints.test.tspackages/start-server-core/tests/finalManifest.test.tspackages/start-server-core/tests/transformAssets.test.tspackages/start-storage-context/src/async-local-storage.tspackages/vue-router/src/HeadContent.dev.tsxpackages/vue-router/src/HeadContent.tsxpackages/vue-router/src/Scripts.tsxpackages/vue-router/src/headContentUtils.tsxpackages/vue-router/tests/Scripts.test.tsx
💤 Files with no reviewable changes (1)
- packages/start-server-core/src/createStartHandler.ts
✅ Files skipped from review due to trivial changes (11)
- e2e/react-start/server-functions/playwright.rsbuild-cache.config.ts
- e2e/react-start/server-functions/tests/server-functions.spec.ts
- docs/router/guide/document-head-management.md
- docs/start/framework/react/guide/early-hints.md
- e2e/react-router/basic-file-based/src/routeTree.gen.ts
- .changeset/slow-badgers-remember.md
- e2e/react-start/basic/package.json
- packages/start-server-core/src/request-handler.ts
- docs/start/framework/react/guide/cdn-asset-urls.md
- packages/start-server-core/tests/finalManifest.test.ts
- packages/router-core/tests/hydrate.test.ts
e2e/react-start/transform-asset-urls/tests/transform-asset-urls.spec.ts lines 48 to 53OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -39,15 +39,15 @@3939 }4040 })414142- test('SSR HTML contains CDN-prefixed modulepreload links', async ({42+ test('SSR HTML contains CDN-prefixed script preload links', async ({4343 page,4444 }) => {4545 const html = await getSSRHtml(page)464647- // All modulepreload links should point to the CDN origin48- const modulepreloads = html.match(/rel="modulepreload"[^>]*href="([^"]+)"/g)49- expect(modulepreloads).toBeTruthy()50- expect(modulepreloads!.length).toBeGreaterThan(0)47+ // All script preload links should point to the CDN origin48+ const scriptPreloads = html.match(/rel="modulepreload"[^>]*href="([^"]+)"/g)49+ expect(scriptPreloads).toBeTruthy()50+ expect(scriptPreloads!.length).toBeGreaterThan(0)515152- for (const match of modulepreloads!) {52+ for (const match of scriptPreloads!) {5353 const href = match.match(/href="([^"]+)"/)?.[1]⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
Make modulepreload matching attribute-order agnostic.
Line 48 assumes
relappears beforehref, which can make this test flaky if attribute order changes in emitted HTML.Suggested fix
- const scriptPreloads = html.match(/rel="modulepreload"[^>]*href="([^"]+)"/g) - expect(scriptPreloads).toBeTruthy() - expect(scriptPreloads!.length).toBeGreaterThan(0) - - for (const match of scriptPreloads!) { - const href = match.match(/href="([^"]+)"/)?.[1] + const scriptPreloadMatches = Array.from( + html.matchAll( + /<link(?=[^>]*\brel="modulepreload")(?=[^>]*\bhref="([^"]+)")[^>]*>/g, + ), + ) + expect(scriptPreloadMatches.length).toBeGreaterThan(0) + + for (const match of scriptPreloadMatches) { + const href = match[1] expect(href).toBeTruthy() expect(href).toMatch(/^http:\/\/localhost:\d+\//) }📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change48- const scriptPreloads = html.match(/rel="modulepreload"[^>]*href="([^"]+)"/g)49- expect(scriptPreloads).toBeTruthy()50- expect(scriptPreloads!.length).toBeGreaterThan(0)51-52- for (const match of scriptPreloads!) {53- const href = match.match(/href="([^"]+)"/)?.[1]48+ const scriptPreloadMatches = Array.from(49+ html.matchAll(50+ /<link(?=[^>]*\brel="modulepreload")(?=[^>]*\bhref="([^"]+)")[^>]*>/g,51+ ),52+ )53+ expect(scriptPreloadMatches.length).toBeGreaterThan(0)54+55+ for (const match of scriptPreloadMatches) {56+ const href = match[1]57+ expect(href).toBeTruthy()58+ expect(href).toMatch(/^http:\/\/localhost:\d+\//)59+ }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e/react-start/transform-asset-urls/tests/transform-asset-urls.spec.ts` around lines 48 - 53, The current regex that builds scriptPreloads assumes rel="modulepreload" appears before href, making the test order-sensitive; update the match logic in the test (the scriptPreloads extraction and the subsequent href extraction) to be attribute-order-agnostic — e.g. match elements that contain rel="modulepreload" regardless of attribute order (use a single regex with a lookahead for rel="modulepreload" and then capture href, or a regex that alternates both orderings) and then extract the href from the correct capture group (update the loop that uses match.match(...) accordingly).✅ Addressed in commits f1c8878 to 53498e8
🧹 Nitpick comments (1)
e2e/react-start/server-functions/tests/rsbuild-cache.spec.ts (1)
66-79: 💤 Low valueProcess kill error handling may silently fail on non-existent processes.
The
killDevServerfunction catches all errors when killing the process group but only falls back to direct child kill if the process group kill throws. On some systems,process.kill(-pid, signal)may fail for reasons other than "process already exited" (e.g., permission issues), and swallowing these silently could mask debugging information.Consider logging the error in test environments:
} catch (e) { - // Fall back to killing the direct child below. + // Fall back to killing the direct child below. + // Log in case it's not just "process doesn't exist" + if (process.env.DEBUG) console.warn('process.kill(-pid) failed:', e) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e/react-start/server-functions/tests/rsbuild-cache.spec.ts` around lines 66 - 79, The catch-all in killDevServer swallows all errors from process.kill(-pid, signal) which can hide real failures; update killDevServer to catch the error into a variable, check for "process not found" (e.g. err.code === 'ESRCH' or equivalent) and only silently fallback to devServer.child.kill(signal) in that case, otherwise surface the error (rethrow or log via console.error/processLogger) so permission or other failures are not hidden; reference the killDevServer function, the devServer.child/ pid variables and the process.kill(-pid, signal) call when making the change.🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Nitpick comments: In `@e2e/react-start/server-functions/tests/rsbuild-cache.spec.ts`: - Around line 66-79: The catch-all in killDevServer swallows all errors from process.kill(-pid, signal) which can hide real failures; update killDevServer to catch the error into a variable, check for "process not found" (e.g. err.code === 'ESRCH' or equivalent) and only silently fallback to devServer.child.kill(signal) in that case, otherwise surface the error (rethrow or log via console.error/processLogger) so permission or other failures are not hidden; reference the killDevServer function, the devServer.child/ pid variables and the process.kill(-pid, signal) call when making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
cb86e12e-646a-4e30-ab06-beac50c82443📥 Commits
Reviewing files that changed from the base of the PR and between a9bf7f3f18e301f03a3d7b498217a26974cef54c and 53498e898724d517ff4074877b7c855a2064cd49.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (76)
.changeset/gentle-pandas-clap.md.changeset/slow-badgers-remember.mddocs/router/guide/document-head-management.mddocs/start/framework/react/guide/cdn-asset-urls.mddocs/start/framework/react/guide/early-hints.mde2e/react-router/basic-file-based/src/routeTree.gen.tse2e/react-start/basic/package.jsone2e/react-start/basic/playwright.config.tse2e/react-start/basic/start-mode-config.tse2e/react-start/basic/tests/client-output.spec.tse2e/react-start/csp/tests/csp.spec.tse2e/react-start/dev-ssr-styles/package.jsone2e/react-start/dev-ssr-styles/tests/app.spec.tse2e/react-start/rsc-deferred-hydration/tests/hydration.spec.tse2e/react-start/scroll-restoration/tests/ssr-scroll-key.spec.tse2e/react-start/server-functions/package.jsone2e/react-start/server-functions/playwright.rsbuild-cache.config.tse2e/react-start/server-functions/rsbuild.config.tse2e/react-start/server-functions/tests/rsbuild-cache.spec.tse2e/react-start/server-functions/tests/server-functions.spec.tse2e/react-start/start-manifest/tests/start-manifest.spec.tse2e/react-start/transform-asset-urls/src/routes/__root.tsxe2e/react-start/transform-asset-urls/src/server.tse2e/react-start/transform-asset-urls/tests/transform-asset-urls.spec.tse2e/solid-start/csp/tests/csp.spec.tse2e/solid-start/start-manifest/tests/start-manifest.spec.tse2e/vue-start/start-manifest/tests/start-manifest.spec.tspackages/react-router/src/Asset.tsxpackages/react-router/src/HeadContent.dev.tsxpackages/react-router/src/Scripts.tsxpackages/react-router/src/headContentUtils.tsxpackages/react-router/tests/Scripts.test.tsxpackages/react-start-rsc/src/serialization.server.tspackages/router-core/src/index.tspackages/router-core/src/manifest.tspackages/router-core/src/router.tspackages/router-core/src/ssr/createRequestHandler.tspackages/router-core/src/ssr/ssr-server.tspackages/router-core/tests/hydrate.test.tspackages/router-core/tests/manifest.test.tspackages/router-core/tests/ssr-server-manifest.test.tspackages/solid-router/src/HeadContent.dev.tsxpackages/solid-router/src/Scripts.tsxpackages/solid-router/src/headContentUtils.tsxpackages/solid-router/tests/Scripts.test.tsxpackages/start-plugin-core/src/import-protection/virtualModules.tspackages/start-plugin-core/src/rsbuild/COMPILER_ARCHITECTURE.mdpackages/start-plugin-core/src/rsbuild/planning.tspackages/start-plugin-core/src/rsbuild/plugin.tspackages/start-plugin-core/src/rsbuild/schema.tspackages/start-plugin-core/src/rsbuild/start-compiler-host.tspackages/start-plugin-core/src/rsbuild/start-compiler-metadata-loader.tspackages/start-plugin-core/src/rsbuild/start-compiler-metadata.tspackages/start-plugin-core/src/rsbuild/virtual-modules.tspackages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.tspackages/start-plugin-core/src/vite/start-manifest-plugin/plugin.tspackages/start-plugin-core/tests/importProtection/virtualModules.test.tspackages/start-plugin-core/tests/rsbuild-output-directory.test.tspackages/start-plugin-core/tests/start-manifest-plugin/manifestBuilder.test.tspackages/start-plugin-core/vite.config.tspackages/start-server-core/src/createStartHandler.tspackages/start-server-core/src/early-hints.tspackages/start-server-core/src/finalManifest.tspackages/start-server-core/src/request-handler.tspackages/start-server-core/src/router-manifest.tspackages/start-server-core/src/tanstack-start.d.tspackages/start-server-core/src/transformAssetUrls.tspackages/start-server-core/tests/early-hints.test.tspackages/start-server-core/tests/finalManifest.test.tspackages/start-server-core/tests/transformAssets.test.tspackages/start-storage-context/src/async-local-storage.tspackages/vue-router/src/HeadContent.dev.tsxpackages/vue-router/src/HeadContent.tsxpackages/vue-router/src/Scripts.tsxpackages/vue-router/src/headContentUtils.tsxpackages/vue-router/tests/Scripts.test.tsx
💤 Files with no reviewable changes (1)
- packages/start-server-core/src/createStartHandler.ts
✅ Files skipped from review due to trivial changes (8)
- packages/start-server-core/src/request-handler.ts
- e2e/react-start/server-functions/rsbuild.config.ts
- .changeset/gentle-pandas-clap.md
- docs/start/framework/react/guide/early-hints.md
- .changeset/slow-badgers-remember.md
- e2e/react-start/basic/package.json
- docs/router/guide/document-head-management.md
- docs/start/framework/react/guide/cdn-asset-urls.md
Sign in to join this conversation.
📝 Walkthrough
Walkthrough#
Refactors manifest to ServerManifest (preloads, scripts, css), adds ScriptFormat (module|iife), changes transformAsset kinds to 'script'/'stylesheet'/'css-url', implements rsbuild/Rspack per-environment server-function metadata persistence/replay, and updates routers, server SSR, tests, docs, and e2e suites.
Changes#
ServerManifest model + rsbuild server-fn persistence
packages/router-core/src/manifest.ts,packages/router-core/src/index.tsScriptFormat,DEV_STYLES_ATTR,getManifestScriptFormat,getScriptPreloadAttrs,ManifestCssLink/ManifestScript, and related re-exports.packages/router-core/src/ssr/*,packages/start-server-core/src/finalManifest.ts,packages/start-server-core/src/router-manifest.tspackages/start-server-core/src/transformAssetUrls.ts,e2e/*/transform-asset-urls/*packages/start-plugin-core/src/rsbuild/*rsbuild.client.outputschema (modulepackages/start-plugin-core/src/rsbuild/start-compiler-host.ts,start-compiler-metadata-loader.tsserverFnsById.packages/start-plugin-core/src/start-manifest-plugin/manifestBuilder.tscssandscriptsarrays per route, implements stylesheet/script identity and dedupe, chunk CSS collector, hydration merge logic, and setsscriptFormatfor iife output.packages/*-router/src/*,packages/*-router/tests/*preventScriptHoist, adjust script injection/deduping, and preserve SSR head elements.packages/start-server-core/src/*,packages/start-storage-context/*getRequestAssetsfrom start context.e2e/**,packages/**/tests/*,docs/*,.changeset/*scriptkey and IIFE/module preload rules, and adds changesets.Estimated code review effort 🎯 5 (Critical) | ⏱️ ~120 minutes
Possibly related PRs
Suggested reviewers
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)