0
Fork 0
mirror of https://github.com/TanStack/table.git synced 2026-11-18 18:55:54 +00:00
Commit graph

47 commits

Author SHA1 Message Date
Kevin Van Cott
ff436663f8
refactor(table-core): centralize no-op state update guarding in setStateSlice (#6532)
* refactor(table-core): centralize no-op state update guarding in setStateSlice

Route every table.setX state router through a single setStateSlice util
that resolves the updater once against the slice's current value,
structurally compares the result, and skips the onXChange handler
entirely when nothing changed. This removes the class of render loops
where auto resets fired change handlers with freshly allocated but
semantically identical values (e.g. autoResetExpanded after a data
reference change), and deletes the scattered ad-hoc guards that
previously protected individual slices.

For uncontrolled slices the default handler receives the pre-resolved
value, so updaters run exactly once. User handlers and externally owned
slices receive the original updater untouched to preserve functional
update composition and independent base-atom fallback semantics.

Supersedes #6519.

Co-Authored-By: Dmitrii Kartashev <dikartashev@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix test and regen docs

* add date filters to filter examples

* omit row selection from new check

* auto fix lint issues

* ci: apply automated fixes

* format

* lint fix

* uncomment

* address stale updater bug, simplify

* still skip autoResetPageIndex in controlled state scenarios

* regen docs again

* refactor(table-core): make stateSlicesEqual the setStateSlice default, call unguarded handlers directly

setStateSlice now always guards, with isEqual as an override hook for
custom feature slices. Slices that deliberately skip guarding
(rowSelection, columnSizing, columnResizing, globalFilter, and the
expanded/cellSelection setters) call their change handler directly
instead of routing through a no-op wrapper, keeping pointer-frequency
paths free of the routing overhead. rowPinning picks up the guard via
the new default, matching columnPinning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Dmitrii Kartashev <dikartashev@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-08 21:48:26 -05:00
Kevin Van Cott
09598d2e41
feat: support infinite pagination page sizes (#6526)
* feat: support infinite pagination page sizes

* add devtools to all with-tanstack examples

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-07 13:11:04 -05:00
Kevin Van Cott
c6e8a34390
fix: correct row behavior and expand feature guides (#6509) 2026-08-03 21:15:24 -05:00
Kevin Van Cott
82c32e0bc6
docs: regen docs and fix some typos repo wide 2026-08-03 07:31:20 -05:00
Kevin Van Cott
aad2c292cb
fix(table-core): correct expanded/paginated state contents and sorting toggle defaults (#6501)
Two independent clusters of default-behavior bugs from the beta triage.

Expanded and paginated state contents:

Expand-all materialized every id in `rowsById`, including leaf rows that
can never expand, so a serialized `ExpandedState` was polluted with dead
keys and `getExpandedDepth` was skewed by them. Materialization now writes
only ids where `row.getCanExpand()` is true, chosen over `subRows.length`
so `getRowCanExpand` lazy-load overrides stay expandable.
`getExpandedDepth` filters the same way, and `getIsAllRowsExpanded` now
only considers expandable rows so the materialized map still round-trips
as "all expanded" (a map of stale ids with no expandable rows is false).

Paginated `flatRows` pushed each row and then recursed into its subRows,
but page rows already contain expanded descendants inline, so those rows
appeared twice. The rebuild now dedupes by row id. Collapsed descendants
stay included, consistent with every other row model, where `flatRows`
ignores expansion state.

`row.toggleExpanded(bool)` and `table.toggleAllRowsExpanded(bool)` fired
`onExpandedChange` even when the requested state already matched, so
controlled consumers got spurious callbacks. Both now early-return.

Neither toggle consulted `row.getCanExpand()`, unlike their row-selection
equivalents, so a non-expandable row could be written into expanded state
imperatively. The expand direction is now guarded; collapsing is always
allowed so stale expanded ids can still be cleaned up.

Sorting toggle defaults:

`column.toggleSorting()` called `column.getNextSortingOrder(column)` with
no `multi` argument, so `enableMultiRemove` was dead on every path. The
argument is now forwarded as `multi && column.getCanMultiSort()`, matching
the multi-mode condition the updater itself uses. The public
`getNextSortingOrder` type now accepts the `multi` argument it always
supported at runtime.

`column.getAutoSortDir()` sampled only `flatRows[0]`, so a leading null or
a manual-sorting data swap flipped the inferred first direction mid-cycle
and silently dropped a state from the toggle cycle. It now samples the
first 10 rows for a non-nullish value, matching `getAutoSortFn`.

Docs: `sortUndefined: false` was documented as "considered tied" in all
framework sorting guides; undefined values are actually passed straight to
the sorting function with no special handling. Corrected, and the missing
`'first'`/`'last'` bullets were added to the generated reference.

Also fixes three crashes in the MRT examples surfaced while testing the
sorting changes. The MUI and Mantine sort labels read `sorting` off
`state`, which does not carry it, and crashed on `sorting.length`; they now
read it through `table.Subscribe` on `table.atoms.sorting`, which also
makes the badge reactive. The row-action edit handler passed a shallow row
copy to `setEditingRow`, breaking the row identity the edit modal needs.
`mrtRefsFeature` seeded the keyed `editInputRefs`/`filterInputRefs` bags
with `null` instead of `{}`, crashing on first keyed write. New e2e
coverage pins all three plus the sort-direction indicator.

Closes #6115
Closes #5833
Closes #6136
Closes #4939
Closes #4946
Closes #5147
Closes #5832

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-02 22:19:11 -05:00
Kevin Van Cott
34ad4676ff
feat: add opt-in sorting auto-reset (#6489)
Co-authored-by: Jiajun Chen <tychenjiajun@live.cn>
2026-08-01 21:09:05 -05:00
Kevin Van Cott
0b294316dc
feat: support subtractive cell selection (#6476)
* feat: support subtractive cell selection

* ci: apply automated fixes

* ci: apply automated fixes (attempt 2/3)

* ci: apply automated fixes (attempt 3/3)

* docs: update cell selection skills

* vite type module

* remove test results

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-01 07:28:44 -05:00
dfedoryshchev
ba53bcaeeb
docs(table-core): correct getIsSome*Selected JSDoc to at-least-one se… (#6478)
docs(table-core): correct getIsSome*Selected JSDoc to at-least-one semantics

`getIsSomeRowsSelected` and `getIsSomePageRowsSelected` were still documented
as "partial" selection checks, which is the v8 meaning. In v9 they return true
whenever at least one row is selected, including when all of them are.

`table_getIsSomeRowsSelected` also reads `state.rowSelection` rather than the
filtered row model, so "across filtered rows" was inaccurate as well.

The generated reference pages carry the same sentences, so they are updated
alongside the JSDoc.

Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
2026-07-31 18:25:13 -05:00
Kevin Van Cott
d2b2f75d45
feat: octane-table adapter (#6477)
* feat: octane-table adapter

* add skills for octane

* move to compiled tsrx
2026-07-31 14:44:13 -05:00
Kevin Van Cott
6415183c9f
feat: cell selection feature (#6455)
* feat: cell selection feature

* pr feedback and fix svelte loop

* fix test
2026-07-25 20:45:15 -05:00
Naoya Yamashita
813f57305e
fix(table-core): remove SyntheticEvent persist() calls (#6448) 2026-07-24 11:33:24 -05:00
James Garbutt
441cf7449f
perf(table-core): pre-compute instance init functions (#6446)
* perf: pre-compute instance init functions

When we construct a row, we iterate over the table's features and
initialise any which have an `initRowInstanceData`.

This is expensive since most don't have such a method.

We actually know when we construct the table which features have this
method. This changes the table construction to store the initialisers up
front so when we create a row, we can just iterate the already known
initialisers.

* fix(table-core): bind initialiser to feature

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* cache init functions consistently for all table objects

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
2026-07-24 11:15:58 -05:00
Kevin Van Cott
6acc1e9215
fix: rename to rowAggregationFeature and rewrite migration guides (#6423)
* fix: rename to rowAggregationFeature and rewrite migration guides

* ci: apply automated fixes

* update feature name in migration guide

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-15 21:45:07 -05:00
Kevin Van Cott
66f7508801
fix: add back sub-rows onto aggregate context (#6421)
* fix: add back sub-rows onto aggregate context

* aggregate from sub-rows by default first like v8 behavior

* new APIs for custom aggregation depths

* fix example signatures

* update docs
2026-07-15 18:46:56 -05:00
Kevin Van Cott
f265513e01
feat: aggregation overhaul as a standalone feature (#6418)
* feat: aggregation overhaul as a standalone feature

* finish updating rest of examples and guides
2026-07-14 12:48:08 -05:00
Kevin Van Cott
eba5386a67
feat: new filter, sort, aggregation Fns, and recommended import patterns (#6415)
* feat: new filter, sort, aggregation Fns, and recommended import patterns

* fix some examples
2026-07-12 20:47:49 -05:00
Kevin Van Cott
e90cfdcfd4
feat: batch row selection (#6409)
* feat: batch row selection

* fix tests

* pr feedback and add migration guide note

* no more e2e in pr

* fix angular examples double building in ci tests

* fix type
2026-07-12 11:04:00 -05:00
Kevin Van Cott
1b64e85372
feat: get row display index (#6407)
* feat: get row display index

* rename table_getRowsInDisplayOrder

* regen docs
2026-07-11 22:20:12 -05:00
Kevin Van Cott
e91608ea2f
feat: update column pinning terminology from left/right to start/end (#6398)
* feat: update column pinning terminology from left/right to start/end

* update beta number

* update variable names and clarify left to right associations
2026-07-10 08:01:09 -05:00
Frederic Bahr
7adc88b569
feat: use lit-store internally instead of reyling on vanilla store dependency (#6267)
* feat: implement fine-grained rerendering control with an async Lit directive

An async Lit directe `subscribe` is implemented to allow for fine-grained reactivity and rerendering of templates.
To support this, `@tanstack/lit-store` is integrated.

* fix package.json

* fix a ton of stuff

* regen docs

---------

Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
2026-06-29 08:49:06 -05:00
Kevin Van Cott
0d07d773ed docs: regen api docs 2026-06-26 20:33:44 -05:00
Kevin Van Cott
a84475b17b
feat: refactor features option to include row models and fns (#6318)
* feat: refactor features option to include row models and fns

* ci: apply automated fixes

* fix column/global filtering feature relationship in types

* fix TData in custom filterFns

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-12 09:38:52 -05:00
Kevin Van Cott
e25a532ae8 docs: beta docs pass 2026-06-10 20:45:40 -05:00
Kevin Van Cott
be6a9323c0 docs: regen api ref and refactor composable tables guides 2026-06-09 07:51:38 -05:00
Kevin Van Cott
60e4d7b371
feat: drop the underscore. It's cleaner (#6296)
* feat: drop the underscore. It's cleaner

* simplify
2026-06-05 13:39:35 -05:00
Riccardo Perra
63ea77ce67
feat: add angular devtools support and fix core devtools reactivity (#6248)
* feat: add angular devtools

* fix(table-devtools): fix table state reactivity

Refactor devtools panel with a more solid-idiomatic approach, using memo and dynamic `useTableState` subscription via Accessor getter to not break reactivity.

* Add devtools in all angular examples

* Use a stable identifier reference to register devtools in table

* Fix dependency versions

* ci: apply automated fixes

* generate instanceId for react-table

* fix basic external store examples
mark table.store as deprecated in adapter table types
replace table.store.state with table.state in examples

* add external atoms example in angular

* update package lock

* ci: apply automated fixes

* update angular adapter for readonly atom reactivity pattern

* add missing angular examples (WIP)

* clean up devtools on examples

* fix some angular reactivity

* ci: apply automated fixes

* fix solid and svelte reactivity issues

* update docs gen

* apply pr feedback

* make state reads consistent in angular examples

* ci: apply automated fixes

* fix infinite render in angular column-pinning-split

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
2026-05-29 10:49:41 -04:00
Kevin Van Cott
f51e53eb11
Gen docs2 (#6271)
* regen static function jsdoc

* more jsdoc fixes
2026-05-16 22:29:46 -05:00
Kevin Van Cott
1b3deca86b
regen static function jsdoc (#6270) 2026-05-16 21:41:59 -05:00
Kevin Van Cott
70a0e7ec82
regen docs and bump versions (#6263) 2026-05-14 17:14:41 -05:00
Kevin Van Cott
db0c2d9b5a
fix: simplify some column pinning + visibility memo deps and performance (#6259)
* fix: simplify some column pinning + visibility memo deps and performance

* fix pnpm link issue with match-sorter-utils
2026-05-13 14:21:54 -05:00
Kevin Van Cott
90a825b84b docs: update getting started and api ref doc links 2026-05-10 14:43:09 -05:00
Kevin Van Cott
8370b545b6
fix: remove options store from react/preact and refactor external state syncing (#6244)
* fix: remove options store from react/preact and refactor external state subscriptions

* fix svelte reactivity issues

* sync state to baseAtoms in table construct

* update lock file
2026-05-07 11:48:52 -05:00
Kevin Van Cott
310dd6fb03 fix: visible column pinning issue 2026-04-29 11:02:09 -05:00
Kevin Van Cott
a8d9e0a585 fix: fixes #6220 export all types from table-core 2026-04-28 21:19:19 -05:00
Kevin Van Cott
bda3e16a89 fix: issues with react compiler, various lint issues, improve all examples stress testing 2026-04-26 14:35:39 -05:00
Kevin Van Cott
1a3d065706 fix: devtools props not required, extra pagnination state changes, vanilla examples update, remove structuredClone in favor of custom clone function 2026-04-25 14:58:45 -05:00
Kevin Van Cott
19490e7f44
feat: refactor table store into feature atoms (#6234)
* feat: refactor table store into feature atoms

* get rid of stupid proxies because optional chaining isn't bad

* fix some legacy table stuff and update migrating guide

* subscribe with atoms refactor

* fixed vue table types

* fix more subscribe types

* simplify atom and store construction more
2026-04-21 18:01:14 -05:00
Kevin Van Cott
882d1ce726 feat: upgrade to new tanstack store version and useSelector hook 2026-04-17 21:41:07 -05:00
Kevin Van Cott
89764a8833 fix: stop filtering some frameworks from tests 2026-04-08 11:49:38 -05:00
Kevin Van Cott
2ad6f9720b feat: enable vue adapter
chore: add lots of solid examples
2026-04-06 09:11:06 -05:00
Kevin Van Cott
67a81b5d9a feat: separate out legacy table stuff to separate import 2026-03-01 12:04:47 -06:00
Kevin Van Cott
017953bd0c chore: package upgrades and type-doc gen 2026-01-28 08:11:30 -06:00
Kevin Van Cott
a4904ad00a package upgrades 2024-10-30 18:30:00 -05:00
autofix-ci[bot]
3f839930f2
ci: apply automated fixes 2024-10-28 04:50:12 +00:00
autofix-ci[bot]
7f40d645ce
ci: apply automated fixes 2024-08-30 09:23:16 +00:00
Kevin Van Cott
09bef7529e progress on memo refactors 2024-08-23 23:53:39 -05:00
Kevin Van Cott
342069c57e generate reference docs 2024-07-28 17:52:20 -05:00