fix: opt into SSR type level serializability check #5233
Merged
schiller-manuel(GitHub profile, opens in a new tab)merged 1 commit into
main fromrefs/pull/5233/head·merged by schiller-manuel(GitHub profile, opens in a new tab) default false was not working for plain router
fixes #5222
Summary by CodeRabbit#
Refactor
- Standardized SSR registration across React Start and Solid Start by introducing a unified SSR flag in public typings.
- Added a shared SSR type in the router core and updated internal serializers to use it.
- No runtime behavior changes; improvements are type-level only.
Chores
- Regenerated route trees in examples and end-to-end setups to include the SSR flag, ensuring consistent SSR-aware type checking across projects.
- 1
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: start-plugin-core
View your CI Pipeline Execution ↗ for commit 91ccee2c5db1df3a606fadd707608893d834f229
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 4m 8s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 1m 21s View ↗
☁️ Nx Cloud last updated this comment at
2025-09-25 15:27:51UTCMore templates
- tanstack-router-solid-example-basic
- 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-streaming-file-based
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-solid-start-example-bare
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-static
- 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-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-start-example-basic-react-query
- tanstack-start-example-basic-static
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-example-large
- tanstack-start-example-material-ui
- 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/arktype-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5233@tanstack/directive-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5233@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5233@tanstack/history
npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5233@tanstack/nitro-v2-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5233@tanstack/react-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5233@tanstack/react-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5233@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5233@tanstack/react-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5233@tanstack/react-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5233@tanstack/react-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5233@tanstack/router-cli
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5233@tanstack/router-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5233@tanstack/router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5233@tanstack/router-devtools-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5233@tanstack/router-generator
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5233@tanstack/router-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5233@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5233@tanstack/router-utils
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5233@tanstack/router-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5233@tanstack/server-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5233@tanstack/solid-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5233@tanstack/solid-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5233@tanstack/solid-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5233@tanstack/solid-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5233@tanstack/solid-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5233@tanstack/start-client-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5233@tanstack/start-plugin-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5233@tanstack/start-server-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5233@tanstack/start-static-server-functions
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5233@tanstack/start-storage-context
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5233@tanstack/valibot-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5233@tanstack/virtual-file-routes
npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5233@tanstack/zod-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5233commit:
91ccee2
Sign in to join this conversation.
Caution
Review failed#
The pull request is closed.
Walkthrough#
Adds an ssr: true property to Register interface augmentations across React Start and Solid Start routeTree.gen.ts files. Introduces a new RegisteredSsr type in router-core and updates serializer transformer types to use it. Updates start-plugin-core to declare ssr: true in its Register module augmentation.
Changes#
e2e/react-start/*/src/routeTree.gen.ts@tanstack/react-start: addssr: truetointerface Registeralongside existingroutertyping.e2e/solid-start/*/.../routeTree.gen.ts@tanstack/solid-start: addssr: truetointerface Registeralongside existingroutertyping.examples/react/*/src/routeTree.gen.ts@tanstack/react-start: addssr: truetointerface Register.examples/solid/*/routeTree.gen.ts@tanstack/solid-start: addssr: truetointerface Register.packages/router-core/src/router.tsRegisteredSsr<TRegister = Register>inferringssrpresence; defaults tofalsewhen absent.packages/router-core/src/ssr/serializer/transformer.tsRegisteredSsr<TRegister>in conditional branches ofValidateSerializableLifecycleResult.packages/start-plugin-core/src/start-router-plugin/plugin.ts@tanstack/${corePluginOpts.framework}-start: addssr: truetointerface Register.Sequence Diagram(s)#
Estimated code review effort#
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs#
packages/router-core/src/ssr/serializer/transformer.ts, potentially interacting with the newRegisteredSsr-based branching.Suggested labels#
package: router-corePoem#
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 86aa74e345839b055e72ccabe5d82a3c16c6170f and 91ccee2c5db1df3a606fadd707608893d834f229.
📒 Files selected for processing (42)
e2e/react-start/basic-auth/src/routeTree.gen.ts(1 hunks)e2e/react-start/basic-react-query/src/routeTree.gen.ts(1 hunks)e2e/react-start/basic-tsr-config/src/routeTree.gen.ts(1 hunks)e2e/react-start/basic/src/routeTree.gen.ts(1 hunks)e2e/react-start/custom-basepath/src/routeTree.gen.ts(1 hunks)e2e/react-start/query-integration/src/routeTree.gen.ts(1 hunks)e2e/react-start/scroll-restoration/src/routeTree.gen.ts(1 hunks)e2e/react-start/selective-ssr/src/routeTree.gen.ts(1 hunks)e2e/react-start/serialization-adapters/src/routeTree.gen.ts(1 hunks)e2e/react-start/server-functions/src/routeTree.gen.ts(1 hunks)e2e/react-start/server-routes/src/routeTree.gen.ts(1 hunks)e2e/react-start/spa-mode/src/routeTree.gen.ts(1 hunks)e2e/react-start/virtual-routes/src/routeTree.gen.ts(1 hunks)e2e/react-start/website/src/routeTree.gen.ts(1 hunks)e2e/solid-start/basic-tsr-config/src/app/routeTree.gen.ts(1 hunks)e2e/solid-start/basic/src/routeTree.gen.ts(1 hunks)e2e/solid-start/custom-basepath/src/routeTree.gen.ts(1 hunks)e2e/solid-start/scroll-restoration/src/routeTree.gen.ts(1 hunks)e2e/solid-start/selective-ssr/src/routeTree.gen.ts(1 hunks)e2e/solid-start/server-functions/src/routeTree.gen.ts(1 hunks)e2e/solid-start/server-routes/src/routeTree.gen.ts(1 hunks)e2e/solid-start/spa-mode/src/routeTree.gen.ts(1 hunks)e2e/solid-start/website/src/routeTree.gen.ts(1 hunks)examples/react/start-bare/src/routeTree.gen.ts(1 hunks)examples/react/start-basic-auth/src/routeTree.gen.ts(1 hunks)examples/react/start-basic-react-query/src/routeTree.gen.ts(1 hunks)examples/react/start-basic-static/src/routeTree.gen.ts(1 hunks)examples/react/start-basic/src/routeTree.gen.ts(1 hunks)examples/react/start-convex-trellaux/src/routeTree.gen.ts(1 hunks)examples/react/start-counter/src/routeTree.gen.ts(1 hunks)examples/react/start-large/src/routeTree.gen.ts(1 hunks)examples/react/start-material-ui/src/routeTree.gen.ts(1 hunks)examples/react/start-supabase-basic/src/routeTree.gen.ts(1 hunks)examples/react/start-tailwind-v4/src/routeTree.gen.ts(1 hunks)examples/react/start-trellaux/src/routeTree.gen.ts(1 hunks)examples/react/start-workos/src/routeTree.gen.ts(1 hunks)examples/solid/start-bare/src/routeTree.gen.ts(1 hunks)examples/solid/start-basic-static/src/routeTree.gen.ts(1 hunks)examples/solid/start-basic/src/routeTree.gen.ts(1 hunks)packages/router-core/src/router.ts(1 hunks)packages/router-core/src/ssr/serializer/transformer.ts(2 hunks)packages/start-plugin-core/src/start-router-plugin/plugin.ts(1 hunks)Comment `@coderabbitai help` to get the list of available commands and usage tips.