Skip to content

Let the plugins take a column whose Cell asks for args - #4

Closed
johanrd wants to merge 3 commits into
nvp/inferred-table-typesfrom
plugin-cell-args-variance
Closed

johanrd wants to merge 3 commits into
nvp/inferred-table-typesfrom
plugin-cell-args-variance

Conversation

@johanrd

@johanrd johanrd commented Sep 22, 2026

Copy link
Copy Markdown
Owner

On top of universal-ember#202 (cfbb714).

A Cell's args sit in the args of Cell, so they are contravariant. A column that carries them does not fit the Column<DataType> parameter the plugin helpers ask for, so a table with such a Cell can use no plugin at all. The args are inferred, so an app cannot work around it.

The helpers, the plugin methods they call and meta.forColumn now take the column meta, the table meta and the cell args, the way columnsFor already does. One internal constraint keeps any for the cell args, where it stands for a column of any table.

plugins-with-cell-args.test.ts covers it: 10 errors without this change, none with it. tsc, prettier and eslint are clean on the package.

Cowritten by Claude

The cell args sit in the args of `Cell`, so they are contravariant: a
column that carries them does not fit a `Column<DataType>` parameter.
The plugin helpers still asked for that, so a table with such a Cell
could use no plugin at all. The args are inferred, so an app could not
work around it.

The helpers, the plugin methods they call and `meta.forColumn` now take
the column meta, the table meta and the cell args, the way `columnsFor`
already does. One internal constraint keeps `any` for the cell args,
where it stands for a column of any table.

Cowritten by Claude
`ColumnOrder` holds the columns it orders, so it needs the same
parameters as the helpers. The plugin keeps one for its own table and
does not read the Cells, so it holds the widest shape.

Cowritten by Claude
`table.modifiers.columnHeader` and `resizeHandle` are given a column in
a template, so they meet the same wall as the helpers. The plugin column
API holds the widest shape, because a plugin is handed whatever column
the table has.

Cowritten by Claude
@johanrd

johanrd commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

closing, see universal-ember@60dafd9

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