Skip to content
Source
Sign inSign up
TanStack/router

fix(start): prune statically disabled SSR route implementations #8291

OpenLadyBluenotes(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromfix/start-ssr-route-pruningopened

Showing 23 changed files with 11 additions and 0 deletions (loading 20).

x
0 of 23 viewed, 23 left
7 additions and 0 deletions.changeset/cruel-chairs-love.mdAdded
View file
@@ -0,0 +1,7 @@
+---
+'@tanstack/router-generator': patch
+'@tanstack/router-plugin': patch
+'@tanstack/start-plugin-core': patch
+---
+​
+Prune statically client-only route implementations from production server bundles while preserving SSR fallbacks and client-loader hydration.
2 additions and 0 deletionsdocs/start/framework/react/guide/selective-ssr.mdModified
View file
@@ -175,6 +175,8 @@
​
## Fallback Rendering
​
+Production builds remove route components for statically known `ssr: false` and `ssr: 'data-only'` routes from the server bundle. For `ssr: false`, their loaders and `beforeLoad` implementations are also removed. Pending, error, and not-found components remain available to the server, and the client still receives the code it needs for hydration and navigation. Functional SSR options are evaluated at runtime and remain in the server bundle. Root-route code is retained because shell requests can execute it regardless of its configured SSR mode.
+​
For the first route with `ssr: false` or `ssr: 'data-only'`, the server will render the route's `pendingComponent` as a fallback. If `pendingComponent` isn't configured, the `defaultPendingComponent` will be rendered. If neither is configured, no fallback will be rendered.
​
On the client during hydration, this fallback will be displayed for at least `minPendingMs` (or `defaultPendingMinMs` if not configured), even if the route doesn't have `beforeLoad` or `loader` defined.
2 additions and 0 deletionsdocs/start/framework/solid/guide/selective-ssr.mdModified
View file