Skip to content

Adapter-injected router stores (no core default) + native Solid stores#6730

Merged
Sheraff merged 25 commits intorefactor-signalsfrom
codex/solid-native-router-stores
Mar 4, 2026
Merged

Adapter-injected router stores (no core default) + native Solid stores#6730
Sheraff merged 25 commits intorefactor-signalsfrom
codex/solid-native-router-stores

Conversation

@Sheraff
Copy link
Copy Markdown
Contributor

@Sheraff Sheraff commented Feb 22, 2026

Use solid native reactivity instead of tanstack/solid-store

  • 👍 less bundle size
  • 👎 less performant

Client-side re-render perf

benchmark: how much time does it take to navigate 100 times on a re-render heavy page

React Candidate Trial 1 (ms) Trial 2 (ms) Trial 3 (ms) Avg mean (ms) Avg p95 (ms) Delta vs main Speedup vs main
solid-native 301.653 292.708 283.558 292.640 339.973 55.38% lower 2.24x
remove-pending 501.595 492.377 485.725 493.232 539.158 24.80% lower 1.33x
main 655.490 653.835 658.392 655.906 702.458 baseline 1.00x
Solid Candidate Trial 1 (ms) Trial 2 (ms) Trial 3 (ms) Avg mean (ms) Avg p95 (ms) Delta vs main Speedup vs main
solid-native 460.692 463.710 461.967 462.123 502.810 27.03% lower 1.37x
main 632.578 635.865 631.480 633.308 671.553 baseline 1.00x
remove-pending 971.830 973.362 968.883 971.358 1016.510 53.38% higher 0.65x
Vue Candidate Trial 1 (ms) Trial 2 (ms) Trial 3 (ms) Avg mean (ms) Avg p95 (ms) Delta vs main Speedup vs main
solid-native 304.050 301.060 304.827 303.312 310.670 65.59% lower 2.91x
main 881.023 872.740 890.505 881.423 904.465 baseline 1.00x
remove-pending N/A N/A N/A N/A N/A N/A N/A

Bundle-size changes

branch react-router.minimal react-router.full solid-router.minimal solid-router.full
solid-native +933 B +1.12 KiB -1.08 KiB -830 B
remove-pending +40 B +85 B +158 B +166 B

SSR performance

100-links autocannon test

10 connections

Candidate Median Req/s Median Throughput (KiB/s) Median p99 Latency (ms)
main 5341.47 4225.33 2.00
remove-pending 5326.27 4213.33 2.00
solid-native 5318.14 4206.23 2.00

100 connections

Candidate Median req/s Median throughput (KiB/s) Median p99 (ms)
remove-pending 5238.54 4142.97 40.00
main 5222.54 4130.97 40.00
solid-native 5214.67 4124.57 41.00

Summary

  • Remove the default router store implementation from router-core and require adapters to inject a RouterStoresFactory.
  • Keep the core store contract minimal (.state + .setState) and adapter-agnostic.
  • Add explicit adapter store factories:
    • React + Vue use @tanstack/*-store through adapter-local routerStores.ts.
    • Solid uses native Solid signals/memos and adapter-local batching.
  • Remove @tanstack/store runtime dependency from router-core.
  • Remove @tanstack/solid-store runtime dependency from solid-router.
  • Update router-core tests to construct RouterCore with an injected test store factory.

Key Files

  • packages/router-core/src/stores.ts
  • packages/router-core/src/router.ts
  • packages/router-core/src/index.ts
  • packages/react-router/src/router.ts
  • packages/react-router/src/routerStores.ts
  • packages/vue-router/src/router.ts
  • packages/vue-router/src/routerStores.ts
  • packages/solid-router/src/router.ts
  • packages/solid-router/src/routerStores.ts
  • packages/solid-router/src/store.ts

Validation

Passed:

  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/router-core:test:types --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/router-core: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:unit --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/vue-router:test:types --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/vue-router:test:unit --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/solid-router:test:types --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/solid-router:test:unit --outputStyle=stream --skipRemoteCache

Not clean yet:

  • CI=1 NX_DAEMON=false pnpm nx run @tanstack/react-router:test:eslint --outputStyle=stream --skipRemoteCache
    • Fails with import-order and hooks-order lint errors in the adapted React files.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 22, 2026

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: 1ac83d02-cb4b-454a-a10e-d8cb2fcca695

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
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/solid-native-router-stores

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

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Feb 22, 2026

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit a6b9bf0

Command Status Duration Result
nx run @benchmarks/client-nav:test:perf:solid ❌ Failed 1m 16s View ↗
nx run @benchmarks/ssr:test:perf:vue ✅ Succeeded 2m 16s View ↗
nx run @benchmarks/ssr:test:perf:solid ✅ Succeeded 1m 52s View ↗
nx run @benchmarks/ssr:test:perf:react ✅ Succeeded 2m 3s View ↗
nx run @benchmarks/client-nav:test:perf:vue ✅ Succeeded 1m 22s View ↗
nx run @benchmarks/client-nav:test:perf:react ✅ Succeeded 1m 21s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-04 21:36:27 UTC

@Sheraff Sheraff marked this pull request as draft February 22, 2026 11:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 22, 2026

Bundle Size Benchmarks

  • Commit: 861f319bbeb8
  • Measured at: 2026-03-04T21:22:38.209Z
  • Baseline source: history:9c81d5ac571e
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 87.50 KiB +673 B (+0.76%) 275.62 KiB 76.04 KiB ▁▁▁▁▁▁▁▁▁▁▃█
react-router.full 90.73 KiB +865 B (+0.94%) 286.31 KiB 78.73 KiB ▁▁▁▁▁▁▁▁▁▁▃█
solid-router.minimal 34.83 KiB -1.34 KiB (-3.71%) 105.25 KiB 31.22 KiB ▆▆▆▆▆▆▆▆▆▆█▁
solid-router.full 39.47 KiB -1.03 KiB (-2.54%) 119.49 KiB 35.34 KiB ▆▆▆▆▆▆▆▆▆▆█▁
vue-router.minimal 52.75 KiB +732 B (+1.37%) 151.06 KiB 47.33 KiB ▁▁▁▁▁▁▁▁▁▁▃█
vue-router.full 57.82 KiB +999 B (+1.72%) 167.13 KiB 51.61 KiB ▁▁▁▁▁▁▁▁▁▁▃█
react-start.minimal 100.16 KiB +777 B (+0.76%) 314.79 KiB 86.52 KiB ▁▁▁▁▁▁▁▁▁▁▃█
react-start.full 103.51 KiB +743 B (+0.71%) 324.96 KiB 89.45 KiB ▁▁▁▁▁▁▁▁▁▁▃█
solid-start.minimal 47.17 KiB -1.33 KiB (-2.74%) 142.86 KiB 41.62 KiB ▆▆▆▆▆▆▆▆▆▆█▁
solid-start.full 52.89 KiB -1.07 KiB (-1.99%) 159.99 KiB 46.59 KiB ▆▆▆▆▆▆▆▆▆▆█▁

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 22, 2026

More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: a936111

@Sheraff Sheraff marked this pull request as ready for review February 23, 2026 10:30
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 3, 2026

Merging this PR will improve performance by 13.53%

⚡ 1 improved benchmark
✅ 4 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
client-side navigation loop (vue) 49.4 ms 43.5 ms +13.53%

Comparing codex/solid-native-router-stores (a6b9bf0) with refactor-signals (3b5314b)

Open in CodSpeed

@Sheraff Sheraff merged commit e394618 into refactor-signals Mar 4, 2026
7 of 8 checks passed
@Sheraff Sheraff deleted the codex/solid-native-router-stores branch March 4, 2026 21:20
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