@tanstack/vue-table 9.0.0-beta.4 → 9.0.0-beta.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +2 -0
  2. package/dist/FlexRender.cjs +2 -3
  3. package/dist/FlexRender.cjs.map +1 -1
  4. package/dist/FlexRender.d.cts +30 -12
  5. package/dist/FlexRender.d.ts +30 -12
  6. package/dist/FlexRender.js +2 -3
  7. package/dist/FlexRender.js.map +1 -1
  8. package/dist/createTableHook.cjs +4 -9
  9. package/dist/createTableHook.cjs.map +1 -1
  10. package/dist/createTableHook.d.cts +49 -21
  11. package/dist/createTableHook.d.ts +49 -21
  12. package/dist/createTableHook.js +4 -9
  13. package/dist/createTableHook.js.map +1 -1
  14. package/dist/experimental-worker-plugin.cjs +9 -0
  15. package/dist/experimental-worker-plugin.d.cts +1 -0
  16. package/dist/experimental-worker-plugin.d.ts +1 -0
  17. package/dist/experimental-worker-plugin.js +3 -0
  18. package/dist/flex-render.d.cts +2 -2
  19. package/dist/flex-render.d.ts +2 -2
  20. package/dist/index.d.cts +3 -3
  21. package/dist/index.d.ts +3 -3
  22. package/dist/reactivity.cjs +2 -6
  23. package/dist/reactivity.cjs.map +1 -1
  24. package/dist/reactivity.js +2 -6
  25. package/dist/reactivity.js.map +1 -1
  26. package/dist/useTable.cjs +3 -7
  27. package/dist/useTable.cjs.map +1 -1
  28. package/dist/useTable.d.cts +1 -8
  29. package/dist/useTable.d.ts +1 -8
  30. package/dist/useTable.js +3 -7
  31. package/dist/useTable.js.map +1 -1
  32. package/package.json +8 -4
  33. package/skills/create-table-hook/SKILL.md +146 -0
  34. package/skills/getting-started/SKILL.md +144 -0
  35. package/skills/migrate-v8-to-v9/SKILL.md +185 -0
  36. package/skills/table-state/SKILL.md +191 -0
  37. package/skills/with-tanstack-query/SKILL.md +127 -0
  38. package/skills/with-tanstack-virtual/SKILL.md +116 -0
  39. package/src/FlexRender.ts +28 -13
  40. package/src/createTableHook.ts +112 -20
  41. package/src/experimental-worker-plugin.ts +1 -0
  42. package/src/reactivity.ts +1 -2
  43. package/src/useTable.ts +3 -11
  44. package/skills/vue/client-to-server/SKILL.md +0 -365
  45. package/skills/vue/compose-with-tanstack-form/SKILL.md +0 -369
  46. package/skills/vue/compose-with-tanstack-pacer/SKILL.md +0 -318
  47. package/skills/vue/compose-with-tanstack-query/SKILL.md +0 -385
  48. package/skills/vue/compose-with-tanstack-store/SKILL.md +0 -301
  49. package/skills/vue/compose-with-tanstack-virtual/SKILL.md +0 -340
  50. package/skills/vue/getting-started/SKILL.md +0 -409
  51. package/skills/vue/migrate-v8-to-v9/SKILL.md +0 -375
  52. package/skills/vue/production-readiness/SKILL.md +0 -271
  53. package/skills/vue/table-state/SKILL.md +0 -403
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: with-tanstack-query
3
+ description: >
4
+ Compose reactive Vue Query keys and results with Vue Table manual row processing, refs/computed state, server counts, and already-processed pages without duplicating query data into a drifting local ref.
5
+ metadata:
6
+ type: composition
7
+ library: '@tanstack/vue-table'
8
+ framework: vue
9
+ library_version: '9.0.0-beta.42'
10
+ requires:
11
+ - '@tanstack/table-core#client-vs-server'
12
+ - getting-started
13
+ - table-state
14
+ sources:
15
+ - 'TanStack/table:examples/vue/with-tanstack-query'
16
+ - 'TanStack/table:docs/framework/vue/guide/pagination.md'
17
+ ---
18
+
19
+ This skill builds on `@tanstack/table-core#client-vs-server`, `getting-started`, and `table-state`. Name each client- and server-owned processing stage first.
20
+
21
+ ## Setup
22
+
23
+ ```ts
24
+ import { computed, ref } from 'vue'
25
+ import { keepPreviousData, useQuery } from '@tanstack/vue-query'
26
+ import {
27
+ rowPaginationFeature,
28
+ tableFeatures,
29
+ useTable,
30
+ } from '@tanstack/vue-table'
31
+
32
+ const pagination = ref({ pageIndex: 0, pageSize: 20 })
33
+ const query = useQuery(() => ({
34
+ queryKey: ['people', pagination.value.pageIndex, pagination.value.pageSize],
35
+ queryFn: () =>
36
+ fetch(
37
+ `/api/people?page=${pagination.value.pageIndex}&size=${pagination.value.pageSize}`,
38
+ ).then((r) => r.json()),
39
+ placeholderData: keepPreviousData,
40
+ }))
41
+ const data = computed(() => query.data.value?.rows ?? [])
42
+ const rowCount = computed(() => query.data.value?.rowCount ?? 0)
43
+ const state = computed(() => ({ pagination: pagination.value }))
44
+ const table = useTable({
45
+ features: tableFeatures({ rowPaginationFeature }),
46
+ columns,
47
+ data,
48
+ rowCount,
49
+ manualPagination: true,
50
+ state,
51
+ onPaginationChange: (next) => {
52
+ pagination.value =
53
+ typeof next === 'function' ? next(pagination.value) : next
54
+ },
55
+ })
56
+ ```
57
+
58
+ ## Core Patterns
59
+
60
+ ### Keep query dependencies reactive
61
+
62
+ Use the Vue Query options function and read refs inside it. Include every manual filter/sort/page input in the query key.
63
+
64
+ ### Pass Query results directly
65
+
66
+ Expose result fields as computed refs. Introduce a second local data ref only for an explicit editing workflow with a cache-write policy.
67
+
68
+ ## Common Mistakes
69
+
70
+ ### HIGH Unwrapping before query construction
71
+
72
+ Wrong:
73
+
74
+ ```ts
75
+ const page = pagination.value.pageIndex
76
+ useQuery(() => ({ queryKey: ['people', page], queryFn }))
77
+ ```
78
+
79
+ Correct:
80
+
81
+ ```ts
82
+ useQuery(() => ({ queryKey: ['people', pagination.value.pageIndex], queryFn }))
83
+ ```
84
+
85
+ Only reads inside the reactive options function become query dependencies.
86
+
87
+ Source: `examples/vue/with-tanstack-query/src/App.tsx`
88
+
89
+ ### HIGH Mirroring Query data locally
90
+
91
+ Wrong:
92
+
93
+ ```ts
94
+ const rows = ref(query.data.value?.rows ?? [])
95
+ ```
96
+
97
+ Correct:
98
+
99
+ ```ts
100
+ const rows = computed(() => query.data.value?.rows ?? [])
101
+ ```
102
+
103
+ A one-time copy drifts from subsequent cache results.
104
+
105
+ Source: `examples/vue/with-tanstack-query/src/App.tsx`
106
+
107
+ ### HIGH Omitting server counts
108
+
109
+ Wrong:
110
+
111
+ ```ts
112
+ useTable({ features, columns, data, manualPagination: true })
113
+ ```
114
+
115
+ Correct:
116
+
117
+ ```ts
118
+ useTable({ features, columns, data, rowCount, manualPagination: true })
119
+ ```
120
+
121
+ One returned page cannot tell Table how many pages the server has.
122
+
123
+ Source: `docs/framework/vue/guide/pagination.md`
124
+
125
+ ## API Discovery
126
+
127
+ Inspect installed `@tanstack/vue-table/src/useTable.ts`, installed `@tanstack/vue-query/src`, and the relevant manual Table feature source for exact option types.
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: with-tanstack-virtual
3
+ description: >
4
+ Virtualize Vue Table final row or column models with reactive counts and scroll targets, stable keys, measurement, spacer geometry, sticky CSS, grid/flex widths, and infinite server data.
5
+ metadata:
6
+ type: composition
7
+ library: '@tanstack/vue-table'
8
+ framework: vue
9
+ library_version: '9.0.0-beta.42'
10
+ requires:
11
+ - '@tanstack/table-core#core'
12
+ - getting-started
13
+ - table-state
14
+ sources:
15
+ - 'TanStack/table:docs/framework/vue/guide/virtualization.md'
16
+ - 'TanStack/table:examples/vue/virtualized-rows'
17
+ - 'TanStack/table:examples/vue/virtualized-columns'
18
+ - 'TanStack/table:examples/vue/virtualized-infinite-scrolling'
19
+ ---
20
+
21
+ This skill builds on `@tanstack/table-core#core`, `getting-started`, and `table-state`. Virtual consumes final Table models; it is not registered in `tableFeatures`.
22
+
23
+ ## Setup
24
+
25
+ ```ts
26
+ import { computed, ref } from 'vue'
27
+ import { useVirtualizer } from '@tanstack/vue-virtual'
28
+
29
+ const scrollElement = ref<HTMLElement | null>(null)
30
+ const rows = computed(() => table.getRowModel().rows)
31
+ const rowVirtualizer = useVirtualizer(
32
+ computed(() => ({
33
+ count: rows.value.length,
34
+ getScrollElement: () => scrollElement.value,
35
+ estimateSize: () => 34,
36
+ getItemKey: (index) => rows.value[index]!.id,
37
+ overscan: 5,
38
+ })),
39
+ )
40
+ const virtualRows = computed(() => rowVirtualizer.value.getVirtualItems())
41
+ const totalSize = computed(() => rowVirtualizer.value.getTotalSize())
42
+ ```
43
+
44
+ ## Core Patterns
45
+
46
+ ### Derive from current visible models
47
+
48
+ Rows come from `table.getRowModel().rows`; columns come from `table.getVisibleLeafColumns()`. Use computed options so counts and scroll targets update.
49
+
50
+ ### Implement the geometry
51
+
52
+ Give the scroll container a bounded height and positioning context, create a spacer using `getTotalSize()`, and translate/measure virtual items. Follow the grid/flex examples for dynamic row heights and sticky headers.
53
+
54
+ ### Coordinate infinite fetching
55
+
56
+ Fetch near the last virtual item only while `totalFetched < serverRowCount` and no request is active. Manual sorting means the server must return the sorted order and a sort change normally resets pages.
57
+
58
+ ## Common Mistakes
59
+
60
+ ### HIGH Passing a plain options snapshot
61
+
62
+ Wrong:
63
+
64
+ ```ts
65
+ useVirtualizer({ count: rows.value.length, getScrollElement })
66
+ ```
67
+
68
+ Correct:
69
+
70
+ ```ts
71
+ useVirtualizer(computed(() => ({ count: rows.value.length, getScrollElement })))
72
+ ```
73
+
74
+ Computed options keep the virtual range synchronized with Vue’s current model.
75
+
76
+ Source: `examples/vue/virtualized-rows/src/App.vue`
77
+
78
+ ### HIGH Virtualizing source arrays
79
+
80
+ Wrong:
81
+
82
+ ```ts
83
+ const rows = computed(() => data.value)
84
+ ```
85
+
86
+ Correct:
87
+
88
+ ```ts
89
+ const rows = computed(() => table.getRowModel().rows)
90
+ ```
91
+
92
+ Source arrays do not represent Table’s current filtering, sorting, expansion, or pagination.
93
+
94
+ Source: `docs/framework/vue/guide/virtualization.md`
95
+
96
+ ### HIGH Assuming Virtual provides CSS
97
+
98
+ Wrong:
99
+
100
+ ```vue
101
+ <div v-for="item in virtualRows" :key="item.key">{{ rows[item.index].id }}</div>
102
+ ```
103
+
104
+ Correct:
105
+
106
+ ```vue
107
+ <div :style="{ height: `${totalSize}px`, position: 'relative' }"><div style="position:absolute"></div></div>
108
+ ```
109
+
110
+ Virtual provides measurements, not spacer layout, transforms, sticky positioning, or Table column widths.
111
+
112
+ Source: `examples/vue/virtualized-columns/src/App.vue`
113
+
114
+ ## API Discovery
115
+
116
+ Inspect installed `@tanstack/vue-table/src` and `@tanstack/vue-virtual/src`; use the maintained Vue examples for exact row, column, and infinite layout combinations.
package/src/FlexRender.ts CHANGED
@@ -1,12 +1,27 @@
1
1
  import { defineComponent, h, isVNode } from 'vue'
2
2
  import type { PropType } from 'vue'
3
- import type {
4
- Cell,
5
- CellData,
6
- Header,
7
- RowData,
8
- TableFeatures,
9
- } from '@tanstack/table-core'
3
+
4
+ export interface FlexRenderCell {
5
+ column: {
6
+ columnDef: {
7
+ aggregatedCell?: any
8
+ cell?: any
9
+ }
10
+ }
11
+ getContext: () => any
12
+ getIsAggregated?: () => boolean
13
+ getIsPlaceholder?: () => boolean
14
+ }
15
+
16
+ export interface FlexRenderHeader {
17
+ column: {
18
+ columnDef: {
19
+ footer?: any
20
+ header?: any
21
+ }
22
+ }
23
+ getContext: () => any
24
+ }
10
25
 
11
26
  /**
12
27
  * If rendering headers, cells, or footers with custom markup, use flexRender instead of `cell.getValue()` or `cell.renderValue()`.
@@ -60,24 +75,24 @@ export const FlexRender = defineComponent({
60
75
  default: undefined,
61
76
  },
62
77
  cell: {
63
- type: Object as PropType<Cell<any, any, any>>,
78
+ type: Object as PropType<FlexRenderCell>,
64
79
  default: undefined,
65
80
  },
66
81
  header: {
67
- type: Object as PropType<Header<any, any, any>>,
82
+ type: Object as PropType<FlexRenderHeader>,
68
83
  default: undefined,
69
84
  },
70
85
  footer: {
71
- type: Object as PropType<Header<any, any, any>>,
86
+ type: Object as PropType<FlexRenderHeader>,
72
87
  default: undefined,
73
88
  },
74
89
  },
75
90
  setup: (props: {
76
91
  render?: any
77
92
  props?: any
78
- cell?: Cell<any, any, any>
79
- header?: Header<any, any, any>
80
- footer?: Header<any, any, any>
93
+ cell?: FlexRenderCell
94
+ header?: FlexRenderHeader
95
+ footer?: FlexRenderHeader
81
96
  }) => {
82
97
  return () => {
83
98
  // New shorthand pattern: extract render and props from cell/header/footer
@@ -4,7 +4,8 @@ import { FlexRender } from './FlexRender'
4
4
  import { mergeProxy } from './merge-proxy'
5
5
  import { useTable } from './useTable'
6
6
  import type { TableOptionsWithReactiveData, VueTable } from './useTable'
7
- import type { Component, InjectionKey, PropType, VNodeChild } from 'vue'
7
+ import type { FlexRenderCell, FlexRenderHeader } from './FlexRender'
8
+ import type { Component, InjectionKey, PropType } from 'vue'
8
9
  import type {
9
10
  AccessorFn,
10
11
  AccessorFnColumnDef,
@@ -25,7 +26,6 @@ import type {
25
26
  RowData,
26
27
  Table,
27
28
  TableFeatures,
28
- TableState,
29
29
  } from '@tanstack/table-core'
30
30
 
31
31
  export type ComponentType<T extends Record<string, any>> = Component<T>
@@ -212,10 +212,9 @@ export interface AppHeaderProps<
212
212
  export type AppVueTable<
213
213
  TFeatures extends TableFeatures,
214
214
  TData extends RowData,
215
- TSelected,
216
215
  TTableComponents extends Record<string, ComponentType<any>>,
217
- TCellComponents extends Record<string, ComponentType<any>>,
218
- THeaderComponents extends Record<string, ComponentType<any>>,
216
+ _TCellComponents extends Record<string, ComponentType<any>>,
217
+ _THeaderComponents extends Record<string, ComponentType<any>>,
219
218
  > = VueTable<TFeatures, TData> &
220
219
  NoInfer<TTableComponents> & {
221
220
  AppTable: Component<AppTableProps>
@@ -225,19 +224,88 @@ export type AppVueTable<
225
224
  FlexRender: typeof AppFlexRender
226
225
  }
227
226
 
227
+ export interface CreateTableHookResult<
228
+ TFeatures extends TableFeatures,
229
+ TTableComponents extends Record<string, ComponentType<any>>,
230
+ TCellComponents extends Record<string, ComponentType<any>>,
231
+ THeaderComponents extends Record<string, ComponentType<any>>,
232
+ > {
233
+ /** The features object that was passed to `createTableHook`. */
234
+ appFeatures: TFeatures
235
+ /**
236
+ * A column helper pre-bound to `TFeatures` and the registered components, so
237
+ * the cell/header/footer render props expose the bound components.
238
+ */
239
+ createAppColumnHelper: <TData extends RowData>() => AppColumnHelper<
240
+ TFeatures,
241
+ TData,
242
+ TCellComponents,
243
+ THeaderComponents
244
+ >
245
+ /**
246
+ * Creates a table with the `App*` wrapper components and registered
247
+ * `tableComponents` attached. `TData` is inferred from the `data` option.
248
+ */
249
+ useAppTable: <TData extends RowData>(
250
+ tableOptions: Omit<
251
+ TableOptionsWithReactiveData<TFeatures, TData>,
252
+ 'features'
253
+ >,
254
+ ) => AppVueTable<
255
+ TFeatures,
256
+ TData,
257
+ TTableComponents,
258
+ TCellComponents,
259
+ THeaderComponents
260
+ >
261
+ /**
262
+ * Reads the table provided by the nearest `<table.AppTable>`. This is the same
263
+ * extended instance `useAppTable` returns, so the `App*` components and your
264
+ * `tableComponents` are available on it.
265
+ */
266
+ useTableContext: <TData extends RowData = RowData>() => AppVueTable<
267
+ TFeatures,
268
+ TData,
269
+ TTableComponents,
270
+ TCellComponents,
271
+ THeaderComponents
272
+ >
273
+ /**
274
+ * Reads the cell provided by the nearest `<table.AppCell>`, extended with your
275
+ * `cellComponents` and a context-bound `FlexRender`.
276
+ */
277
+ useCellContext: <TValue extends CellData = CellData>() => Cell<
278
+ TFeatures,
279
+ any,
280
+ TValue
281
+ > &
282
+ TCellComponents & { FlexRender: Component }
283
+ /**
284
+ * Reads the header provided by the nearest `<table.AppHeader>` /
285
+ * `<table.AppFooter>`, extended with your `headerComponents` and a
286
+ * context-bound `FlexRender`.
287
+ */
288
+ useHeaderContext: <TValue extends CellData = CellData>() => Header<
289
+ TFeatures,
290
+ any,
291
+ TValue
292
+ > &
293
+ THeaderComponents & { FlexRender: Component }
294
+ }
295
+
228
296
  export const AppFlexRender = defineComponent({
229
297
  name: 'TableFlexRender',
230
298
  props: {
231
299
  cell: {
232
- type: Object as PropType<Cell<any, any, any>>,
300
+ type: Object as PropType<FlexRenderCell>,
233
301
  default: undefined,
234
302
  },
235
303
  header: {
236
- type: Object as PropType<Header<any, any, any>>,
304
+ type: Object as PropType<FlexRenderHeader>,
237
305
  default: undefined,
238
306
  },
239
307
  footer: {
240
- type: Object as PropType<Header<any, any, any>>,
308
+ type: Object as PropType<FlexRenderHeader>,
241
309
  default: undefined,
242
310
  },
243
311
  },
@@ -280,7 +348,6 @@ export const AppFlexRender = defineComponent({
280
348
  * ```ts
281
349
  * const { useAppTable, createAppColumnHelper } = createTableHook({
282
350
  * features,
283
- * rowModels: {},
284
351
  * tableComponents: {},
285
352
  * cellComponents: {},
286
353
  * headerComponents: {},
@@ -302,7 +369,12 @@ export function createTableHook<
302
369
  TTableComponents,
303
370
  TCellComponents,
304
371
  THeaderComponents
305
- >) {
372
+ >): CreateTableHookResult<
373
+ TFeatures,
374
+ TTableComponents,
375
+ TCellComponents,
376
+ THeaderComponents
377
+ > {
306
378
  const TableContext = Symbol('TableContext') as InjectionKey<
307
379
  VueTable<TFeatures, any>
308
380
  >
@@ -327,9 +399,12 @@ export function createTableHook<
327
399
  >
328
400
  }
329
401
 
330
- function useTableContext<TData extends RowData = RowData>(): VueTable<
402
+ function useTableContext<TData extends RowData = RowData>(): AppVueTable<
331
403
  TFeatures,
332
- TData
404
+ TData,
405
+ TTableComponents,
406
+ TCellComponents,
407
+ THeaderComponents
333
408
  > {
334
409
  const table = inject(TableContext)
335
410
 
@@ -340,14 +415,24 @@ export function createTableHook<
340
415
  )
341
416
  }
342
417
 
343
- return table as VueTable<TFeatures, TData>
418
+ // The value provided by `<table.AppTable>` is the extended table (the App*
419
+ // wrapper components and `tableComponents` are Object.assign-ed onto the same
420
+ // instance `useAppTable` returns), so this asserts the runtime shape.
421
+ return table as unknown as AppVueTable<
422
+ TFeatures,
423
+ TData,
424
+ TTableComponents,
425
+ TCellComponents,
426
+ THeaderComponents
427
+ >
344
428
  }
345
429
 
346
430
  function useCellContext<TValue extends CellData = CellData>(): Cell<
347
431
  TFeatures,
348
432
  any,
349
433
  TValue
350
- > {
434
+ > &
435
+ TCellComponents & { FlexRender: Component } {
351
436
  const cell = inject(CellContext)
352
437
 
353
438
  if (!cell) {
@@ -357,14 +442,18 @@ export function createTableHook<
357
442
  )
358
443
  }
359
444
 
360
- return cell as Cell<TFeatures, any, TValue>
445
+ // `<table.AppCell>` Object.assign-es `cellComponents` and `FlexRender` onto
446
+ // the same cell instance it provides, so this asserts the runtime shape.
447
+ return cell as unknown as Cell<TFeatures, any, TValue> &
448
+ TCellComponents & { FlexRender: Component }
361
449
  }
362
450
 
363
451
  function useHeaderContext<TValue extends CellData = CellData>(): Header<
364
452
  TFeatures,
365
453
  any,
366
454
  TValue
367
- > {
455
+ > &
456
+ THeaderComponents & { FlexRender: Component } {
368
457
  const header = inject(HeaderContext)
369
458
 
370
459
  if (!header) {
@@ -373,7 +462,10 @@ export function createTableHook<
373
462
  )
374
463
  }
375
464
 
376
- return header as Header<TFeatures, any, TValue>
465
+ // `<table.AppHeader>` / `<table.AppFooter>` Object.assign `headerComponents`
466
+ // and `FlexRender` onto the same header instance they provide.
467
+ return header as unknown as Header<TFeatures, any, TValue> &
468
+ THeaderComponents & { FlexRender: Component }
377
469
  }
378
470
 
379
471
  const CellFlexRender = defineComponent({
@@ -403,12 +495,11 @@ export function createTableHook<
403
495
  function useAppTable<TData extends RowData>(
404
496
  tableOptions: Omit<
405
497
  TableOptionsWithReactiveData<TFeatures, TData>,
406
- 'features' | 'rowModels'
498
+ 'features'
407
499
  >,
408
500
  ): AppVueTable<
409
501
  TFeatures,
410
502
  TData,
411
- TableState<TFeatures>,
412
503
  TTableComponents,
413
504
  TCellComponents,
414
505
  THeaderComponents
@@ -515,7 +606,6 @@ export function createTableHook<
515
606
  }) as AppVueTable<
516
607
  TFeatures,
517
608
  TData,
518
- TableState<TFeatures>,
519
609
  TTableComponents,
520
610
  TCellComponents,
521
611
  THeaderComponents
@@ -523,6 +613,8 @@ export function createTableHook<
523
613
  }
524
614
 
525
615
  return {
616
+ // `TableOptionsWithReactiveData` widens `features` to allow a reactive ref,
617
+ // so this narrows it back to the resolved `TFeatures` for `appFeatures`.
526
618
  appFeatures: defaultTableOptions.features as TFeatures,
527
619
  createAppColumnHelper,
528
620
  useAppTable,
@@ -0,0 +1 @@
1
+ export * from '@tanstack/table-core/experimental-worker-plugin'
package/src/reactivity.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { computed, shallowRef, watch } from 'vue'
2
- import { batch } from '@tanstack/store'
3
2
  import type {
4
3
  TableAtomOptions,
5
4
  TableReactivityBindings,
@@ -84,6 +83,6 @@ export function vueReactivity(): TableReactivityBindings {
84
83
  return refToWritableAtom(shallowRef(value) as ShallowRef<T>)
85
84
  },
86
85
  untrack: (fn) => fn(),
87
- batch,
86
+ batch: (fn) => fn(),
88
87
  }
89
88
  }
package/src/useTable.ts CHANGED
@@ -7,7 +7,6 @@ import type {
7
7
  Table,
8
8
  TableFeatures,
9
9
  TableOptions,
10
- TableState,
11
10
  } from '@tanstack/table-core'
12
11
  import type { MaybeRef, VNode } from 'vue'
13
12
 
@@ -47,13 +46,7 @@ function getReactiveOptionDeps<
47
46
  export type VueTable<
48
47
  TFeatures extends TableFeatures,
49
48
  TData extends RowData,
50
- > = Omit<Table<TFeatures, TData>, 'store'> & {
51
- /**
52
- * @deprecated Prefer `table.atoms.<slice>.get()` for slice snapshots, or
53
- * `table.Subscribe` for explicit subscriptions. `table.store.state` is a
54
- * current-value snapshot and is easy to misuse in render code.
55
- */
56
- readonly store: Table<TFeatures, TData>['store']
49
+ > = Table<TFeatures, TData> & {
57
50
  /** Creates a reactive render boundary. The child function reads the table
58
51
  * atoms it needs, so Vue only tracks those atom reads.
59
52
  */
@@ -75,7 +68,6 @@ export type VueTable<
75
68
  * const table = useTable(
76
69
  * {
77
70
  * features,
78
- * rowModels: {},
79
71
  * columns,
80
72
  * data,
81
73
  * },
@@ -103,7 +95,7 @@ export function useTable<
103
95
 
104
96
  const mergedOptions = mergeProxy(tableOptions, {
105
97
  features: {
106
- coreReativityFeature: reactivity,
98
+ coreReactivityFeature: reactivity,
107
99
  ...(unref(tableOptions.features) ?? {}),
108
100
  },
109
101
  }) as TableOptionsWithReactiveData<TFeatures, TData>
@@ -174,7 +166,7 @@ export function useTable<
174
166
  table.Subscribe = (props: {
175
167
  children: (atoms: Table<TFeatures, TData>['atoms']) => VNode | Array<VNode>
176
168
  }) => {
177
- return props.children(table.atoms)
169
+ return props.children(table.atoms as Table<TFeatures, TData>['atoms'])
178
170
  }
179
171
 
180
172
  return table