fix(react-table): accept built-in fn names in legacy column helper - #6521
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthrough
ChangesLegacy feature registry support
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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. Comment |
7b9f0b3 to
32f7f4c
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/react-table/tests/useLegacyTable.test.tsx (1)
18-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for declaration-merged custom names.
These columns cover only built-in identifiers. The PR also preserves custom names added through declaration merging. Add a compile-time fixture that augments
FilterFns,SortFns, andAggregationFns, then constructs columns with those names. If the fixture runs throughuseLegacyTable, register matching implementations in the table options.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/react-table/tests/useLegacyTable.test.tsx` around lines 18 - 23, Extend the test fixture around legacyCreateColumnHelper and useLegacyTable to declaration-merge custom entries into FilterFns, SortFns, and AggregationFns, then construct columns using those custom names to provide compile-time coverage. If the columns are passed through useLegacyTable, add matching implementations to its table options.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/react-table/tests/useLegacyTable.test.tsx`:
- Around line 18-23: Extend the test fixture around legacyCreateColumnHelper and
useLegacyTable to declaration-merge custom entries into FilterFns, SortFns, and
AggregationFns, then construct columns using those custom names to provide
compile-time coverage. If the columns are passed through useLegacyTable, add
matching implementations to its table options.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2c12bf72-438c-4b0b-9347-b30afdb174fd
📒 Files selected for processing (3)
.changeset/legacy-column-helper-fn-names.mdpackages/react-table/src/useLegacyTable.tspackages/react-table/tests/useLegacyTable.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/react-table/src/useLegacyTable.ts
|
View your CI Pipeline Execution ↗ for commit 82905e8
☁️ Nx Cloud last updated this comment at |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
🎯 Changes
legacyCreateColumnHelperbindsStockFeatures, which carries nofilterFns,sortFns, oraggregationFnsregistry.ExtractAggregationFnKeysand its filter/sort counterparts then fall back to the declaration-merged interfaces, which are empty by default, soaggregationFn: 'mean'fails to type-check even thoughuseLegacyTablespreads all three built-in registries into the features it builds at runtime.The legacy types now use a
LegacyFeaturesset that extendsStockFeatureswith those three registries, so the string identifiers resolve. Names added through declaration merging keep working.Fixes #6520
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
New Features
Bug Fixes
Tests