Skip to content

fix(react-router): isolate client-only match hydration - #8185

Open
Sheraff wants to merge 1 commit into
repro/issue-8180from
fix/issue-8180-hydration-boundary
Open

fix(react-router): isolate client-only match hydration#8185
Sheraff wants to merge 1 commit into
repro/issue-8180from
fix/issue-8180-hydration-boundary

Conversation

@Sheraff

@Sheraff Sheraff commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #8183.

Summary

  • keep reactive match-store subscriptions below the ClientOnly hydration gate for ssr: false and data-only routes
  • preserve route error and not-found ownership for the pre-hydration pending fallback and the post-hydration reactive match tree
  • add focused hydration boundary coverage and a patch changeset

Why

During React 18 hydration, the initial client load can synchronously publish transient match fetching state. A full-match subscription above a dehydrated client-only subtree invalidates that Suspense boundary before hydration completes, producing React error #421.

The match subscription now mounts only in the live MatchInner branch. The pre-hydration fallback uses the same route-boundary construction without subscribing to match updates, while Transitioner remains the sole loading authority.

Closes #8180.

Verification

  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/react-router:test:unit --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/react-router:test:types --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/react-router:test:eslint --outputStyle=stream --skipRemoteCache
  • React 18 beforeLoad reproduction: 3/3 passing
  • React 18 loader reproduction: 3/3 passing

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d36e228-1b22-4ba5-8c84-d4b4adee811a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 836a97b

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 16m 10s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2m 12s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-28 08:09:46 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 4 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/react-router 1.170.32 → 1.170.33 Changeset
@tanstack/react-start 1.168.49 → 1.168.50 Dependent
@tanstack/react-start-client 1.168.30 → 1.168.31 Dependent
@tanstack/react-start-rsc 0.1.48 → 0.1.49 Dependent
@tanstack/react-start-server 1.167.37 → 1.167.38 Dependent

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 32107ffa5f27
  • Measured at: 2026-08-28T07:55:06.416Z
  • Baseline source: history:0caf6b9a2b7e
  • Dashboard: bundle-size history

The following scenarios have bundle-size changes compared with the baseline:

Scenario Current (gzip) Initial (gzip) Raw Brotli Trend
react-router.minimal 83.8 KiB
+50 B
83.7 KiB
+50 B
262.6 KiB
+395 B
73.0 KiB
-20 B
██▃▃▃▃▃▃▃▃▁▆
react-router.full 87.3 KiB
+37 B
87.2 KiB
+34 B
274.3 KiB
+396 B
75.9 KiB
-46 B
██▃▃▃▃▃▃▃▃▁▅
solid-router.minimal 33.1 KiB
+12 B
33.0 KiB
+13 B
96.3 KiB
+72 B
29.9 KiB
-14 B
██▂▂▂▂▂▂▂▂▁▂
solid-router.full 38.0 KiB
+16 B
37.9 KiB
+11 B
111.0 KiB
+72 B
34.2 KiB
+34 B
██▂▂▃▃▃▃▃▃▁▃
vue-router.minimal 49.5 KiB
+10 B
49.4 KiB
+8 B
138.3 KiB
+72 B
44.6 KiB
-5 B
██▂▂▂▂▂▂▂▂▁▂
vue-router.full 55.1 KiB
+8 B
55.0 KiB
+9 B
156.6 KiB
+72 B
49.5 KiB
-38 B
██▁▁▂▂▂▂▂▂▁▂
react-start.minimal 96.7 KiB
+34 B
96.6 KiB
+34 B
304.8 KiB
+397 B
83.8 KiB
-5 B
██▃▃▄▄▄▄▄▄▁▅
react-start.deferred-hydration 97.4 KiB
+36 B
96.6 KiB
+34 B
306.2 KiB
+397 B
84.5 KiB
+108 B
██▃▃▄▄▄▄▄▄▁▅
react-start.full 99.9 KiB
+39 B
99.7 KiB
+37 B
314.6 KiB
+397 B
86.6 KiB
+39 B
██▃▃▄▄▄▄▄▄▁▅
react-start.rsbuild.minimal 100.0 KiB
+61 B
99.9 KiB
+61 B
315.2 KiB
+397 B
86.3 KiB
+53 B
██▃▃▄▄▄▄▄▄▁▇
react-start.rsbuild.minimal-iife 100.4 KiB
+62 B
100.3 KiB
+62 B
316.1 KiB
+397 B
86.7 KiB
-28 B
██▃▃▄▄▄▄▄▄▁▇
react-start.rsbuild.full 103.4 KiB
+62 B
103.2 KiB
+62 B
325.2 KiB
+397 B
89.0 KiB
+42 B
██▃▃▃▃▃▃▃▃▁▇
solid-start.minimal 46.0 KiB
+13 B
45.9 KiB
+11 B
137.4 KiB
+72 B
40.9 KiB
+16 B
██▃▃▂▂▂▂▂▂▁▂
solid-start.deferred-hydration 49.1 KiB
+9 B
45.9 KiB
+10 B
144.9 KiB
+72 B
43.7 KiB
-2 B
██▂▂▂▂▂▂▂▂▁▂
solid-start.full 51.1 KiB
+9 B
51.0 KiB
+9 B
152.8 KiB
+72 B
45.3 KiB
-101 B
██▂▂▂▂▂▂▂▂▁▂
vue-start.minimal 65.6 KiB
+14 B
65.5 KiB
+10 B
189.2 KiB
+72 B
58.4 KiB
+67 B
██▁▁▃▃▃▃▃▃▁▃
vue-start.full 69.5 KiB
+15 B
69.3 KiB
+12 B
201.5 KiB
+72 B
61.6 KiB
-83 B
██▁▁▃▃▃▃▃▃▁▃

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.

@pkg-pr-new

pkg-pr-new Bot commented Aug 28, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@8185

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8185

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8185

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@8185

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@8185

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@8185

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@8185

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8185

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@8185

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@8185

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@8185

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@8185

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@8185

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@8185

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@8185

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@8185

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@8185

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@8185

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8185

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@8185

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8185

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@8185

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8185

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8185

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@8185

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@8185

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@8185

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@8185

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8185

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@8185

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@8185

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8185

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@8185

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@8185

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8185

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@8185

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8185

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8185

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@8185

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@8185

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@8185

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@8185

commit: 836a97b

@codspeed-hq

codspeed-hq Bot commented Aug 28, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 7.38%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 11 improved benchmarks
❌ 9 regressed benchmarks
✅ 160 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory mem server error-paths not-found (vue) 504.3 KB 2,202.7 KB -77.1%
Memory mem server error-paths not-found (solid) 551 KB 798.8 KB -31.02%
Memory mem server error-paths unmatched (solid) 561.7 KB 628.5 KB -10.63%
Memory mem server error-paths redirect (solid) 350 KB 383.4 KB -8.71%
Memory mem client unique-location-churn (vue) 429.3 KB 460.7 KB -6.82%
Memory mem server aborted-requests (solid) 1.2 MB 1.2 MB -5.91%
Memory mem server server-fn-churn (react) 372.6 KB 393.5 KB -5.32%
Memory mem server error-paths unmatched (vue) 596.5 KB 626.2 KB -4.74%
Memory mem client loader-data-retention (solid) 157.9 KB 162.8 KB -3.01%
Simulation client-async-pipeline navigation loop (react) 65 ms 57.5 ms +13.16%
Memory mem server request-churn (react) 701.4 KB 639.6 KB +9.65%
Memory mem server peak-large-page (solid) 1.2 MB 1.1 MB +8.55%
Memory mem client preload-churn (react) 813.6 KB 753.3 KB +8%
Memory mem client interrupted-navigations (vue) 380.2 KB 353.9 KB +7.41%
Memory mem server peak-large-page (vue) 1.1 MB 1 MB +7.31%
Memory mem server aborted-requests (vue) 1,087.3 KB 1,014.3 KB +7.2%
Simulation ssr global-mw document (vue) 630.7 ms 590.4 ms +6.82%
Memory mem server server-fn-churn (vue) 355.7 KB 339.3 KB +4.86%
Simulation ssr global-mw document (solid) 364.8 ms 349.4 ms +4.4%
Memory mem client navigation-churn (solid) 638 KB 614.5 KB +3.82%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix/issue-8180-hydration-boundary (836a97b) with main (0caf6b9)1

Open in CodSpeed

Footnotes

  1. No successful run was found on repro/issue-8180 (bf79316) during the generation of this report, so main (0caf6b9) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant