Conversation
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
| 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
76afcc2 to
86199dc
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
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 | 🟠 MajorWatch source must unwrap the ref to track data value changes (Line 117).
When
tableOptions.datais a ref (as indicated byIS_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. Useunref()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 | 🟠 MajorCI 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 thesize-limitthreshold 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 | 🟡 MinorModule-level singleton store — note SSR and test isolation implications.
Moving
myTableStorefrom insideReact.useState(as done inbasic-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-storeexample 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-storeis0.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 (seeexamples/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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (22)
examples/react/basic-external-state/package.jsonexamples/react/basic-external-store/package.jsonexamples/react/basic-external-store/src/main.tsxexamples/react/composable-tables/package.jsonexamples/react/pagination/package.jsonexamples/react/row-selection/package.jsonexamples/react/with-tanstack-query/package.jsonexamples/react/with-tanstack-query/src/main.tsxpackages/angular-table/package.jsonpackages/angular-table/src/injectTable.tspackages/preact-table/package.jsonpackages/preact-table/src/useTable.tspackages/react-table/package.jsonpackages/react-table/src/useTable.tspackages/svelte-table/package.jsonpackages/table-core/package.jsonpackages/table-core/src/core/table/constructTable.tspackages/table-core/src/core/table/coreTablesFeature.types.tspackages/table-core/src/core/table/coreTablesFeature.utils.tspackages/table-core/src/types/Table.tspackages/vue-table/package.jsonpackages/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
|
@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 |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
5a3b6a6 to
3950949
Compare

Summary by CodeRabbit
Release Notes
Chores
Refactor