Skip to content

fix(router-core): harden lane loading lifecycle - #7869

Merged
Sheraff merged 5 commits into
fix-router-core-lane-match-loaderfrom
fix-router-core-lane-match-loader-followups
Jul 21, 2026
Merged

fix(router-core): harden lane loading lifecycle#7869
Sheraff merged 5 commits into
fix-router-core-lane-match-loaderfrom
fix-router-core-lane-match-loader-followups

Conversation

@Sheraff

@Sheraff Sheraff commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • harden client and server lane loading around not-found/error boundaries, redirects, hydration, SSR projection, and masked preloads
  • keep framework error boundaries and delayed lazy route options synchronized across React, Solid, and Vue, and use the current HMR compiler helper
  • dispose abandoned SSR responses and streams exactly once, with expanded lifecycle coverage and updated loader invariants

Testing

  • full @tanstack/router-core:test:unit suite: 1470 passed, 3 expected failures
  • relevant React, Solid, Vue, Start server, and router-plugin unit suites
  • type and ESLint targets for all six affected packages
  • full 17-scenario bundle-size build and comparison
  • git diff --check

Bundle size

Final deltas against this PR base range from +267 to +360 gzip bytes across the 17 scenarios. The optimization pass recovered 48 to 76 gzip bytes per scenario from the initial correctness fix set.

@coderabbitai

coderabbitai Bot commented Jul 21, 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

Run ID: 0ca6f37a-60b3-4365-916a-ba5723d57da4

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-router-core-lane-match-loader-followups

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

@nx-cloud

nx-cloud Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 887ab0a

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 4m 50s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-21 22:23:57 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: b85994c0463e
  • Measured at: 2026-07-21T21:57:38.088Z
  • Baseline source: history:edf55759d8e9
  • Dashboard: bundle-size history

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

Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-router.minimal 87.31 KiB -41 B (-0.05%) 87.17 KiB 269.66 KiB 76.00 KiB ███████████▁
react-router.full 90.97 KiB -91 B (-0.10%) 90.84 KiB 281.45 KiB 79.22 KiB ███████████▁
solid-router.minimal 35.05 KiB -489 B (-1.34%) 34.92 KiB 100.44 KiB 31.61 KiB ███████████▁
solid-router.full 40.00 KiB -596 B (-1.43%) 39.88 KiB 115.45 KiB 36.03 KiB ███████████▁
vue-router.minimal 52.22 KiB -795 B (-1.46%) 52.10 KiB 143.53 KiB 47.03 KiB ███████████▁
vue-router.full 58.16 KiB -799 B (-1.32%) 58.03 KiB 162.08 KiB 52.20 KiB ███████████▁
react-start.minimal 102.23 KiB +250 B (+0.24%) 102.09 KiB 318.16 KiB 88.54 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.deferred-hydration 102.96 KiB +247 B (+0.23%) 102.12 KiB 319.54 KiB 89.33 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.full 105.57 KiB +216 B (+0.20%) 105.44 KiB 328.16 KiB 91.45 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.rsbuild.minimal 99.85 KiB +178 B (+0.17%) 99.68 KiB 312.65 KiB 86.06 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.rsbuild.minimal-iife 100.25 KiB +180 B (+0.18%) 100.09 KiB 313.59 KiB 86.50 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.rsbuild.full 103.19 KiB +301 B (+0.29%) 103.02 KiB 322.80 KiB 88.87 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-start.minimal 49.81 KiB +210 B (+0.41%) 49.68 KiB 147.83 KiB 44.16 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-start.deferred-hydration 53.08 KiB +213 B (+0.39%) 49.74 KiB 155.87 KiB 47.10 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-start.full 55.09 KiB -335 B (-0.59%) 54.96 KiB 163.62 KiB 48.65 KiB ███████████▁
vue-start.minimal 70.54 KiB -506 B (-0.70%) 70.41 KiB 200.81 KiB 62.53 KiB ███████████▁
vue-start.full 74.50 KiB -550 B (-0.72%) 74.37 KiB 213.41 KiB 66.08 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.

@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/eslint-plugin-start

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-rsc

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 887ab0a

@codspeed-hq

codspeed-hq Bot commented Jul 21, 2026

Copy link
Copy Markdown

Merging this PR will regress 14 benchmarks

⚠️ 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

⚡ 37 improved benchmarks
❌ 14 regressed benchmarks
✅ 129 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 (solid) 413.5 KB 770.9 KB -46.36%
Memory mem client preload-churn (react) 436.4 KB 803.6 KB -45.7%
Memory mem client unique-location-churn (solid) 419.9 KB 687 KB -38.87%
Memory mem server error-paths not-found (vue) 330.8 KB 501.8 KB -34.07%
Memory mem client loader-data-retention (vue) 779 KB 979.8 KB -20.49%
Memory mem server peak-large-page (vue) 728.6 KB 817.4 KB -10.86%
Memory mem server error-paths not-found (react) 251.3 KB 277 KB -9.26%
Simulation ssr request loop (solid) 146.2 ms 155.3 ms -5.83%
Simulation client-control-flow navigation loop (vue) 54 ms 56.9 ms -5.05%
Simulation ssr control-flow unmatched 404 (react) 56.9 ms 59.5 ms -4.26%
Simulation client-loaders navigation loop (solid) 79.2 ms 82.6 ms -4.16%
Memory mem server server-fn-churn (react) 273.8 KB 283.8 KB -3.53%
Memory mem server error-paths unmatched (solid) 412.4 KB 425.6 KB -3.11%
Memory mem server error-paths redirect (solid) 290.4 KB 299.7 KB -3.09%
Memory mem server server-fn-churn (vue) 3,969.9 KB 263.5 KB ×15
Memory mem server serialization-payload (solid) 6.8 MB 3.4 MB +96.61%
Memory mem client unique-location-churn (vue) 1,229.7 KB 1,001.4 KB +22.8%
Memory mem server error-paths redirect (vue) 371.7 KB 303.2 KB +22.59%
Memory mem server request-churn (solid) 481.3 KB 419.4 KB +14.77%
Memory mem client navigation-churn (solid) 673 KB 587 KB +14.65%
... ... ... ... ... ...

ℹ️ 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-router-core-lane-match-loader-followups (887ab0a) with fix-router-core-lane-match-loader (7443d96)

Open in CodSpeed

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

We investigated both e2e failures and found neither is caused by this PR's changes. The collectBrowserErrors error stems from stale build artifacts in e2e-utils/dist — a package untouched by this PR — and the port 46007 conflict is a pre-existing environment resource issue. Our recommendation is to re-run the pipeline after clearing build caches and ensuring no orphaned processes are holding the port.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@Sheraff
Sheraff merged commit 1f27102 into fix-router-core-lane-match-loader Jul 21, 2026
27 of 29 checks passed
@Sheraff
Sheraff deleted the fix-router-core-lane-match-loader-followups branch July 21, 2026 22:43
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