Repository navigation
Conversation
Restores the #8640 hydration matrix from #8643 for React, Solid and Vue, adds every case without a pending component, and adds SSR + hydration + param navigation tests (the client route tree has no `ssr` option, as Start's client build strips it). Without a pending component nothing holds the match pending, so React can hydrate the route's boundary after the client load commits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes #8640 without the React hydration mismatch that reverted #8643. All adapters: a no-SSR match renders its server pending UI through the same pending path the hydrating client uses, at the same position, instead of a `ClientOnly` fallback that is swapped out after hydration. React only, since it can hydrate a route's boundary after the client load commits: - `hydrate()` keeps the matches it presented on `router._hydrated`. `Match` reads them as its `useSyncExternalStore` server snapshot, so a late hydration render matches the server HTML, then catches up. - `MatchInner` suspends only to keep other committed output alive. Pending UI already in place, including the one hydration adopts, stays in place instead of being hidden behind a second copy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
🦋 Changeset detectedLatest commit: 95a1794 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 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 |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
🚀 Changeset Version Preview5 package(s) bumped directly, 19 bumped as dependents. 🟩 Patch bumps
|
|
View your CI Pipeline Execution ↗ for commit 95a1794
☁️ Nx Cloud last updated this comment at |
Bundle Size Benchmarks
The following scenarios have bundle-size changes compared with the baseline:
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. |
More templates
@tanstack/arktype-adapter
@tanstack/eslint-plugin-router
@tanstack/eslint-plugin-start
@tanstack/history
@tanstack/nitro-v2-vite-plugin
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-ssr-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-rsc
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-ssr-query-core
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-router-ssr-query
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-fn-stubs
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-static-server-functions
@tanstack/start-storage-context
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/vue-router
@tanstack/vue-router-devtools
@tanstack/vue-router-ssr-query
@tanstack/vue-start
@tanstack/vue-start-client
@tanstack/vue-start-server
@tanstack/zod-adapter
commit: |
Merging this PR will regress 4 benchmarksℹ️ 3 benchmarks have no flame graph
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem client unique-location-churn (react) |
68.1 KB | 77.2 KB | -11.77% |
| ❌ | Memory | mem server aborted-requests (solid) |
142.9 KB | 151.9 KB | -5.89% |
| ❌ | Memory | mem server request-churn (solid) |
129.5 KB | 134.4 KB | -3.66% |
| ❌ | Memory | mem client unique-location-churn (solid) |
61.5 KB | 63.7 KB | -3.33% |
| ⚡ | Simulation | client-nested-params navigation loop (solid) |
761.7 ms | 691.1 ms | +10.21% |
| ⚡ | Memory | mem client navigation-churn (solid) |
88.6 KB | 80.4 KB | +10.2% |
| ⚡ | Memory | mem client unique-location-churn (vue) |
96.2 KB | 88.9 KB | +8.3% |
| ⚡ | Simulation | client-history navigation loop (solid) |
93.9 ms | 87.9 ms | +6.81% |
| ⚡ | Simulation | client-route-tree-scale navigation loop (solid) |
220.1 ms | 206.1 ms | +6.79% |
| ⚡ | Simulation | client-rewrites navigation loop (solid) |
128.2 ms | 120.4 ms | +6.55% |
| ⚡ | Memory | mem client preload-churn (solid) |
76.2 KB | 71.9 KB | +5.99% |
| ⚡ | Memory | mem client mount-unmount (solid) |
80.9 KB | 76.4 KB | +5.9% |
| ⚡ | Simulation | client-async-pipeline navigation loop (solid) |
113 ms | 107.2 ms | +5.43% |
| ⚡ | Simulation | client-control-flow navigation loop (solid) |
99 ms | 94.1 ms | +5.23% |
| ⚡ | Simulation | client-loaders navigation loop (solid) |
144.1 ms | 137.3 ms | +4.97% |
| ⚡ | Memory | mem server error-paths not-found (vue) |
127.8 KB | 122.4 KB | +4.42% |
| ⚡ | Simulation | client-preload interaction loop (solid) |
151 ms | 144.6 ms | +4.41% |
| ⚡ | Simulation | client-head navigation loop (solid) |
401.7 ms | 387.9 ms | +3.55% |
| ⚡ ℹ️ | Simulation | client-search-params navigation loop (solid) |
223.6 ms | 216.5 ms | +3.31% |
| ⚡ | Simulation | client-mount loop (solid) |
90.5 ms | 87.6 ms | +3.3% |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fix/no-ssr-hydration-v2 (95a1794) with main (f6d21de)
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. ↩
🎯 Changes
Fixes #8640. Replaces #8643, which was reverted in #8646 because of a React hydration mismatch on no-SSR routes without a
pendingComponent.All adapters (same as #8643): a no-SSR match renders its server pending UI through the normal pending path, so hydration renders it at the same position. The
ClientOnlywrapper (and Solid'sshouldSkipSuspenseFallback) is removed.React only. React can hydrate a route's Suspense boundary after the shell commits, and the client load can commit in between.
@tanstack/react-store'suseSelectorpasses the same function as client and server snapshot, so that late hydration render read the live store (success) against the server's pending HTML. Before, with apendingComponent,pendingMinMs(default 500 ms) happened to hold the match pending long enough. Without one, it committed at once.hydrate()keeps the matches it presented onrouter._hydrated.Matchreads its store withReact.useSyncExternalStore, using that match as the server snapshot.MatchInnerdoesn't suspend over its own pending UI rendered in place. Doing so would hide it and mount a second copy. It still suspends to keep committed content or errors alive. A ref tracks the in-place state; it startstruefor the hydrated pending match.Tests (first commit, in each adapter):
issue-8640-data-only-pending-hydration: real SSR + hydration for success, error, notFound, unmatched URL,ssr: falseinvalid search, and a failing child. Each case runs with apendingComponent(single server skeleton, held forpendingMinMs) and without one (no hydration mismatch).no-ssr-client-navigation: SSR + hydration, then a param navigation. The client route tree has nossr, as Start's client build strips it. The component must keep its state. React also shows pending UI during the navigation.Removing any React piece fails tests: the server snapshot (7), the hydration seed (1), the layout-effect update (2).
Open question:
router._hydratedkeeps the first page's presented matches (including loader data) for the router's lifetime, because a boundary can hydrate arbitrarily late.Found while testing, not changed here: in Solid and Vue, a param navigation that shows pending UI remounts the route component, also for
ssr: trueroutes.Bundle-size pass not done yet.
AI-assisted (Claude).
✅ Checklist
🚀 Release Impact
🤖 Generated with Claude Code