chore(deps): upgrade TanStack Table to v9 - #29
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5
@tanstack/react-table8.21.3 → 9.1.2.What changed
A new
src/routes/admin/-lib/table.tsbinds the shared config once throughcreateTableHook():tableFeatures()registers what the admin tables actually use —rowSortingFeature,rowPaginationFeature,columnVisibilityFeature, plus thesortedRowModelandpaginatedRowModelslots. The core row model is implicit in v9.getRowIdmoves into the factory, so the five tables no longer pass it.createAppColumnHelperreplacescreateColumnHelper, withTFeaturesalready bound.Each table now supplies only its data, columns and initial state.
Renames applied
useReactTable→useAppTable(the bounduseTable)flexRender(def, ctx)→<FlexRender header={header} />/<FlexRender cell={cell} />table.getState()→table.stateVisibilityState→ColumnVisibilityStateTable<TData>→ReactTable<TFeatures, TData>,Header<TData, TValue>→Header<TFeatures, TData, TValue>PAGE_SIZEmoves from theadmin-tablecomponent to-lib/constants.ts, where the activity server file can read it without importing a component. v9 requires a completePaginationStateininitialState, so the sharedINITIAL_PAGINATIONcarries bothpageIndexandpageSize.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 buildpass, 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