Skip to content

Fix default route component remounting - #8002

Draft
Sheraff wants to merge 2 commits into
mainfrom
codex/fix-default-route-remounting
Draft

Fix default route component remounting#8002
Sheraff wants to merge 2 commits into
mainfrom
codex/fix-default-route-remounting

Conversation

@Sheraff

@Sheraff Sheraff commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep active Solid route components mounted by default by falling back to stable route identity
  • key Vue child matches by route ID instead of route ID plus serialized params
  • cache Vue Link inputs reactively so persistent route components see new params without per-location proxy/ref work
  • add public-API regression tests covering both default persistence and explicit param-based remounting

Root cause

Solid used the changing match ID as its implicit component key when no remountDeps function was configured. Vue independently included serialized strict params in the child Match key. Both identities changed during param-only navigation and forced active route components to unmount and mount again, contrary to the documented default.

Removing Vue's implicit param key exposed a separate assumption in Link: it copied declared props during setup and therefore relied on its parent remounting to receive param-derived values. The first correctness fix kept those props live with proxyRefs({ ...toRefs(props), ...attrs }).

That proxy was also the source of the broad Vue CPU regressions. Link has several location-driven computed values, and every navigation caused each Link to repeatedly cross the proxy and unwrap refs. Link-heavy scenarios amplified that fixed per-Link cost, which is why otherwise unrelated Vue navigation simulations moved together.

The follow-up keeps correctness with a computed plain snapshot. The snapshot rebuilds only when Link inputs change; location-only updates reuse the cached object.

Impact

Param-only navigation now preserves component instances and local state by default in Solid and Vue, avoiding unnecessary lifecycle work and garbage collection. Applications can continue to opt into remounting with remountDeps.

The focused Vue links benchmark recovered from 31.04 ms with the proxy/ref implementation to 17.15 ms (±1.13%). A controlled run with the old non-reactive plain spread was 17.46 ms, so the cached reactive version is back at the prior CPU cost while retaining correct updates in reused components.

Validation

  • public-API Link and remount regression tests: 133 passed
  • Vue unit suite: 829 passed, 1 skipped, no type errors
  • Solid client suite: 851 passed, 1 skipped, no type errors
  • Solid server suite: 3 passed, no type errors
  • dedicated Vue and Solid type targets across supported TypeScript versions
  • dedicated Vue and Solid ESLint targets (0 errors)
  • CI=1 NX_DAEMON=false pnpm nx run @benchmarks/client-nav:test:perf:vue --outputStyle=stream --skipRemoteCache -- scenarios/links/vue/speed.bench.ts
  • Prettier and git diff --check

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

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: 298979b8-1426-4cdd-94d9-60b3da76efd7

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 8, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 9cb14ab

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

☁️ Nx Cloud last updated this comment at 2026-08-08 09:40:04 UTC

@github-actions

github-actions Bot commented Aug 8, 2026

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 Aug 8, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 22437993c90f
  • Measured at: 2026-08-08T09:34:28.181Z
  • Baseline source: history:c568caf3f376
  • 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
solid-router.minimal 33.21 KiB -6 B (-0.02%) 33.09 KiB 96.45 KiB 29.96 KiB █████████▁▁▁
solid-router.full 38.05 KiB +2 B (+0.01%) 37.93 KiB 111.09 KiB 34.25 KiB █████████▁▁▁
vue-router.minimal 49.51 KiB +19 B (+0.04%) 49.39 KiB 138.27 KiB 44.65 KiB █████████▁▁▁
vue-router.full 55.10 KiB +27 B (+0.05%) 54.98 KiB 156.47 KiB 49.58 KiB █████████▁▁▁
solid-start.minimal 45.94 KiB -2 B (-0.00%) 45.81 KiB 137.46 KiB 40.90 KiB █████████▁▁▁
solid-start.deferred-hydration 49.01 KiB +1 B (+0.00%) 45.87 KiB 144.92 KiB 43.70 KiB █████████▁▁▁
vue-start.minimal 65.51 KiB +22 B (+0.03%) 65.38 KiB 189.03 KiB 58.27 KiB █████████▁▁▁
vue-start.full 69.33 KiB +43 B (+0.06%) 69.20 KiB 201.34 KiB 61.58 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 Aug 8, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/eslint-plugin-start

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-rsc

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 9cb14ab

@codspeed-hq

codspeed-hq Bot commented Aug 8, 2026

Copy link
Copy Markdown

Merging this PR will regress 7 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

⚡ 16 improved benchmarks
❌ 7 regressed benchmarks
✅ 157 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 unmatched (react) 263.6 KB 411.3 KB -35.9%
Simulation client-rewrites navigation loop (vue) 48.1 ms 68.3 ms -29.66%
Simulation client-history navigation loop (vue) 41.1 ms 51.1 ms -19.59%
Simulation ssr dehydrate rich types (solid) 87.3 ms 99.8 ms -12.47%
Simulation ssr dehydrate plain control (solid) 119.6 ms 129.5 ms -7.68%
Simulation client-mount loop (vue) 57.9 ms 60.5 ms -4.27%
Memory mem server error-paths not-found (vue) 318.6 KB 329.5 KB -3.31%
Memory mem client unique-location-churn (vue) 984 KB 384.6 KB ×2.6
Memory mem server error-paths redirect (solid) 588.2 KB 283.5 KB ×2.1
Memory mem client loader-data-retention (vue) 982.1 KB 641 KB +53.22%
Simulation client-nested-params navigation loop (vue) 144.8 ms 96.3 ms +50.4%
Memory mem client interrupted-navigations (vue) 499.5 KB 340.9 KB +46.51%
Memory mem client unique-location-churn (solid) 341.6 KB 236.2 KB +44.66%
Memory mem client interrupted-navigations (solid) 341.5 KB 242.8 KB +40.63%
Memory mem client loader-data-retention (solid) 154.1 KB 141.9 KB +8.66%
Simulation client-loaders navigation loop (vue) 57.1 ms 52.8 ms +8.26%
Simulation client-history navigation loop (solid) 53.8 ms 49.9 ms +7.73%
Simulation client-search-params navigation loop (solid) 114.8 ms 108 ms +6.28%
Simulation client-rewrites navigation loop (solid) 76.3 ms 73 ms +4.52%
Memory mem client navigation-churn (vue) 1.2 MB 1.2 MB +4.43%
... ... ... ... ... ...

ℹ️ 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 codex/fix-default-route-remounting (9cb14ab) with main (c568caf)

Open in CodSpeed

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