feat: update to tanstack table v9 init#11055
Draft
KevinVandy wants to merge 1 commit into
Draft
Conversation
Contributor
|
@KevinVandy is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Can you sign the commits please? See https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits. Thank you. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Update Data Table docs & examples to TanStack Table v9 (beta)
TanStack Table v9 should launch as stable soonish (July), so I'm opening this as a draft PR that tests the latest beta (
9.0.0-beta.23) end to end against our docs and examples. It will stay a draft until v9 goes stable. The goal is to do the work a bit early so we can flip it to ready and merge within a few days of the stable release. This is intentionally a near 1-to-1 migration (update what's there, not a redesign). I may follow up with a part 2 PR that briefly covers how to take advantage of v9, such as advanced state management and new utilities likecreateTableHookfor better table-component reuse, each discussed briefly with links out to the official docs.If you want a full migration guide to reference, see here
Dependency
@tanstack/react-tableto9.0.0-beta.23(pinned) inapps/v4, lockfile updated. This will change to9.x.xminimumReleaseAgeExcludeentry inpnpm-workspace.yaml, this must be removed before mergingExamples migrated to v9
tableFeatures(), build columns withcreateColumnHelper().columns([...])(accessor/display) instead ofColumnDef[]annotations,useReactTabletouseTable,table.getState()totable.state,flexRenderretained.registry/new-york-v4/examples/data-table-demo,examples/{base,radix}/data-table-{demo,rtl}, and thepaymentscard.data-table-features.ts,columns.tsx, and the 5 reusable sub-components with feature-first generics (ReactTable/Column/Row<typeof features, …>andTData extends RowData), faceting enabled for the faceted filters.getRowIdpreserved (drag reordering depends on it); faceting features dropped since there's no faceted UI ("include only what you use").Docs updated
data-table.mdxguides (base + radix) rewritten for v9: new "Set up table features" step, helper-based column definitions,useTable, an aside noting the<table.FlexRender />component alternative, and the beta install command.tanstack.com/table/v8/...links to/latestindata-table.mdxandtable.mdx.Registry
@tanstack/react-table@9.0.0-beta.23in the 3 block_registry.tsdependency strings. This will change to9.x.xpublic/r/**viapnpm registry:build.v9 specifics worth noting for reviewers
ColumnDef<typeof features, TData>, etc.; generic components needTData extends RowData.VisibilityStateis nowColumnVisibilityState;.statelives on theReactTable(adapter) type, not coreTable;initialState.paginationnow requirespageIndex.Verification
pnpm typecheckpasses (0 errors),pnpm lintpasses,prettier --checkpasses,pnpm registry:buildsucceeds./docs/components/data-table(incl. RTL preview),/examples/tasks(sorting, faceted filter counts, pagination, view options, selection),/examples/dashboard(drag-to-reorder).Known follow-ups / open items
public/r/styles/{new-york,default}/are git-tracked but no longer regenerated byregistry:build(no source feeds them) and still contain v8 code. Decide whether to deprecate/remove or re-wire them into the build.createTableHookfor reusable table components (brief, with links to the official v9 docs).