fix: type aggregatedCell against bound cellComponents in createAppColumnHelper #6589
main fromrefs/pull/6589/head·opened Changes#
aggregatedCell is now omitted and redeclared against AppCellContext, matching cell, on AppColumnDefBase, AppDisplayColumnDef, and AppGroupColumnDef. The same copy of those types exists in every adapter with a component registry (React, Preact, Solid, Svelte, Vue, Lit, Angular, Octane), so all of them are updated. Alpine and Ember do not bind cell components on this type and are unchanged. Type-only; no runtime change.
createAppColumnHelper already typed cell, header, and footer against the registered cellComponents / headerComponents. aggregatedCell (from rowAggregationFeature) uses the same cell context at runtime: AppCell assigns those components onto the cell instance, and FlexRender calls aggregatedCell with cell.getContext(). Its column-def type stayed on the plain Cell. Bound names such as cell.NameCell type-checked in cell and failed in aggregatedCell.
Fixes #6583
The omit-and-redeclare is unconditional, matching cell / header / footer. Closed #6584 was React-only; the other option is to show aggregatedCell only when rowAggregationFeature is in TFeatures (core feature-gates the key; this type does not). aggregatedCell is the only other CellContext renderer. Can drop the extra adapters or gate the key on the feature.
Checklist#
- I have followed the steps in the Contributing guide.
- I have tested code changes locally with
pnpm testandpnpm test:e2e, or these tests do not apply to this pull request. - I fully understand the code in this pull request, including any code generated with AI assistance.
Package test:types was run for the eight affected adapters; @tanstack/react-table test:lib (34 tests) and test:eslint also passed. End-to-end tests do not apply.
Release Impact#
- This change affects published code, and I have generated a changeset.
- This change is docs/CI/dev-only (no release).
Summary by CodeRabbit#
New Features
- Added support for defining custom aggregated-cell templates in application column definitions across Angular, Lit, Octane, Preact, React, Solid, Svelte, and Vue integrations.
- Aggregated-cell templates now receive the same registered cell components and context available to standard cell templates.
Bug Fixes
- Corrected aggregated-cell typing to match bound cell-component behavior.
- 1
The checklist marks 'This change affects published code, and I have generated a changeset.'
Can we confirm the changeset covers all 8 adapter packages as a patch release? Since this fixes compile-time type errors for users consuming registered components inside aggregatedCell, a patch bump across the affected packages makes total sense
Updating all 8 adapters (React, Preact, Solid, Svelte, Vue, Lit, Angular, Octane) ensures solid parity across the ecosystem.
Since these types are duplicated across each adapter directory rather than centralized into a common utility type, do we have type-level tests (e.g., tsd or expect-type) across all 8 packages to ensure future additions to AppCellContext or AppColumnDefBase don't silently diverge?
cpruijsen(GitHub profile, opens in a new tab) linked this to fix #6583
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
53a134da-6591-49d4-98ac-afefc8c9ffc9📥 Commits
Reviewing files that changed from the base of the PR and between ce123bc6651bcbf188f3198627c6bb0b10588162 and d91d72e322c18ee5591d4219804f4c568e3a7cf9.
📒 Files selected for processing (10)
.changeset/bound-aggregated-cell-components.mdpackages/angular-table/src/helpers/createTableHook.tspackages/lit-table/src/createTableHook.tspackages/octane-table/src/types.tspackages/preact-table/src/createTableHook.tsxpackages/react-table/src/createTableHook.tsxpackages/react-table/tests/createAppColumnHelper.test-d.tsxpackages/solid-table/src/createTableHook.tsxpackages/svelte-table/src/createTableHook.svelte.tspackages/vue-table/src/createTableHook.tsIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Walkthrough#
This change updates app column definition types across eight table packages.
aggregatedCellnow uses the same boundcellComponentscontext ascell. A React type-level test covers accessor, display, and group helpers. Patch releases are declared.Changes#
Aggregated cell component typing
packages/angular-table/...,packages/lit-table/...,packages/octane-table/...,packages/preact-table/...,packages/react-table/...,packages/solid-table/...,packages/svelte-table/...,packages/vue-table/...AppColumnDefBase,AppDisplayColumnDef, andAppGroupColumnDefomit and re-declareaggregatedCellwith enhancedAppCellContexttypes. Documentation comments include the aggregated-cell context.packages/react-table/tests/createAppColumnHelper.test-d.tsx,.changeset/bound-aggregated-cell-components.mdPriority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~15 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
kevinvandyMerge Risk: ⚪ Minimal · up to
d91d7The type updates consistently bind registered cell components for aggregated cells without changing runtime behavior. No actionable merge risk remains.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
#6583and#6584. It omits and redeclaresaggregatedCellwithAppCellContextinAppColumnDefBase,AppDisplayColumnDef, andAppGroupColumnDeffor Angular, Lit, Octane, Preact,…aggregatedCelltype enhancements, related documentation comments, type-level coverage, and a changeset for the affected packages. These changes directly supp…Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 9 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share