Skip to content

chore(deps): upgrade TanStack Table to v9 - #29

Merged
viclafouch merged 2 commits into
mainfrom
chore/tanstack-table-v9
Aug 23, 2026
Merged

viclafouch merged 2 commits into
mainfrom
chore/tanstack-table-v9

Conversation

@viclafouch

Copy link
Copy Markdown
Owner

Closes #5

@tanstack/react-table 8.21.3 → 9.1.2.

What changed

A new src/routes/admin/-lib/table.ts binds the shared config once through createTableHook():

  • tableFeatures() registers what the admin tables actually use — rowSortingFeature, rowPaginationFeature, columnVisibilityFeature, plus the sortedRowModel and paginatedRowModel slots. The core row model is implicit in v9.
  • getRowId moves into the factory, so the five tables no longer pass it.
  • createAppColumnHelper replaces createColumnHelper, with TFeatures already bound.

Each table now supplies only its data, columns and initial state.

Renames applied

  • useReactTable → useAppTable (the bound useTable)
  • flexRender(def, ctx) → <FlexRender header={header} /> / <FlexRender cell={cell} />
  • table.getState() → table.state
  • VisibilityState → ColumnVisibilityState
  • Table<TData> → ReactTable<TFeatures, TData>, Header<TData, TValue> → Header<TFeatures, TData, TValue>

PAGE_SIZE moves from the admin-table component to -lib/constants.ts, where the activity server file can read it without importing a component. v9 requires a complete PaginationState in initialState, so the shared INITIAL_PAGINATION carries both pageIndex and pageSize.

No new feature adopted beyond what the tables already used.

Risk

The admin tables are the whole blast radius, and none of them are covered by a test. Typecheck, lint, unit tests and pnpm run build pass, but the rendering path is only proven by reading. Worth clicking through on /admin: sort a column on Utilisateurs, Catégories, Soumissions and Recherche IA, page forward and back, and check the activity timeline on a user page still paginates server side with its column-visibility scope applied.

🤖 Generated with Claude Code

Register the admin tables' shared features once through
`createTableHook`, so each table only supplies its data, columns and
initial state. Sorting, pagination and column visibility are now
explicit, and the core row model is implicit.

Closes #5

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
petit-meme Ready Ready Preview Aug 22, 2026 4:23pm

Request Review

V9 only finds a sort function the table registers itself. Without the
`sortFns` slot, `sortFn: 'auto'` warned in dev and fell back to `basic`
in production: capitals sorted before lowercase, and `item10` before
`item2`. Registering `datetime`, `alphanumeric` and `text` restores the
v8 behaviour.

Also moves `INITIAL_PAGINATION` next to `PAGE_SIZE`, so the admin table
constants have one address.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@viclafouch
viclafouch merged commit f66b62a into main Aug 23, 2026
5 checks passed
@viclafouch
viclafouch deleted the chore/tanstack-table-v9 branch August 23, 2026 07:51

This branch was successfully deployed

1 active deployment
Preview — eb70b82c Deployed Aug 22, 2026 by vercel[bot]
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.

chore(deps): upgrade TanStack Table to v9

1 participant