Skip to content

Keep the Cell of a column checked, and let any column be read - #204

Merged
NullVoxPopuli merged 1 commit into
universal-ember:mainfrom
johanrd:any-column-main
Sep 23, 2026
Merged

NullVoxPopuli merged 1 commit into
universal-ember:mainfrom
johanrd:any-column-main

Conversation

@johanrd

@johanrd johanrd commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

#202 defaults CellArgs to any so a column with cell args fits Column<DataType>, which the plugin helpers need. It also stops checking the Cell of every column written by hand:

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

In cells-test.gts on main, both @glint-expect-error directives report as unused: rendering a Cell with no args at all is no longer an error. Here they are consumed again.

Both properties hold if the Cell is read through a type whose [Invoke] is a method. ComponentLike declares it as a property, and the parameters of a property function are contravariant — hence the any. Method parameters are compared bivariantly, so such a column fits a parameter that names no args, while the args are still checked where the Cell is rendered.

ColumnConfig.Cell keeps ComponentLike, so a Cell is still checked against its column's meta and the table meta. Only the read side, Column.Cell, changes. The default goes back to unknown, the plugin helpers are untouched, and takesAnyColumn / takesAnyTable pass unchanged.

Cowritten by Claude

@johanrd
johanrd marked this pull request as draft September 23, 2026 11:33
universal-ember#202 makes `CellArgs` default to `any` on `Column` and `Table`, so that a
column whose Cell asks for args fits a `Column<DataType>` parameter,
which the plugin helpers need.

It also stops checking the Cell of every column written by hand.
`Column<Person>['Cell']` is `ComponentLike<any>`: it takes any args and
requires none, not even `@row` and `@column`. On 4.0.0 it was
`ComponentLike<CellContext<T>>`.

Both hold if the Cell is read through a type whose `[Invoke]` is a
method. TypeScript compares the parameters of a method bivariantly, so
such a column fits a parameter that names no args, while the args are
still checked where the Cell is rendered. The config keeps
`ComponentLike`, so a Cell is still checked against its column's meta.

The default goes back to `unknown`. The plugin helpers are untouched.

Cowritten by Claude
@johanrd johanrd changed the title Name the column of any table, and keep Column checked Keep the Cell of a column checked, and let any column be read Sep 23, 2026
@johanrd
johanrd marked this pull request as ready for review September 23, 2026 12:41
@NullVoxPopuli NullVoxPopuli added the bug Something isn't working label Sep 23, 2026
@NullVoxPopuli
NullVoxPopuli merged commit 96442e7 into universal-ember:main Sep 23, 2026
15 of 16 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 23, 2026
NullVoxPopuli pushed a commit that referenced this pull request Sep 23, 2026
#204 made Cell a CellComponent. Inferring from ComponentLike gives any,
so the three checks from #203 fail on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants