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

4 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
f944d5893e
chore: package upgrades 2026-07-31 17:40:00 -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
86b56c4cad
docs: add dynamic column example (#6380)
* docs: add dynamic column example

* ci: apply automated fixes

* scope permissions better

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-04 20:36:45 -05:00