Skip to content

feat: update @tanstack/store to v9#6180

Open
riccardoperra wants to merge 4 commits intoalphafrom
tanstack-store-update
Open

feat: update @tanstack/store to v9#6180
riccardoperra wants to merge 4 commits intoalphafrom
tanstack-store-update

Conversation

@riccardoperra
Copy link
Collaborator

@riccardoperra riccardoperra commented Feb 23, 2026

Summary by CodeRabbit

Release Notes

  • Chores

    • Updated TanStack store dependencies across React, Angular, Preact, Vue, and Svelte table packages to newer compatible versions.
  • Refactor

    • Migrated store instantiation from class-based constructors to factory function API.
    • Simplified store type definitions to improve clarity.
    • Adjusted store lifecycle initialization and state synchronization across framework integrations.

@changeset-bot
Copy link

changeset-bot bot commented Feb 23, 2026

⚠️ No Changeset found

Latest commit: 6eaa741

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 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.

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
📝 Walkthrough

Walkthrough

The PR updates TanStack store dependencies across multiple packages and examples from v0.8/0.9/0.10 to v0.9/0.10/0.11, migrating from class-based Store constructors to createStore factory functions, removing automatic mount/cleanup lifecycle effects in framework integrations, and updating store type declarations from Derived to ReadonlyStore.

Changes

Cohort / File(s) Summary
Dependency Updates - React Examples
examples/react/basic-external-state/package.json, examples/react/basic-external-store/package.json, examples/react/composable-tables/package.json, examples/react/pagination/package.json, examples/react/row-selection/package.json, examples/react/with-tanstack-query/package.json
Bump @tanstack/react-store from ^0.8.0 to ^0.9.1.
Dependency Updates - Framework Packages
packages/angular-table/package.json, packages/preact-table/package.json, packages/react-table/package.json, packages/svelte-table/package.json, packages/table-core/package.json, packages/vue-table/package.json
Bump store dependencies: @tanstack/angular-store, @tanstack/react-store, @tanstack/preact-store, @tanstack/svelte-store, @tanstack/store, @tanstack/vue-store to v0.9.1–0.10.1 ranges.
Store Constructor Migration
examples/react/basic-external-store/src/main.tsx, examples/react/with-tanstack-query/src/main.tsx, packages/table-core/src/core/table/constructTable.ts
Replace Store constructor calls with createStore factory function; update imports accordingly.
Mount/Cleanup Effect Removal
packages/angular-table/src/injectTable.ts, packages/preact-table/src/useTable.ts, packages/react-table/src/useTable.ts
Remove useIsomorphicLayoutEffect/effect blocks that called table.store.mount() and returned cleanup functions, eliminating automatic mount/cleanup lifecycle behavior.
Type System Updates
packages/table-core/src/core/table/coreTablesFeature.types.ts, packages/table-core/src/types/Table.ts
Replace Derived import and type annotations with ReadonlyStore for table.store declarations.
State Update Path Changes
packages/table-core/src/core/table/coreTablesFeature.utils.ts, packages/vue-table/src/useTable.ts
Update state mutations: use functional setState in reset logic; route data changes through baseStore instead of derived store in Vue.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • KevinVandy

Poem

🐰 The store hops forth with factory cheer,
No longer constructors bound here!
Mounts fade away like morning dew,
ReadonlyStore—the type shines through!
A hop, a skip, the APIs align,
TanStack tables refined and fine! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is completely missing. The author has not provided any description of the changes, despite the template requiring sections for '🎯 Changes' and '✅ Checklist' and '🚀 Release Impact'. Add a detailed description following the template: explain the changes made (dependency update, API migration, lifecycle changes), confirm testing with 'pnpm test:pr', and indicate whether a changeset was generated for the release.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: update @tanstack/store to v9' clearly and concisely summarizes the main change: upgrading the @tanstack/store dependency to version 9 across multiple packages and examples.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tanstack-store-update

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 and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Feb 23, 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 6eaa741

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ❌ Failed 1m 12s View ↗
nx run-many --targets=build -p @tanstack/table-... ✅ Succeeded 7s View ↗

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

@riccardoperra riccardoperra force-pushed the tanstack-store-update branch 4 times, most recently from 76afcc2 to 86199dc Compare February 23, 2026 20:57
@riccardoperra riccardoperra marked this pull request as ready for review February 24, 2026 12:20
@riccardoperra
Copy link
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/vue-table/src/useTable.ts (1)

116-123: ⚠️ Potential issue | 🟠 Major

Watch source must unwrap the ref to track data value changes (Line 117).

When tableOptions.data is a ref (as indicated by IS_REACTIVE), watch(() => tableOptions.data) watches the ref object identity rather than its .value. The watcher won't fire when data mutations occur, preventing table state updates. Use unref() to unwrap the ref in the watch source so Vue tracks the actual value changes.

🔧 Suggested fix
    watch(
-      () => tableOptions.data,
+      () => unref(tableOptions.data),
       () => {
         table.baseStore.setState((prev: TableState<TFeatures>) => ({
           ...prev,
           data: unref(tableOptions.data),
         }))
       },
       { immediate: true },
    )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vue-table/src/useTable.ts` around lines 116 - 123, The watcher is
currently observing the ref object identity (watch(() => tableOptions.data)) so
it won't react to changes to the ref's value; update the watch source to unwrap
the ref by using unref(tableOptions.data) (e.g., watch(() =>
unref(tableOptions.data), ...)) so Vue tracks value changes and
table.baseStore.setState((prev: TableState<TFeatures>) => ({ ...prev, data:
unref(tableOptions.data) })) runs when the data value changes.
examples/react/basic-external-store/package.json (1)

1-28: ⚠️ Potential issue | 🟠 Major

CI pipeline failure: bundle size limit exceeded — must be resolved before merge.

The size-limit check reports +541 B over the 16 kB cap (actual 16.54 kB). Likely caused by additional symbols (createStore, ReadonlyStore) pulled in from @tanstack/react-store ^0.9.1. Either tree-shake the extra imports or raise the size-limit threshold in the project configuration to accommodate the new version.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/react/basic-external-store/package.json` around lines 1 - 28, CI is
failing due to bundle size exceeding the 16KB cap after bumping
`@tanstack/react-store` — locate usages of createStore and ReadonlyStore (and any
other `@tanstack/react-store` imports) in the example code and remove/replace
unused imports or refactor to import only the specific symbols you need so
tree-shaking can eliminate extras; if the new store API truly increases the
minimal bundle size, update the size-limit threshold in the project
configuration to a higher value that reflects the new baseline instead of
keeping the previous 16 KB cap.
examples/react/with-tanstack-query/src/main.tsx (1)

52-56: ⚠️ Potential issue | 🟡 Minor

Module-level singleton store — note SSR and test isolation implications.

Moving myTableStore from inside React.useState (as done in basic-external-store) to module scope means the store is shared across all re-mounts, HMR cycles, and test runs. For this single-page demo it's harmless, but consumers copying this pattern into SSR contexts (TanStack Start, Next.js) will leak pagination state across requests.

The basic-external-store example intentionally scopes the store per component instance — consider aligning or adding a comment clarifying this is intentionally a per-page singleton.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/react/with-tanstack-query/src/main.tsx` around lines 52 - 56,
myTableStore is created at module scope which makes it a singleton across
mounts, HMR and tests; either move the store creation into the component (e.g.,
create it inside the component that used to call React.useState so each instance
gets its own createStore(getInitialTableState(...))) or, if you intentionally
want a single-page/global store, add a clear comment above the myTableStore
declaration explaining this is an intentional per-app singleton and warning
about SSR and test isolation (reference createStore, getInitialTableState and
the basic-external-store example for the per-instance pattern).
♻️ Duplicate comments (6)
examples/react/with-tanstack-query/package.json (1)

16-16: LGTM — size limit failure already flagged.

Consistent bump to ^0.9.1. Pipeline failure is a duplicate of the one already flagged.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/react/with-tanstack-query/package.json` at line 16, The PR updated
the dependency version for "@tanstack/react-store" to "^0.9.1" which is fine;
the pipeline size-limit failure is a duplicate of an already flagged issue and
does not require further changes to the package.json entry. Leave the
"@tanstack/react-store": "^0.9.1" line as-is and do not modify other
dependencies or add duplicate fixes for the same size-limit failure; if you need
to address the pipeline failure separately, create a distinct follow-up change
rather than altering this dependency bump.
packages/table-core/package.json (1)

58-58: LGTM — size limit failure already flagged.

Root dependency bump aligns with the rest of the PR. Pipeline failure is a duplicate of the one already flagged on the example packages.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/table-core/package.json` at line 58, The dependency bump of
"@tanstack/store" to "^0.9.1" in package.json is fine; the CI size-limit failure
is a duplicate already flagged in the example packages, so leave the root
dependency change as-is (do not revert) and ensure any follow-up fixes are
applied in the example packages where the original size-limit failure was
flagged rather than in this package.json change; reference the package.json
entry for "@tanstack/store" when verifying no further edits are needed.
examples/react/basic-external-state/package.json (1)

15-15: LGTM — size limit failure already flagged.

Consistent bump to ^0.9.1. Pipeline failure is a duplicate of the one already flagged.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/react/basic-external-state/package.json` at line 15, The dependency
line for "@tanstack/react-store" was consistently bumped to "^0.9.1" and the
pipeline failure is a duplicate; leave the package.json dependency entry
"@tanstack/react-store": "^0.9.1" as-is (do not revert or change the version),
and re-run CI / ignore the redundant size-limit failure already reported rather
than making further edits to this dependency line.
packages/react-table/package.json (1)

54-54: LGTM — size limit failure already flagged.

Consistent bump to ^0.9.1. The latest published version of @tanstack/react-store is 0.9.1, so this pins to the correct release. Pipeline failure is a duplicate of the one already flagged.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react-table/package.json` at line 54, The dependency entry for
"@tanstack/react-store" has been bumped to "^0.9.1" and the review indicates
this is correct; ensure the package.json dependency remains as
"@tanstack/react-store": "^0.9.1", update the lockfile (npm/yarn/pnpm install)
so CI installs the pinned 0.9.1 release, and re-run the build to confirm the
previously flagged size-limit failure is a duplicate unrelated to this change
before merging.
examples/react/composable-tables/package.json (1)

15-15: LGTM — size limit failure already flagged.

Consistent bump to ^0.9.1. Pipeline failure is a duplicate of the one already flagged.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/react/composable-tables/package.json` at line 15, The package.json
dependency for "@tanstack/react-store" should be consistently bumped to "^0.9.1"
— update the dependency entry named "@tanstack/react-store" to version "^0.9.1"
if it isn’t already, commit the change, and ignore the duplicate pipeline
failure since it’s the same size-limit issue already flagged.
examples/react/row-selection/package.json (1)

15-15: LGTM — size limit failure already flagged.

Consistent bump to ^0.9.1. The pipeline failure is the same as reported across all packages in this PR (see examples/react/pagination/package.json).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/react/row-selection/package.json` at line 15, The dependency version
for "@tanstack/react-store" was updated to ^0.9.1 in this package.json but other
example packages are inconsistent and causing the size-limit pipeline failures;
update all example package.json entries that list "@tanstack/react-store" (e.g.,
the pagination and other react examples) to the same ^0.9.1 version, run an
install/lockfile update so the lockfile is consistent, and re-run the pipeline
to verify the size check no longer reports duplicate/variant dependency issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/table-core/src/core/table/constructTable.ts`:
- Around line 57-63: Replace usage of table.baseStore.get() with
table.baseStore.state inside the createStore initializer to match the project
convention and documented API; update the block that sets table.store (the
createStore callback which currently reads const state = table.baseStore.get())
to instead read from table.baseStore.state and keep the rest of the merge with
table.options.state unchanged so table.store is constructed consistently with
other usages.

---

Outside diff comments:
In `@examples/react/basic-external-store/package.json`:
- Around line 1-28: CI is failing due to bundle size exceeding the 16KB cap
after bumping `@tanstack/react-store` — locate usages of createStore and
ReadonlyStore (and any other `@tanstack/react-store` imports) in the example code
and remove/replace unused imports or refactor to import only the specific
symbols you need so tree-shaking can eliminate extras; if the new store API
truly increases the minimal bundle size, update the size-limit threshold in the
project configuration to a higher value that reflects the new baseline instead
of keeping the previous 16 KB cap.

In `@examples/react/with-tanstack-query/src/main.tsx`:
- Around line 52-56: myTableStore is created at module scope which makes it a
singleton across mounts, HMR and tests; either move the store creation into the
component (e.g., create it inside the component that used to call React.useState
so each instance gets its own createStore(getInitialTableState(...))) or, if you
intentionally want a single-page/global store, add a clear comment above the
myTableStore declaration explaining this is an intentional per-app singleton and
warning about SSR and test isolation (reference createStore,
getInitialTableState and the basic-external-store example for the per-instance
pattern).

In `@packages/vue-table/src/useTable.ts`:
- Around line 116-123: The watcher is currently observing the ref object
identity (watch(() => tableOptions.data)) so it won't react to changes to the
ref's value; update the watch source to unwrap the ref by using
unref(tableOptions.data) (e.g., watch(() => unref(tableOptions.data), ...)) so
Vue tracks value changes and table.baseStore.setState((prev:
TableState<TFeatures>) => ({ ...prev, data: unref(tableOptions.data) })) runs
when the data value changes.

---

Duplicate comments:
In `@examples/react/basic-external-state/package.json`:
- Line 15: The dependency line for "@tanstack/react-store" was consistently
bumped to "^0.9.1" and the pipeline failure is a duplicate; leave the
package.json dependency entry "@tanstack/react-store": "^0.9.1" as-is (do not
revert or change the version), and re-run CI / ignore the redundant size-limit
failure already reported rather than making further edits to this dependency
line.

In `@examples/react/composable-tables/package.json`:
- Line 15: The package.json dependency for "@tanstack/react-store" should be
consistently bumped to "^0.9.1" — update the dependency entry named
"@tanstack/react-store" to version "^0.9.1" if it isn’t already, commit the
change, and ignore the duplicate pipeline failure since it’s the same size-limit
issue already flagged.

In `@examples/react/row-selection/package.json`:
- Line 15: The dependency version for "@tanstack/react-store" was updated to
^0.9.1 in this package.json but other example packages are inconsistent and
causing the size-limit pipeline failures; update all example package.json
entries that list "@tanstack/react-store" (e.g., the pagination and other react
examples) to the same ^0.9.1 version, run an install/lockfile update so the
lockfile is consistent, and re-run the pipeline to verify the size check no
longer reports duplicate/variant dependency issues.

In `@examples/react/with-tanstack-query/package.json`:
- Line 16: The PR updated the dependency version for "@tanstack/react-store" to
"^0.9.1" which is fine; the pipeline size-limit failure is a duplicate of an
already flagged issue and does not require further changes to the package.json
entry. Leave the "@tanstack/react-store": "^0.9.1" line as-is and do not modify
other dependencies or add duplicate fixes for the same size-limit failure; if
you need to address the pipeline failure separately, create a distinct follow-up
change rather than altering this dependency bump.

In `@packages/react-table/package.json`:
- Line 54: The dependency entry for "@tanstack/react-store" has been bumped to
"^0.9.1" and the review indicates this is correct; ensure the package.json
dependency remains as "@tanstack/react-store": "^0.9.1", update the lockfile
(npm/yarn/pnpm install) so CI installs the pinned 0.9.1 release, and re-run the
build to confirm the previously flagged size-limit failure is a duplicate
unrelated to this change before merging.

In `@packages/table-core/package.json`:
- Line 58: The dependency bump of "@tanstack/store" to "^0.9.1" in package.json
is fine; the CI size-limit failure is a duplicate already flagged in the example
packages, so leave the root dependency change as-is (do not revert) and ensure
any follow-up fixes are applied in the example packages where the original
size-limit failure was flagged rather than in this package.json change;
reference the package.json entry for "@tanstack/store" when verifying no further
edits are needed.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ffde8d8 and 86199dc.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (22)
  • examples/react/basic-external-state/package.json
  • examples/react/basic-external-store/package.json
  • examples/react/basic-external-store/src/main.tsx
  • examples/react/composable-tables/package.json
  • examples/react/pagination/package.json
  • examples/react/row-selection/package.json
  • examples/react/with-tanstack-query/package.json
  • examples/react/with-tanstack-query/src/main.tsx
  • packages/angular-table/package.json
  • packages/angular-table/src/injectTable.ts
  • packages/preact-table/package.json
  • packages/preact-table/src/useTable.ts
  • packages/react-table/package.json
  • packages/react-table/src/useTable.ts
  • packages/svelte-table/package.json
  • packages/table-core/package.json
  • packages/table-core/src/core/table/constructTable.ts
  • packages/table-core/src/core/table/coreTablesFeature.types.ts
  • packages/table-core/src/core/table/coreTablesFeature.utils.ts
  • packages/table-core/src/types/Table.ts
  • packages/vue-table/package.json
  • packages/vue-table/src/useTable.ts
💤 Files with no reviewable changes (3)
  • packages/preact-table/src/useTable.ts
  • packages/angular-table/src/injectTable.ts
  • packages/react-table/src/useTable.ts

@riccardoperra
Copy link
Collaborator Author

@KevinVandy pipeline is failing due to new package-size related to the new store version. Should we have to set a limit like 20kb?

https://github.com/TanStack/table/actions/runs/22324526123/job/64591632821?pr=6180

riccardoperra and others added 2 commits February 25, 2026 16:26
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant