-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: table internal and tests, lower intantiations more #6322
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,10 +42,10 @@ export type Column< | |
| > = Column_Core<TFeatures, TData, TValue> & | ||
| ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>> | ||
|
|
||
| export type Column_Internal< | ||
| TFeatures extends TableFeatures, | ||
| TData extends RowData, | ||
| export interface Column_Internal< | ||
| in out TFeatures extends TableFeatures, | ||
| in out TData extends RowData, | ||
| TValue = unknown, | ||
| > = Column<TFeatures, TData, TValue> & { | ||
| > extends Omit<Column_Core<TFeatures, TData, TValue>, 'columnDef'> { | ||
| columnDef: ColumnDefBase_All<TFeatures, TData, TValue> | ||
| } | ||
|
Comment on lines
+45
to
51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Identify all Column_Internal usages and `as any` casts related to column types
echo "=== All Column_Internal usages ==="
rg -n 'Column_Internal<' --type=ts -C 1
echo ""
echo "=== Column type casts to any (potential type gaps) ==="
rg -n 'column.*as any' --type=ts -C 2
echo ""
echo "=== FilterFn and callback signatures expecting column parameters ==="
rg -nP 'autoRemove.*\(|getColumnCanGlobalFilter.*\(' --type=ts -C 2Repository: TanStack/table Length of output: 50370 🏁 Script executed: # Read the Column_Internal definition and related types
cat -n packages/table-core/src/types/Column.ts | sed -n '40,65p'Repository: TanStack/table Length of output: 561 🏁 Script executed: # Look at FilterFn type definition and autoRemove signature
rg -n 'interface FilterFn|type FilterFn' --type=ts -A 10Repository: TanStack/table Length of output: 3792 🏁 Script executed: # Find getColumnCanGlobalFilter callback signature
rg -n 'getColumnCanGlobalFilter' packages/table-core/src --type=ts -B 2 -A 2Repository: TanStack/table Length of output: 2502 🏁 Script executed: # Find ColumnFilterAutoRemoveTestFn definition
rg -n 'ColumnFilterAutoRemoveTestFn' packages/table-core/src --type=ts -B 1 -A 5Repository: TanStack/table Length of output: 1677 🏁 Script executed: # Get the full getColumnCanGlobalFilter signature
rg -n 'getColumnCanGlobalFilter' packages/table-core/src/features/global-filtering/globalFilteringFeature.types.ts -A 8Repository: TanStack/table Length of output: 346 🏁 Script executed: # Check if Column_Internal ever intersected with Column (check git or find evidence of expected type)
cat -n packages/table-core/src/types/Column.ts | sed -n '39,75p'Repository: TanStack/table Length of output: 603 🏁 Script executed: # Verify these are the only two production code as any casts related to this issue
# Filter out test files and examples
rg -n 'column.*as any' packages/table-core/src --type=ts | grep -v test | grep -v exampleRepository: TanStack/table Length of output: 359 🏁 Script executed: # Check context around the function that uses these callbacks
cat -n packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts | sed -n '310,335p'Repository: TanStack/table Length of output: 773 Type narrowing in The type definition of
Adjust the callback signatures to accept 📍 Affects 3 files
🤖 Prompt for AI Agents |
||
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.
Type cast removal at line 367 reflects
Column_Internalnarrowing.The explicit cast previously applied to
leafColumnsByIdhas been removed, and at lines 371 and 405, theorderedLeafColumnsarrays now use the publicColumn<TFeatures, TData, unknown>type instead ofColumn_Internal<...>.This change is consistent with the
Column_Internaltype narrowing inColumn.ts(lines 45-51): sinceColumn_Internalno longer includes feature-specific types, this code switched to the publicColumntype to preserve the full type contract.However, this creates an inconsistency with
columnFilteringFeature.utils.tsandglobalFilteringFeature.utils.ts, which useas anycasts instead of switching toColumn. The mixed approaches suggest the type refactor may not have a consistent resolution strategy.🤖 Prompt for AI Agents