Skip to content

Name the column of any table, and keep Column checked - #7

Closed
johanrd wants to merge 1 commit into
nvp/inferred-table-typesfrom
any-column
Closed

johanrd wants to merge 1 commit into
nvp/inferred-table-typesfrom
any-column

Conversation

@johanrd

@johanrd johanrd commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

On top of universal-ember#202 (60dafd9). An alternative to the CellArgs = any default in that commit, and to #4.

60dafd9 makes CellArgs default to any so that a column whose Cell asks for args fits a Column<DataType> parameter — which the plugin helpers need. It also makes the Cell of every column written by hand unchecked:

// 4.0.0:   ComponentLike<CellContext<Person>>   — @row and @column required
// 60dafd9: ComponentLike<any>                   — any args, none required
type Cell = Column<Person>['Cell'];

So <column.Cell /> with no args, or with args no Cell takes, now passes at any site that writes Column<T> by hand.

The two readings of Column<Person> cannot both hold: "a column I will render", which needs the Cell checked, and "a column I only read", which needs any column to fit. This gives the second one its own name.

  • AnyColumn and AnyTable are what the plugin helpers, meta.forColumn, the header modifier and the resize handle take.
  • CellArgs goes back to unknown, so Column<Person> is checked again.
  • Your takesAnyColumn and takesAnyTable in cell-args.test.ts say AnyColumn / AnyTable, and still pass.

88 lines of source across 11 files, against 250 in #4, which threaded the four parameters through every plugin signature instead. #4 can be closed either way.

Checked: the package, its type tests and test-app are clean. Our app — 13 tables, about 300 call sites — type checks and lints clean on this plus #6.

Cowritten by Claude

The args of a Cell are the args of a function, so a column that carries
them is not a column that carries none. Code that only reads a column —
a column menu, an export, a reordering helper — had to name those args
and then ignore them, in every signature it has.

These two say "any args" instead, and carry the row type and the column
meta such code does read.

Cowritten by Claude
@johanrd johanrd closed this Sep 22, 2026
@johanrd johanrd changed the title Add AnyColumn and AnyTable Name the column of any table, and keep Column checked Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant