Skip to content

fix(router): migrate to Store 0.11.1 - #7983

Open
Sheraff wants to merge 2 commits into
mainfrom
fix/store-0.11.1-migration
Open

fix(router): migrate to Store 0.11.1#7983
Sheraff wants to merge 2 commits into
mainfrom
fix/store-0.11.1-migration

Conversation

@Sheraff

@Sheraff Sheraff commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • upgrade React, Vue, and core Store dependencies to 0.11.1
  • migrate router bindings from the deprecated useStore API to useSelector
  • preserve Vue functional-component subscription cleanup and stabilize not-found subscriptions
  • add lifecycle coverage and patch changesets for React Router and Vue Router

Tests

  • pnpm nx affected --target=test:eslint --exclude="examples/**,e2e/**"
  • pnpm nx affected --target=test:types --exclude="examples/**,e2e/**"
  • pnpm nx affected --target=test:unit --exclude="examples/**,e2e/**"

Summary by CodeRabbit

  • Bug Fixes

    • Improved router state updates across React and Vue applications.
    • Preserved reliable subscription cleanup for Vue functional components.
    • Fixed repeated subscriptions when navigating between multiple not-found routes.
    • Maintained server-side rendering behavior and existing route, location, and status selection.
    • Updated store integration for improved compatibility and consistent selector behavior.
  • Tests

    • Added coverage for selector lifecycle management, rerendering, unmount cleanup, and not-found navigation scenarios.

@socket-security

socket-security Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​tanstack/​vue-store@​0.9.3 ⏵ 0.11.197 +110067 +293 +6100
Updated@​tanstack/​react-store@​0.9.3 ⏵ 0.11.110010069 +388100
Updated@​tanstack/​store@​0.9.3 ⏵ 0.11.11001007188100

View full report

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 103c87ca-9e5b-4655-9123-64f3b6f6c412

📥 Commits

Reviewing files that changed from the base of the PR and between fd18c59 and 4d6a83f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • packages/react-router/package.json
  • packages/react-router/src/link.tsx
  • packages/router-core/package.json
  • packages/vue-router/package.json
  • packages/vue-router/src/Scripts.tsx
  • packages/vue-router/src/link.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/vue-router/package.json
  • packages/vue-router/src/Scripts.tsx
  • packages/react-router/package.json
  • packages/router-core/package.json
  • packages/react-router/src/link.tsx
  • packages/vue-router/src/link.tsx

📝 Walkthrough

Walkthrough

TanStack Store dependencies move to version 0.11.1. React Router replaces useStore with useSelector. Vue Router adds a scoped selector wrapper, migrates router subscriptions, and adds lifecycle regression tests.

Changes

Store selector migration

Layer / File(s) Summary
React selector adoption
.changeset/*, packages/react-router/package.json, packages/router-core/package.json, packages/react-router/src/*, pnpm-workspace.yaml
React Router uses useSelector for router, match, location, status, and link subscriptions. Existing selectors and comparison behavior remain in place. Store dependencies use version 0.11.1.
Vue selector lifecycle
packages/vue-router/package.json, packages/vue-router/src/useSelector.ts, packages/vue-router/tests/useSelector.test.tsx
Vue Router adds useSelector with effect-scope recreation and cleanup. Tests verify subscription replacement, updates, and unmount cleanup.
Vue Router selector adoption
packages/vue-router/src/{Match,Matches,Scripts,headContentUtils,link,not-found,useCanGoBack,useLocation,useMatch,useRouterState}.*, packages/vue-router/tests/not-found.test.tsx
Vue Router components and hooks use the local selector wrapper. Not-found handling preserves error and fallback behavior. Navigation tests verify that location subscriptions remain stable.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • TanStack/router#7952 — Both changes update location-store selector usage in packages/react-router/src/link.tsx.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: migrating router integrations to Store 0.11.1.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/store-0.11.1-migration

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.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 0a79fcf2c472
  • Measured at: 2026-08-06T14:54:28.742Z
  • Baseline source: history:abf9b81b1f14
  • 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 86.79 KiB -121 B (-0.14%) 86.66 KiB 267.38 KiB 75.54 KiB █▅▅▅▅▅▅▅▂▂▂▁
react-router.full 90.60 KiB -99 B (-0.11%) 90.46 KiB 279.35 KiB 78.86 KiB █▆▆▆▆▆▅▅▂▂▂▁
vue-router.minimal 51.63 KiB -214 B (-0.40%) 51.50 KiB 140.97 KiB 46.52 KiB █▄▄▄▄▄▃▃▂▂▂▁
vue-router.full 57.54 KiB -205 B (-0.35%) 57.41 KiB 159.55 KiB 51.77 KiB █▄▄▄▄▄▄▄▂▂▂▁
react-start.minimal 100.23 KiB -133 B (-0.13%) 100.09 KiB 310.50 KiB 87.08 KiB ████▃▃▂▂▂▂▂▁
react-start.deferred-hydration 100.97 KiB -136 B (-0.13%) 100.12 KiB 311.87 KiB 87.72 KiB ████▃▃▂▂▂▂▂▁
react-start.full 103.58 KiB -171 B (-0.16%) 103.44 KiB 320.44 KiB 89.98 KiB ████▂▂▂▂▂▂▂▁
react-start.rsbuild.minimal 99.80 KiB -136 B (-0.13%) 99.63 KiB 314.97 KiB 86.05 KiB ▁▂▂▂████▄▄▄▂
react-start.rsbuild.minimal-iife 100.21 KiB -135 B (-0.13%) 100.04 KiB 315.90 KiB 86.40 KiB ▁▂▂▂████▄▄▄▂
react-start.rsbuild.full 103.12 KiB -126 B (-0.12%) 102.95 KiB 325.05 KiB 88.89 KiB ▁▃▃▃████▄▄▄▃
vue-start.minimal 68.46 KiB -169 B (-0.24%) 68.33 KiB 192.82 KiB 60.92 KiB █▆▆▆▃▃▂▂▁▁▁▁
vue-start.full 72.50 KiB -114 B (-0.15%) 72.37 KiB 205.33 KiB 64.28 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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/vue-router/tests/not-found.test.tsx`:
- Around line 152-156: Update the not-found navigation test to await Vue’s next
rendering tick after the second router.navigate call and before asserting
subscribe. Use the existing nextTick utility so the assertion observes the
completed second not-found render and subscription lifecycle.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 03c759cb-1eba-47f6-a6e1-051fff3f1a4c

📥 Commits

Reviewing files that changed from the base of the PR and between 697ebb6 and fd18c59.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (28)
  • .changeset/warm-stores-select.md
  • packages/react-router/package.json
  • packages/react-router/src/Match.tsx
  • packages/react-router/src/Matches.tsx
  • packages/react-router/src/Scripts.tsx
  • packages/react-router/src/headContentUtils.tsx
  • packages/react-router/src/link.tsx
  • packages/react-router/src/not-found.tsx
  • packages/react-router/src/useCanGoBack.ts
  • packages/react-router/src/useLocation.tsx
  • packages/react-router/src/useMatch.tsx
  • packages/react-router/src/useRouterState.tsx
  • packages/router-core/package.json
  • packages/vue-router/package.json
  • packages/vue-router/src/Match.tsx
  • packages/vue-router/src/Matches.tsx
  • packages/vue-router/src/Scripts.tsx
  • packages/vue-router/src/headContentUtils.tsx
  • packages/vue-router/src/link.tsx
  • packages/vue-router/src/not-found.tsx
  • packages/vue-router/src/useCanGoBack.ts
  • packages/vue-router/src/useLocation.tsx
  • packages/vue-router/src/useMatch.tsx
  • packages/vue-router/src/useRouterState.tsx
  • packages/vue-router/src/useSelector.ts
  • packages/vue-router/tests/not-found.test.tsx
  • packages/vue-router/tests/useSelector.test.tsx
  • pnpm-workspace.yaml

Comment on lines +152 to +156
await router.navigate({ to: '/missing-one' as any })
await screen.findByTestId('root-not-found')
await router.navigate({ to: '/missing-two' as any })

expect(subscribe).toHaveBeenCalledOnce()

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Wait for the second Vue update before the assertion.

The assertion can run before Vue processes the second location change. Add await nextTick() after the second router.navigate call. This makes the test exercise the subscription lifecycle during the second not-found render.

Proposed fix
+import { nextTick } from 'vue'
+
 await router.navigate({ to: '/missing-two' as any })
+await nextTick()

 expect(subscribe).toHaveBeenCalledOnce()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
await router.navigate({ to: '/missing-one' as any })
await screen.findByTestId('root-not-found')
await router.navigate({ to: '/missing-two' as any })
expect(subscribe).toHaveBeenCalledOnce()
import { nextTick } from 'vue'
await router.navigate({ to: '/missing-one' as any })
await screen.findByTestId('root-not-found')
await router.navigate({ to: '/missing-two' as any })
await nextTick()
expect(subscribe).toHaveBeenCalledOnce()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vue-router/tests/not-found.test.tsx` around lines 152 - 156, Update
the not-found navigation test to await Vue’s next rendering tick after the
second router.navigate call and before asserting subscribe. Use the existing
nextTick utility so the assertion observes the completed second not-found render
and subscription lifecycle.

@nx-cloud

nx-cloud Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 4d6a83f

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

☁️ Nx Cloud last updated this comment at 2026-08-06 15:13:40 UTC

@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/eslint-plugin-start

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-rsc

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 4d6a83f

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

2 package(s) bumped directly, 7 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/react-router 1.170.21 → 1.170.22 Changeset
@tanstack/vue-router 1.170.20 → 1.170.21 Changeset
@tanstack/react-start 1.168.38 → 1.168.39 Dependent
@tanstack/react-start-client 1.168.19 → 1.168.20 Dependent
@tanstack/react-start-rsc 0.1.37 → 0.1.38 Dependent
@tanstack/react-start-server 1.167.26 → 1.167.27 Dependent
@tanstack/vue-start 1.168.36 → 1.168.37 Dependent
@tanstack/vue-start-client 1.167.22 → 1.167.23 Dependent
@tanstack/vue-start-server 1.167.26 → 1.167.27 Dependent

@codspeed-hq

codspeed-hq Bot commented Aug 6, 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

⚡ 42 improved benchmarks
❌ 7 regressed benchmarks
✅ 118 untouched benchmarks
⏩ 13 skipped benchmarks1

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) 416.9 KB 774.8 KB -46.19%
Memory mem client interrupted-navigations (vue) 501.8 KB 763 KB -34.22%
Memory mem client unique-location-churn (solid) 342.1 KB 519 KB -34.08%
Memory mem server error-paths unmatched (react) 263.2 KB 396.8 KB -33.67%
Memory mem server peak-large-page (solid) 788.1 KB 951.6 KB -17.18%
Simulation ssr control-flow route headers (react) 85 ms 88.9 ms -4.43%
Memory mem server error-paths error (vue) 888.3 KB 923.6 KB -3.82%
Memory mem client unique-location-churn (vue) 1,003.9 KB 376.5 KB ×2.7
Memory mem client navigation-churn (vue) 1,237.3 KB 549.6 KB ×2.3
Memory mem server request-churn (react) 940 KB 482.2 KB +94.93%
Simulation client-links navigation loop (vue) 163.2 ms 113.2 ms +44.17%
Simulation client-nested-params navigation loop (vue) 144.9 ms 108.3 ms +33.86%
Simulation client-head navigation loop (vue) 88 ms 66.8 ms +31.74%
Simulation client-search-params navigation loop (vue) 80.3 ms 61.6 ms +30.49%
Simulation ssr server-fn during document ssr (vue) 202.1 ms 157.2 ms +28.53%
Simulation ssr dehydrate plain control (vue) 190.8 ms 148.6 ms +28.34%
Simulation client-side navigation loop (vue) 70.2 ms 54.8 ms +28.22%
Simulation ssr assets inline-css cdn (vue) 222.5 ms 176.1 ms +26.33%
Simulation ssr head (vue) 382.7 ms 308.5 ms +24.05%
Simulation client-preload interaction loop (vue) 63 ms 51 ms +23.59%
... ... ... ... ... ...

ℹ️ 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/store-0.11.1-migration (4d6a83f) with main (abf9b81)

Open in CodSpeed

Footnotes

  1. 13 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.

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