Skip to content

Comments

fix(router-core): tanstack/store v0.9 requires createStore instead of new Store#6759

Merged
Sheraff merged 1 commit intomainfrom
fix-router-core-store-migration-factory
Feb 25, 2026
Merged

fix(router-core): tanstack/store v0.9 requires createStore instead of new Store#6759
Sheraff merged 1 commit intomainfrom
fix-router-core-store-migration-factory

Conversation

@Sheraff
Copy link
Contributor

@Sheraff Sheraff commented Feb 25, 2026

Fix a minor migration issue where new Store() should now be createStore(). In practice this does not change anything (same code being called under the hood). It's only to better align Router with the new public API of Store.

Summary by CodeRabbit

  • Refactor
    • Updated internal store initialization pattern to use a factory function approach, improving code maintainability while preserving existing server and non-server initialization paths.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

The pull request replaces the Store constructor with a createStore factory function for initializing the internal router store. Import statements and initialization logic in both server and non-server code paths are updated accordingly, with Store added as a type-only import.

Changes

Cohort / File(s) Summary
Store initialization refactoring
packages/router-core/src/router.ts
Replaced direct Store constructor calls with createStore factory function; updated imports to use createStore and added Store as type-only import; both server and non-server initialization paths updated.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

package: router-core

Suggested reviewers

  • brenelz
  • birkskyum

Poem

🐰 A factory springs forth, oh what delight!
No more constructors cluttering the night,
createStore hops in, so clean and so bright,
The router's store initialization feels right!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately describes the main change: migrating from using 'new Store' to 'createStore' due to tanstack/store v0.9 requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-router-core-store-migration-factory

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

@nx-cloud
Copy link

nx-cloud bot commented Feb 25, 2026

View your CI Pipeline Execution ↗ for commit 04cf5d1

Command Status Duration Result
nx run tanstack-router-e2e-bundle-size:build --... ✅ Succeeded 1m 29s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-25 07:37:32 UTC

@github-actions
Copy link

Bundle Size Benchmarks

  • Commit: e374f6ef066a
  • Measured at: 2026-02-25T07:27:43.698Z
  • Baseline source: history:c099ebf204bb
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 86.57 KiB +37 B (+0.04%) 272.38 KiB 75.30 KiB ██▁▁▁▁▁▁▁▁▁▃
react-router.full 89.60 KiB +47 B (+0.05%) 282.71 KiB 77.92 KiB ██▁▁▁▁▁▁▁▁▁▃
solid-router.minimal 35.87 KiB +24 B (+0.07%) 107.49 KiB 32.26 KiB ██▁▁▁▁▁▃▃▃▃▄
solid-router.full 40.20 KiB +24 B (+0.06%) 120.54 KiB 36.11 KiB ██▁▁▂▂▂▃▃▃▃▄
vue-router.minimal 51.74 KiB +31 B (+0.06%) 147.46 KiB 46.49 KiB ██▁▁▂▂▂▄▄▄▄▅
vue-router.full 56.53 KiB +20 B (+0.03%) 163.05 KiB 50.80 KiB ██▁▁▁▁▁▂▂▂▂▃
react-start.minimal 99.10 KiB +21 B (+0.02%) 311.51 KiB 85.70 KiB ▆█▁▁▁▁▁▁▁▁▁▂
react-start.full 102.47 KiB +53 B (+0.05%) 321.29 KiB 88.61 KiB ▆█▁▁▁▁▁▁▁▁▁▃
solid-start.minimal 48.18 KiB +25 B (+0.05%) 145.06 KiB 42.59 KiB ▅█▁▁▂▂▂▃▃▃▃▄
solid-start.full 53.66 KiB +41 B (+0.07%) 160.97 KiB 47.34 KiB ▆█▁▁▁▁▁▃▃▃▃▄

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 25, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@6759

@tanstack/eslint-plugin-router

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

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@6759

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@6759

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@6759

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@6759

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@6759

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@6759

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@6759

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@6759

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-fn-stubs@6759

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@6759

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@6759

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@6759

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@6759

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@6759

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@6759

@tanstack/vue-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-client@6759

@tanstack/vue-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-server@6759

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@6759

commit: 04cf5d1

@Sheraff Sheraff merged commit 6b42138 into main Feb 25, 2026
8 checks passed
@Sheraff Sheraff deleted the fix-router-core-store-migration-factory branch February 25, 2026 08:23
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