@tanstack/table-core 9.0.0-beta.46 → 9.0.0-beta.48

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 (212) hide show
  1. package/dist/core/row-models/coreRowModelsFeature.types.d.cts +1 -1
  2. package/dist/core/row-models/coreRowModelsFeature.types.d.ts +1 -1
  3. package/dist/core/row-models/coreRowModelsFeature.utils.cjs +1 -1
  4. package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
  5. package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +1 -1
  6. package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +1 -1
  7. package/dist/core/row-models/coreRowModelsFeature.utils.js +1 -1
  8. package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
  9. package/dist/features/aggregation/aggregationFeature.cjs +38 -0
  10. package/dist/features/aggregation/aggregationFeature.cjs.map +1 -0
  11. package/dist/features/aggregation/aggregationFeature.d.cts +10 -0
  12. package/dist/features/aggregation/aggregationFeature.d.ts +10 -0
  13. package/dist/features/aggregation/aggregationFeature.js +38 -0
  14. package/dist/features/aggregation/aggregationFeature.js.map +1 -0
  15. package/dist/features/aggregation/aggregationFeature.types.cjs +13 -0
  16. package/dist/features/aggregation/aggregationFeature.types.cjs.map +1 -0
  17. package/dist/features/aggregation/aggregationFeature.types.d.cts +172 -0
  18. package/dist/features/aggregation/aggregationFeature.types.d.ts +172 -0
  19. package/dist/features/aggregation/aggregationFeature.types.js +12 -0
  20. package/dist/features/aggregation/aggregationFeature.types.js.map +1 -0
  21. package/dist/features/aggregation/aggregationFeature.utils.cjs +198 -0
  22. package/dist/features/aggregation/aggregationFeature.utils.cjs.map +1 -0
  23. package/dist/features/aggregation/aggregationFeature.utils.d.cts +33 -0
  24. package/dist/features/aggregation/aggregationFeature.utils.d.ts +33 -0
  25. package/dist/features/aggregation/aggregationFeature.utils.js +192 -0
  26. package/dist/features/aggregation/aggregationFeature.utils.js.map +1 -0
  27. package/dist/features/aggregation/aggregationFns.cjs +240 -0
  28. package/dist/features/aggregation/aggregationFns.cjs.map +1 -0
  29. package/dist/features/aggregation/aggregationFns.d.cts +67 -0
  30. package/dist/features/aggregation/aggregationFns.d.ts +67 -0
  31. package/dist/features/aggregation/aggregationFns.js +229 -0
  32. package/dist/features/aggregation/aggregationFns.js.map +1 -0
  33. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +43 -3
  34. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +43 -3
  35. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +18 -9
  36. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
  37. package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +6 -2
  38. package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +6 -2
  39. package/dist/features/column-filtering/columnFilteringFeature.utils.js +18 -9
  40. package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
  41. package/dist/features/column-filtering/createFilteredRowModel.cjs +7 -2
  42. package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
  43. package/dist/features/column-filtering/createFilteredRowModel.d.cts +6 -2
  44. package/dist/features/column-filtering/createFilteredRowModel.d.ts +6 -2
  45. package/dist/features/column-filtering/createFilteredRowModel.js +7 -2
  46. package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
  47. package/dist/features/column-filtering/filterFns.cjs +399 -0
  48. package/dist/features/column-filtering/filterFns.cjs.map +1 -0
  49. package/dist/features/column-filtering/filterFns.d.cts +210 -0
  50. package/dist/features/column-filtering/filterFns.d.ts +210 -0
  51. package/dist/features/column-filtering/filterFns.js +375 -0
  52. package/dist/features/column-filtering/filterFns.js.map +1 -0
  53. package/dist/features/column-grouping/columnGroupingFeature.cjs +3 -12
  54. package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
  55. package/dist/features/column-grouping/columnGroupingFeature.d.cts +1 -1
  56. package/dist/features/column-grouping/columnGroupingFeature.d.ts +1 -1
  57. package/dist/features/column-grouping/columnGroupingFeature.js +4 -13
  58. package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
  59. package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +6 -49
  60. package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +6 -49
  61. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +0 -50
  62. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
  63. package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +2 -39
  64. package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +2 -39
  65. package/dist/features/column-grouping/columnGroupingFeature.utils.js +2 -49
  66. package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
  67. package/dist/features/column-grouping/createGroupedRowModel.cjs +23 -13
  68. package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
  69. package/dist/features/column-grouping/createGroupedRowModel.d.cts +2 -3
  70. package/dist/features/column-grouping/createGroupedRowModel.d.ts +2 -3
  71. package/dist/features/column-grouping/createGroupedRowModel.js +25 -15
  72. package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
  73. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +4 -2
  74. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  75. package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +2 -6
  76. package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +2 -6
  77. package/dist/features/global-filtering/globalFilteringFeature.utils.js +4 -2
  78. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  79. package/dist/features/row-sorting/createSortedRowModel.cjs +6 -2
  80. package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
  81. package/dist/features/row-sorting/createSortedRowModel.d.cts +6 -2
  82. package/dist/features/row-sorting/createSortedRowModel.d.ts +6 -2
  83. package/dist/features/row-sorting/createSortedRowModel.js +6 -2
  84. package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
  85. package/dist/features/row-sorting/rowSortingFeature.types.d.cts +32 -3
  86. package/dist/features/row-sorting/rowSortingFeature.types.d.ts +32 -3
  87. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +20 -5
  88. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  89. package/dist/features/row-sorting/rowSortingFeature.utils.js +20 -5
  90. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  91. package/dist/{fns → features/row-sorting}/sortFns.cjs +69 -22
  92. package/dist/features/row-sorting/sortFns.cjs.map +1 -0
  93. package/dist/features/row-sorting/sortFns.d.cts +98 -0
  94. package/dist/features/row-sorting/sortFns.d.ts +98 -0
  95. package/dist/{fns → features/row-sorting}/sortFns.js +69 -23
  96. package/dist/features/row-sorting/sortFns.js.map +1 -0
  97. package/dist/features/stockFeatures.cjs +2 -0
  98. package/dist/features/stockFeatures.cjs.map +1 -1
  99. package/dist/features/stockFeatures.d.cts +2 -0
  100. package/dist/features/stockFeatures.d.ts +2 -0
  101. package/dist/features/stockFeatures.js +2 -0
  102. package/dist/features/stockFeatures.js.map +1 -1
  103. package/dist/helpers/tableFeatures.cjs +5 -4
  104. package/dist/helpers/tableFeatures.cjs.map +1 -1
  105. package/dist/helpers/tableFeatures.d.cts +5 -4
  106. package/dist/helpers/tableFeatures.d.ts +5 -4
  107. package/dist/helpers/tableFeatures.js +5 -4
  108. package/dist/helpers/tableFeatures.js.map +1 -1
  109. package/dist/index.cjs +18 -3
  110. package/dist/index.d.cts +10 -8
  111. package/dist/index.d.ts +10 -8
  112. package/dist/index.js +6 -4
  113. package/dist/static-functions.cjs +8 -3
  114. package/dist/static-functions.d.cts +3 -2
  115. package/dist/static-functions.d.ts +3 -2
  116. package/dist/static-functions.js +3 -2
  117. package/dist/types/Cell.d.cts +3 -1
  118. package/dist/types/Cell.d.ts +3 -1
  119. package/dist/types/Column.d.cts +4 -2
  120. package/dist/types/Column.d.ts +4 -2
  121. package/dist/types/ColumnDef.d.cts +5 -3
  122. package/dist/types/ColumnDef.d.ts +5 -3
  123. package/dist/types/Row.d.cts +3 -1
  124. package/dist/types/Row.d.ts +3 -1
  125. package/dist/types/RowModel.d.cts +1 -1
  126. package/dist/types/RowModel.d.ts +1 -1
  127. package/dist/types/RowModelFns.d.cts +3 -3
  128. package/dist/types/RowModelFns.d.ts +3 -3
  129. package/dist/types/Table.d.cts +1 -1
  130. package/dist/types/Table.d.ts +1 -1
  131. package/dist/types/TableFeatures.d.cts +19 -11
  132. package/dist/types/TableFeatures.d.ts +19 -11
  133. package/dist/types/TableOptions.d.cts +5 -3
  134. package/dist/types/TableOptions.d.ts +5 -3
  135. package/dist/types/TableState.d.cts +1 -1
  136. package/dist/types/TableState.d.ts +1 -1
  137. package/dist/types/type-utils.d.cts +8 -1
  138. package/dist/types/type-utils.d.ts +8 -1
  139. package/dist/worker/initTableWorker.cjs.map +1 -1
  140. package/dist/worker/initTableWorker.js.map +1 -1
  141. package/package.json +1 -1
  142. package/skills/aggregation/SKILL.md +131 -0
  143. package/skills/api-not-found/SKILL.md +1 -1
  144. package/skills/client-vs-server/SKILL.md +1 -1
  145. package/skills/column-faceting/SKILL.md +11 -5
  146. package/skills/column-filtering/SKILL.md +8 -3
  147. package/skills/column-ordering/SKILL.md +1 -1
  148. package/skills/column-pinning/SKILL.md +1 -1
  149. package/skills/column-resizing/SKILL.md +1 -1
  150. package/skills/column-sizing/SKILL.md +1 -1
  151. package/skills/column-visibility/SKILL.md +1 -1
  152. package/skills/core/SKILL.md +1 -1
  153. package/skills/custom-features/SKILL.md +1 -1
  154. package/skills/expanding/SKILL.md +1 -1
  155. package/skills/global-filtering/SKILL.md +3 -3
  156. package/skills/grouping/SKILL.md +12 -13
  157. package/skills/migrate-v8-to-v9/SKILL.md +21 -8
  158. package/skills/pagination/SKILL.md +1 -1
  159. package/skills/row-pinning/SKILL.md +1 -1
  160. package/skills/row-selection/SKILL.md +1 -1
  161. package/skills/sorting/SKILL.md +9 -3
  162. package/skills/table-features/SKILL.md +19 -13
  163. package/skills/typescript/SKILL.md +1 -1
  164. package/src/core/row-models/coreRowModelsFeature.utils.ts +1 -1
  165. package/src/features/aggregation/aggregationFeature.ts +59 -0
  166. package/src/features/aggregation/aggregationFeature.types.ts +312 -0
  167. package/src/features/aggregation/aggregationFeature.utils.ts +401 -0
  168. package/src/features/aggregation/aggregationFns.ts +336 -0
  169. package/src/features/column-filtering/columnFilteringFeature.types.ts +61 -1
  170. package/src/features/column-filtering/columnFilteringFeature.utils.ts +33 -19
  171. package/src/features/column-filtering/createFilteredRowModel.ts +13 -3
  172. package/src/features/column-filtering/filterFns.ts +533 -0
  173. package/src/features/column-grouping/columnGroupingFeature.ts +1 -20
  174. package/src/features/column-grouping/columnGroupingFeature.types.ts +4 -86
  175. package/src/features/column-grouping/columnGroupingFeature.utils.ts +1 -88
  176. package/src/features/column-grouping/createGroupedRowModel.ts +32 -38
  177. package/src/features/global-filtering/globalFilteringFeature.utils.ts +9 -1
  178. package/src/features/row-sorting/createSortedRowModel.ts +6 -2
  179. package/src/features/row-sorting/rowSortingFeature.types.ts +54 -2
  180. package/src/features/row-sorting/rowSortingFeature.utils.ts +46 -14
  181. package/src/{fns → features/row-sorting}/sortFns.ts +95 -81
  182. package/src/features/stockFeatures.ts +3 -0
  183. package/src/helpers/tableFeatures.ts +5 -4
  184. package/src/index.ts +7 -8
  185. package/src/static-functions.ts +1 -0
  186. package/src/types/Cell.ts +2 -0
  187. package/src/types/Column.ts +3 -1
  188. package/src/types/ColumnDef.ts +6 -3
  189. package/src/types/Row.ts +2 -0
  190. package/src/types/RowModelFns.ts +3 -3
  191. package/src/types/TableFeatures.ts +19 -11
  192. package/src/types/TableOptions.ts +5 -1
  193. package/src/types/type-utils.ts +8 -0
  194. package/src/worker/initTableWorker.ts +1 -1
  195. package/dist/fns/aggregationFns.cjs +0 -163
  196. package/dist/fns/aggregationFns.cjs.map +0 -1
  197. package/dist/fns/aggregationFns.d.cts +0 -85
  198. package/dist/fns/aggregationFns.d.ts +0 -85
  199. package/dist/fns/aggregationFns.js +0 -153
  200. package/dist/fns/aggregationFns.js.map +0 -1
  201. package/dist/fns/filterFns.cjs +0 -242
  202. package/dist/fns/filterFns.cjs.map +0 -1
  203. package/dist/fns/filterFns.d.cts +0 -178
  204. package/dist/fns/filterFns.d.ts +0 -178
  205. package/dist/fns/filterFns.js +0 -226
  206. package/dist/fns/filterFns.js.map +0 -1
  207. package/dist/fns/sortFns.cjs.map +0 -1
  208. package/dist/fns/sortFns.d.cts +0 -65
  209. package/dist/fns/sortFns.d.ts +0 -65
  210. package/dist/fns/sortFns.js.map +0 -1
  211. package/src/fns/aggregationFns.ts +0 -245
  212. package/src/fns/filterFns.ts +0 -455
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: aggregation
3
+ description: >
4
+ Aggregate TanStack Table columns independently of grouping, including grand totals, caller-selected row totals, multiple keyed aggregations, custom context-based definitions, grouped merges, manual values, and worker constraints.
5
+ metadata:
6
+ {
7
+ type: sub-skill,
8
+ library: '@tanstack/table-core',
9
+ library_version: '9.0.0-beta.48',
10
+ }
11
+ requires: ['core', 'table-features']
12
+ sources:
13
+ - 'TanStack/table:docs/guide/aggregation.md'
14
+ - 'TanStack/table:docs/framework/react/guide/aggregation.md'
15
+ - 'TanStack/table:packages/table-core/src/features/aggregation'
16
+ - 'TanStack/table:examples/react/aggregation'
17
+ - 'TanStack/table:examples/react/grouped-aggregation'
18
+ ---
19
+
20
+ This skill builds on `core` and `table-features`. Aggregation is independent
21
+ from grouping: use it alone for totals, or combine it with the `grouping` skill
22
+ for synthetic grouped rows.
23
+
24
+ ## Setup
25
+
26
+ <!-- skill-snippet:check -->
27
+
28
+ ```ts
29
+ import {
30
+ aggregationFeature,
31
+ aggregationFn_mean,
32
+ aggregationFn_sum,
33
+ tableFeatures,
34
+ } from '@tanstack/table-core'
35
+
36
+ export const features = tableFeatures({
37
+ aggregationFeature,
38
+ aggregationFns: {
39
+ mean: aggregationFn_mean,
40
+ sum: aggregationFn_sum,
41
+ },
42
+ })
43
+ ```
44
+
45
+ ## Core Patterns
46
+
47
+ ### Grand total and selected row scopes
48
+
49
+ ```ts
50
+ const grandTotal = salaryColumn.getAggregationValue()
51
+ const filteredTotal = salaryColumn.getAggregationValue(
52
+ table.getFilteredRowModel().rows,
53
+ )
54
+ ```
55
+
56
+ The default uses the pre-grouped row model. Explicit rows can come from any row
57
+ model or caller-selected subset. Hierarchical inputs are normalized to unique
58
+ terminal rows. Default calls are cached; explicit-row calls intentionally are
59
+ not because array identity and contents are caller-owned.
60
+
61
+ ### Multiple aggregations
62
+
63
+ ```ts
64
+ columnHelper.accessor('salary', {
65
+ aggregationFn: ['mean', { id: 'range', aggregationFn: 'extent' }],
66
+ })
67
+
68
+ const value = salaryColumn.getAggregationValue<{
69
+ mean: number
70
+ range: [number, number]
71
+ }>()
72
+ ```
73
+
74
+ A scalar option returns a scalar. An array returns a keyed object. Named
75
+ functions use their registry name; descriptors provide a stable `id`, which is
76
+ required for inline definitions in an array.
77
+
78
+ ### Custom definitions
79
+
80
+ ```ts
81
+ const weightedMean = constructAggregationFn({
82
+ aggregate: ({ rows, getValue }) => {
83
+ const total = rows.reduce((sum, row) => sum + Number(getValue(row)), 0)
84
+ return rows.length ? total / rows.length : undefined
85
+ },
86
+ })
87
+ ```
88
+
89
+ The context provides `rows`, `getValue`, `column`, `columnId`, `table`, and an
90
+ optional `groupingRow`. Add `merge({ childResults, childRows, ...context })`
91
+ when nested groups can efficiently combine child results; otherwise the engine
92
+ re-runs `aggregate` over normalized terminal rows.
93
+
94
+ ### Manual or remote values
95
+
96
+ Set a column definition's `getAggregationValue(context)` to return `{ value }`
97
+ for requests handled by a server or another execution environment. Returning
98
+ `undefined` falls back to the local definition. `manualAggregation: true`
99
+ disables that local fallback.
100
+
101
+ ## Common Mistakes
102
+
103
+ ### [HIGH] Adding grouping for a grand total
104
+
105
+ Wrong: registering `columnGroupingFeature` solely to total a column.
106
+
107
+ Correct: register `aggregationFeature` and call
108
+ `column.getAggregationValue()`. Grouping is only required for grouped rows.
109
+
110
+ ### [HIGH] Passing a scope label and rows
111
+
112
+ There is no scope option. Call `getAggregationValue()` for the default or pass
113
+ the exact rows from the desired row model.
114
+
115
+ ### [HIGH] Reusing the legacy callable signature
116
+
117
+ Wrong: `(columnId, leafRows, childRows) => result`.
118
+
119
+ Correct: `constructAggregationFn({ aggregate: ({ rows, getValue }) => result })`.
120
+
121
+ ### [MEDIUM] Assuming arbitrary totals run in the worker
122
+
123
+ The experimental worker computes grouped row-model aggregates. Public
124
+ `getAggregationValue(rows?)` totals execute on the main thread, and custom
125
+ grouped results sent by the worker must be structured-cloneable.
126
+
127
+ ## API Discovery
128
+
129
+ Inspect `node_modules/@tanstack/table-core/src/features/aggregation/` and the
130
+ Aggregation Guide. Use `Column_Aggregation`, `AggregationFnDef`,
131
+ `AggregationContext`, and `AggregationResult` for the typed public surface.
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.0.0-beta.46'
8
+ library_version: '9.0.0-beta.48'
9
9
  requires: ['core', 'table-features']
10
10
  sources:
11
11
  - 'TanStack/table:packages/table-core/src/index.ts'
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.0.0-beta.46'
8
+ library_version: '9.0.0-beta.48'
9
9
  requires: ['core', 'table-features']
10
10
  sources:
11
11
  - 'TanStack/table:docs/guide/row-models.md'
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features', 'column-filtering']
12
12
  sources:
@@ -27,14 +27,18 @@ import {
27
27
  createFacetedRowModel,
28
28
  createFacetedUniqueValues,
29
29
  createFilteredRowModel,
30
- filterFns,
30
+ filterFn_includesString,
31
+ filterFn_inNumberRange,
31
32
  tableFeatures,
32
33
  } from '@tanstack/table-core'
33
34
 
34
35
  export const features = tableFeatures({
35
36
  columnFilteringFeature,
36
37
  filteredRowModel: createFilteredRowModel(),
37
- filterFns,
38
+ filterFns: {
39
+ includesString: filterFn_includesString,
40
+ inNumberRange: filterFn_inNumberRange,
41
+ },
38
42
  columnFacetingFeature,
39
43
  facetedRowModel: createFacetedRowModel(),
40
44
  facetedUniqueValues: createFacetedUniqueValues(),
@@ -51,8 +55,10 @@ const range = table.getColumn('age')?.getFacetedMinMaxValues()
51
55
 
52
56
  Use unique values for discrete controls and min/max only for numeric ranges.
53
57
  The filtered model makes facets respond to the table's other active filters.
54
- The built-in `filterFns` registry supports named stock filters; a column may
55
- instead receive a filter function directly without registering it.
58
+ Register individually imported built-ins under their conventional keys so
59
+ columns can reference them by string name; a column may instead receive a
60
+ filter function directly without registering it. The full `filterFns` registry
61
+ object still works but bundles every built-in.
56
62
 
57
63
  ## Common Mistakes
58
64
 
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -23,17 +23,22 @@ This skill builds on `core`, `table-features`, and `client-vs-server`. Filtering
23
23
  import {
24
24
  columnFilteringFeature,
25
25
  createFilteredRowModel,
26
- filterFns,
26
+ filterFn_includesString,
27
27
  tableFeatures,
28
28
  } from '@tanstack/table-core'
29
29
 
30
30
  export const features = tableFeatures({
31
31
  columnFilteringFeature,
32
32
  filteredRowModel: createFilteredRowModel(),
33
- filterFns,
33
+ filterFns: { includesString: filterFn_includesString },
34
34
  })
35
35
  ```
36
36
 
37
+ Import individual `filterFn_*` built-ins and register only those your columns
38
+ reference by string name or that `filterFn: 'auto'` should resolve for your
39
+ data types. The full `filterFns` registry object still works but bundles every
40
+ built-in.
41
+
37
42
  ## Core Patterns
38
43
 
39
44
  ```ts
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features', 'column-sizing']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features', 'column-sizing']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: core
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.0.0-beta.46'
8
+ library_version: '9.0.0-beta.48'
9
9
  sources:
10
10
  - 'TanStack/table:docs/overview.md'
11
11
  - 'TanStack/table:docs/guide/tables.md'
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.0.0-beta.46'
8
+ library_version: '9.0.0-beta.48'
9
9
  requires: ['core', 'table-features', 'typescript']
10
10
  sources:
11
11
  - 'TanStack/table:docs/framework/react/guide/custom-features.md'
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server', 'column-filtering']
12
12
  sources:
@@ -23,7 +23,7 @@ This skill builds on `core`, `table-features`, `client-vs-server`, and `column-f
23
23
  import {
24
24
  columnFilteringFeature,
25
25
  createFilteredRowModel,
26
- filterFns,
26
+ filterFn_includesString,
27
27
  globalFilteringFeature,
28
28
  tableFeatures,
29
29
  } from '@tanstack/table-core'
@@ -32,7 +32,7 @@ export const features = tableFeatures({
32
32
  columnFilteringFeature,
33
33
  globalFilteringFeature,
34
34
  filteredRowModel: createFilteredRowModel(),
35
- filterFns,
35
+ filterFns: { includesString: filterFn_includesString },
36
36
  })
37
37
  ```
38
38
 
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: grouping
3
3
  description: >
4
- Group and aggregate rows with columnGroupingFeature, groupedRowModel, aggregationFns, groupedColumnMode, and manualGrouping. Load for grouped, placeholder, or aggregated cells and grouping interactions with expansion or pagination.
4
+ Group rows with columnGroupingFeature, groupedRowModel, groupedColumnMode, and manualGrouping. Load for grouped or placeholder cells and grouping interactions with expansion or pagination.
5
5
  metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -15,13 +15,12 @@ sources:
15
15
  - 'TanStack/table:examples/react/grouping'
16
16
  ---
17
17
 
18
- This skill builds on `core`, `table-features`, and `client-vs-server`. Grouping creates row structure and aggregate values; the renderer chooses grouped-cell UI.
18
+ This skill builds on `core`, `table-features`, and `client-vs-server`. Grouping creates row structure and the renderer chooses grouped-cell UI. Load the separate `aggregation` skill when grouped rows should also calculate values.
19
19
 
20
20
  ## Setup
21
21
 
22
22
  ```ts
23
23
  import {
24
- aggregationFns,
25
24
  columnGroupingFeature,
26
25
  createGroupedRowModel,
27
26
  tableFeatures,
@@ -30,7 +29,6 @@ import {
30
29
  export const features = tableFeatures({
31
30
  columnGroupingFeature,
32
31
  groupedRowModel: createGroupedRowModel(),
33
- aggregationFns,
34
32
  })
35
33
  ```
36
34
 
@@ -40,11 +38,9 @@ export const features = tableFeatures({
40
38
  const options = { groupedColumnMode: 'reorder' as const }
41
39
  const mode = cell.getIsGrouped()
42
40
  ? 'grouped'
43
- : cell.getIsAggregated()
44
- ? 'aggregated'
45
- : cell.getIsPlaceholder()
46
- ? 'placeholder'
47
- : 'value'
41
+ : cell.getIsPlaceholder()
42
+ ? 'placeholder'
43
+ : 'value'
48
44
  ```
49
45
 
50
46
  Render these cell modes deliberately.
@@ -57,7 +53,7 @@ Wrong: `tableFeatures({ groupedRowModel: createGroupedRowModel() })`
57
53
 
58
54
  Correct: `tableFeatures({ columnGroupingFeature, groupedRowModel: createGroupedRowModel() })`
59
55
 
60
- The grouped slot and aggregation registry require `columnGroupingFeature`.
56
+ The grouped row-model slot requires `columnGroupingFeature`.
61
57
 
62
58
  Source: `packages/table-core/src/types/TableFeatures.ts#FeatureSlotPrereqs`
63
59
 
@@ -90,10 +86,13 @@ Wrong: `render(cell.getValue())`
90
86
 
91
87
  Correct: `render(cell.getIsPlaceholder() ? null : cell.getValue())`
92
88
 
93
- Placeholder and aggregated cells do not represent ordinary leaf values.
89
+ Placeholder cells do not represent ordinary leaf values. Group rows should
90
+ only render their grouped cell when aggregation is not enabled.
94
91
 
95
92
  Source: `examples/react/grouping/src/main.tsx`
96
93
 
97
94
  ## API Discovery
98
95
 
99
- Inspect `node_modules/@tanstack/table-core/src/features/column-grouping/` and `src/fns/aggregationFns.ts`.
96
+ Inspect `node_modules/@tanstack/table-core/src/features/column-grouping/` for
97
+ grouping. Load the `aggregation` skill when totals, multiple aggregations,
98
+ grouped aggregate values, or custom definitions are part of the task.
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: lifecycle
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.0.0-beta.46'
8
+ library_version: '9.0.0-beta.48'
9
9
  requires: ['core', 'table-features', 'typescript']
10
10
  sources:
11
11
  - 'TanStack/table:docs/framework/react/guide/migrating.md'
@@ -42,9 +42,9 @@ import {
42
42
  createFilteredRowModel,
43
43
  createSortedRowModel,
44
44
  columnFilteringFeature,
45
- filterFns,
45
+ filterFn_includesString,
46
46
  rowSortingFeature,
47
- sortFns,
47
+ sortFn_alphanumeric,
48
48
  tableFeatures,
49
49
  } from '@tanstack/table-core'
50
50
 
@@ -53,8 +53,8 @@ export const features = tableFeatures({
53
53
  rowSortingFeature,
54
54
  filteredRowModel: createFilteredRowModel(),
55
55
  sortedRowModel: createSortedRowModel(),
56
- filterFns,
57
- sortFns,
56
+ filterFns: { includesString: filterFn_includesString },
57
+ sortFns: { alphanumeric: sortFn_alphanumeric },
58
58
  })
59
59
  ```
60
60
 
@@ -70,7 +70,8 @@ V8 bundled all stock features. V9 exposes an API only when its feature is presen
70
70
  | --------------------------- | ------------------------- |
71
71
  | Column faceting | `columnFacetingFeature` |
72
72
  | Column filtering | `columnFilteringFeature` |
73
- | Grouping and aggregation | `columnGroupingFeature` |
73
+ | Aggregation | `aggregationFeature` |
74
+ | Grouping | `columnGroupingFeature` |
74
75
  | Column ordering | `columnOrderingFeature` |
75
76
  | Column pinning | `columnPinningFeature` |
76
77
  | Interactive column resizing | `columnResizingFeature` |
@@ -90,6 +91,7 @@ Honor feature prerequisites in the same `tableFeatures` call:
90
91
  - `columnResizingFeature` requires `columnSizingFeature`.
91
92
  - `globalFilteringFeature` requires `columnFilteringFeature`.
92
93
  - Every row-model or function-registry slot requires its associated feature.
94
+ - `aggregationFns` requires `aggregationFeature`; grouped aggregation uses both `aggregationFeature` and `columnGroupingFeature`.
93
95
  - Put prerequisite feature properties before dependent slots so inference and diagnostics remain clear.
94
96
 
95
97
  ### 2. Move row models into feature slots and rename factories
@@ -118,7 +120,17 @@ Move registries from table options or factory arguments into these feature slots
118
120
  | `filterFns` | `filterFns` |
119
121
  | `aggregationFns` | `aggregationFns` |
120
122
 
121
- Register built-ins only when needed, or spread them with custom functions. A slot's keys become the valid string names in column definitions.
123
+ Register only the built-ins the table references by string name, importing each individually (`filterFn_includesString`, `sortFn_alphanumeric`, `aggregationFn_sum`, and so on) alongside any custom functions. The full registry objects (`filterFns`, `sortFns`, `aggregationFns` exports) still work but bundle every built-in. A slot's keys become the valid string names in column definitions, and `'auto'` resolves only registered functions.
124
+
125
+ Aggregation is independent from grouping. Add `aggregationFeature` for
126
+ `aggregationFn`, `aggregatedCell`, `column.getAggregationValue(rows?)`, and
127
+ `cell.getIsAggregated`. A root total does not require grouping. Convert legacy
128
+ custom callables `(columnId, leafRows, childRows) => result` to
129
+ `constructAggregationFn({ aggregate: (context) => result, merge? })`
130
+ definitions. Replace `column.getAggregationFn()` with
131
+ `column.getAggregationFns()`; arrays in `aggregationFn` return keyed objects.
132
+ Replace the old `AggregationFn` and `CreatedAggregationFn` types with
133
+ `AggregationFnDef`.
122
134
 
123
135
  ### 3. Migrate state reads and whole-state observation
124
136
 
@@ -279,7 +291,8 @@ Do not confuse new capabilities with required breakages. After the table works,
279
291
  - [ ] Remove `getCoreRowModel()` unless supplying a deliberate custom `coreRowModel` slot.
280
292
  - [ ] Move all remaining `get*RowModel()` options or earlier-beta `rowModels` entries to `create*RowModel()` feature slots.
281
293
  - [ ] Register each dependent feature before its row-model slot.
282
- - [ ] Move `filterFns`, `sortingFns`/`sortFns`, and `aggregationFns` into feature slots; pass no registries to factories.
294
+ - [ ] Move `filterFns`, `sortingFns`/`sortFns`, and `aggregationFns` into feature slots, registering individually imported built-ins; pass no registries to factories.
295
+ - [ ] Register `aggregationFeature` independently and migrate custom aggregation callables to context-based `AggregationFnDef` definitions.
283
296
  - [ ] Register `columnFilteringFeature` before global filtering and filter/facet dependencies.
284
297
  - [ ] Register `columnSizingFeature` before `columnResizingFeature`.
285
298
  - [ ] Replace `table.getState()` and top-level `onStateChange` according to the adapter state guide.
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features']
12
12
  sources:
@@ -6,7 +6,7 @@ metadata:
6
6
  {
7
7
  type: sub-skill,
8
8
  library: '@tanstack/table-core',
9
- library_version: '9.0.0-beta.46',
9
+ library_version: '9.0.0-beta.48',
10
10
  }
11
11
  requires: ['core', 'table-features', 'client-vs-server']
12
12
  sources:
@@ -23,17 +23,23 @@ This skill builds on `core`, `table-features`, and `client-vs-server`. Sorting s
23
23
  import {
24
24
  createSortedRowModel,
25
25
  rowSortingFeature,
26
- sortFns,
26
+ sortFn_alphanumeric,
27
+ sortFn_text,
27
28
  tableFeatures,
28
29
  } from '@tanstack/table-core'
29
30
 
30
31
  export const features = tableFeatures({
31
32
  rowSortingFeature,
32
33
  sortedRowModel: createSortedRowModel(),
33
- sortFns,
34
+ sortFns: { alphanumeric: sortFn_alphanumeric, text: sortFn_text },
34
35
  })
35
36
  ```
36
37
 
38
+ Import individual `sortFn_*` built-ins and register only those your columns
39
+ reference by string name or that `sortFn: 'auto'` should resolve for your data
40
+ types. The full `sortFns` registry object still works but bundles every
41
+ built-in; numeric columns fall back to a basic comparator without registration.
42
+
37
43
  ## Core Patterns
38
44
 
39
45
  ```ts
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.0.0-beta.46'
8
+ library_version: '9.0.0-beta.48'
9
9
  requires: ['core']
10
10
  sources:
11
11
  - 'TanStack/table:docs/guide/row-models.md'
@@ -22,26 +22,28 @@ This skill builds on `core`. Read it first for the headless model and stable inp
22
22
 
23
23
  ```ts
24
24
  import {
25
- aggregationFns,
25
+ aggregationFeature,
26
+ aggregationFn_sum,
26
27
  columnGroupingFeature,
27
28
  createFilteredRowModel,
28
29
  createSortedRowModel,
29
30
  columnFilteringFeature,
30
- filterFns,
31
+ filterFn_includesString,
31
32
  rowSortingFeature,
32
- sortFns,
33
+ sortFn_alphanumeric,
33
34
  tableFeatures,
34
35
  } from '@tanstack/table-core'
35
36
 
36
37
  export const features = tableFeatures({
37
38
  columnFilteringFeature,
38
39
  filteredRowModel: createFilteredRowModel(),
39
- filterFns,
40
+ filterFns: { includesString: filterFn_includesString },
41
+ aggregationFeature,
40
42
  columnGroupingFeature,
41
- aggregationFns,
43
+ aggregationFns: { sum: aggregationFn_sum },
42
44
  rowSortingFeature,
43
45
  sortedRowModel: createSortedRowModel(),
44
- sortFns,
46
+ sortFns: { alphanumeric: sortFn_alphanumeric },
45
47
  })
46
48
  ```
47
49
 
@@ -63,19 +65,23 @@ const features = tableFeatures({
63
65
  ```ts
64
66
  const features = tableFeatures({
65
67
  columnFilteringFeature,
66
- filterFns,
68
+ filterFns: { includesString: filterFn_includesString },
67
69
  rowSortingFeature,
68
- sortFns,
70
+ sortFns: { alphanumeric: sortFn_alphanumeric },
71
+ aggregationFeature,
69
72
  columnGroupingFeature,
70
- aggregationFns,
73
+ aggregationFns: { sum: aggregationFn_sum },
71
74
  })
72
75
  ```
73
76
 
74
77
  `filterFns`, `sortFns`, and `aggregationFns` are feature slots, not table
75
78
  options. They respectively require `columnFilteringFeature`,
76
- `rowSortingFeature`, and `columnGroupingFeature`. A registered key can be used
77
- as a typed string name; pass a function directly when no registry name is
78
- needed.
79
+ `rowSortingFeature`, and `aggregationFeature`. Import individual built-ins
80
+ (`filterFn_*`, `sortFn_*`, `aggregationFn_*`) and register them under their
81
+ conventional keys; the full registry objects (`filterFns`, `sortFns`,
82
+ `aggregationFns` exports) still work but bundle every built-in. A registered
83
+ key can be used as a typed string name, and `'auto'` resolves only registered
84
+ functions; pass a function directly when no registry name is needed.
79
85
 
80
86
  ### Prefer explicit features
81
87
 
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.0.0-beta.46'
8
+ library_version: '9.0.0-beta.48'
9
9
  requires: ['core', 'table-features']
10
10
  sources:
11
11
  - 'TanStack/table:docs/guide/helpers.md'
@@ -92,7 +92,7 @@ export function table_getPreGroupedRowModel<
92
92
  }
93
93
 
94
94
  /**
95
- * Resolves the row model after grouping has produced grouped and aggregated rows.
95
+ * Resolves the row model after grouping has produced grouped rows.
96
96
  *
97
97
  * When `manualGrouping` is enabled, or no grouped row-model factory was
98
98
  * registered, this returns the pre-grouped row model unchanged.