Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.6k
feat: per table table and column meta#6316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -567,7 +567,11 @@ import type { StockFeatures } from '@tanstack/vue-table' | ||
| type PersonColumn = ColumnDef<StockFeatures, Person> | ||
| ``` | ||
| ### `ColumnMeta` Generic Change | ||
| ### `TableMeta`/`ColumnMeta` Typing Changes | ||
| No more declaration merging required! (Although it still works if you want to keep using it) | ||
| Global declaration merging works exactly like it did in v8. The only change you need to make is updating the generics shape: both interfaces now take `TFeatures` as the first type parameter. | ||
| ```ts | ||
| declare module '@tanstack/vue-table' { | ||
| @@ -577,6 +581,19 @@ declare module '@tanstack/vue-table' { | ||
| } | ||
| ``` | ||
| That's all that's required if you want to keep declaring meta types globally. | ||
| Optionally, v9 also adds a new way to declare meta types **per-table** without declaration merging. You can use type-only `tableMeta`/`columnMeta` slots on the `features` option, which only affect tables created with that `features` object: | ||
| ```ts | ||
| const features = tableFeatures({ | ||
| rowSortingFeature, | ||
| columnMeta: metaHelper<{ align?: 'left' | 'right' }>(), | ||
| }) | ||
| ``` | ||
KevinVandy marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| See the new [Table and Column Meta Guide](../../../guide/table-and-column-meta) for full details on both approaches. | ||
| ### `RowData` Type Restriction | ||
| Prefer explicit object row types: | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shared root cause: per-table meta snippets use
metaHelperwithout an explicit import in-framework.Please align these migration snippets by showing
metaHelperin the import list (or making each snippet explicitly non-standalone) so copy/paste paths compile consistently across adapters.🤖 Prompt for AI Agents