Found while implementing #5853 (folding column-inference values onto the declared TableColumn.type vocabulary at each producer's emit seam). Filed unassigned; deliberately NOT absorbed into #5853, whose fence is the type key's VALUE set.
Measured (at e4559d1e0)
#6004 records that ObjectGrid.generateColumns() is untyped, so nothing type-checks what it writes into the strictly-typed DataTableSchema.columns: TableColumn[] slot. There is a second producer with the same hole, and #6004 names only the first.
packages/plugin-dashboard/src/ObjectDataTable.tsx — enrich() returns:
return{ ...col, ...fieldMeta,align: inferredAlign, cell };fieldMeta is a FieldMeta built by buildFieldMeta (recordFields.tsx:145-155), whose members are name, label, type, options, referenceTo, format, currency, decimals. Spreading it writes seven keys TableColumn does not declare into a TableColumn slot: label, options, referenceTo, format, currency, decimals (and name, which is the held alias #5120 covers).
It is invisible to tsc for the same structural reason as #6004: NormalizedColumn carries [key: string]: any, and the array is handed to data-table without ever being checked against TableColumn[].
Why it matters
Same class as #5453 (a wrap key forwarded that nothing reads) and #6004, from the producer side. declared != enforced in the direction where the producer writes more than the type admits: the keys are inert unless the renderer happens to read them, and nothing signals which. #5853 fixed one key's VALUE divergence at this exact seam and had to establish by hand that these other keys were out of its scope — the next such card will have to do the same until the boundary is typed.
Suggested disposition
This is #6004's remedy applied to the second producer, hence filed as its sub-issue: type the producer's output boundary (annotate the return as TableColumn[]), then triage each undeclared key it surfaces as declare / retire / hold-as-alias. type is already handled — #5853 folds it at this seam.
Related
Generated by Claude Code
Generated by Claude Code
Found while implementing #5853 (folding column-inference values onto the declared
TableColumn.typevocabulary at each producer's emit seam). Filed unassigned; deliberately NOT absorbed into #5853, whose fence is thetypekey's VALUE set.Measured (at
e4559d1e0)#6004 records that
ObjectGrid.generateColumns()is untyped, so nothing type-checks what it writes into the strictly-typedDataTableSchema.columns: TableColumn[]slot. There is a second producer with the same hole, and #6004 names only the first.packages/plugin-dashboard/src/ObjectDataTable.tsx—enrich()returns:fieldMetais aFieldMetabuilt bybuildFieldMeta(recordFields.tsx:145-155), whose members arename,label,type,options,referenceTo,format,currency,decimals. Spreading it writes seven keysTableColumndoes not declare into aTableColumnslot:label,options,referenceTo,format,currency,decimals(andname, which is the held alias #5120 covers).It is invisible to tsc for the same structural reason as #6004:
NormalizedColumncarries[key: string]: any, and the array is handed todata-tablewithout ever being checked againstTableColumn[].Why it matters
Same class as #5453 (a
wrapkey forwarded that nothing reads) and #6004, from the producer side.declared != enforcedin the direction where the producer writes more than the type admits: the keys are inert unless the renderer happens to read them, and nothing signals which. #5853 fixed one key's VALUE divergence at this exact seam and had to establish by hand that these other keys were out of its scope — the next such card will have to do the same until the boundary is typed.Suggested disposition
This is #6004's remedy applied to the second producer, hence filed as its sub-issue: type the producer's output boundary (annotate the return as
TableColumn[]), then triage each undeclared key it surfaces as declare / retire / hold-as-alias.typeis already handled — #5853 folds it at this seam.Related
generateColumns()is untyped (any[]), so nothing type-checks what it writes intoDataTableSchema.columns: TableColumn[]— the hole that hid #5853 and #5453 #6004 — the same hole atObjectGrid.generateColumns()(parent)TableColumn.typedisagrees three ways — interface declares 8 literals, zod mirror accepts any string, renderer's live read set handles values outside the union via anas anycast #5853 — thetypekey's value-level divergence, fixed at this same seamwrapinto the DataTable column object, but nothing indata-table.tsxever reads it #5453 — an undeclaredwrapkey forwarded by the other producercol.name别名,而唯一在交付前解析列身份的生产者只有 RelatedList #5120 — thecol.namealias, the one member of this set already adjudicatedGenerated by Claude Code
Generated by Claude Code