Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Declaration merging makes typing per-table meta difficult #4220

Unanswered
wyozi asked this question in Ideas
Discussion options

Hey, I really liked the ability to specify per-table meta types on a per-table basis with table.setRowType. I'm working on an application that has many kinds of tables with different meta functions all over the codebase, so declaration merging causes extraneous meta function definitions and all kinds of other issues.

Would it be possible to add a method to still be able to specify meta types on a per-table basis?

You must be logged in to vote

Replies: 5 comments 1 reply

Comment options

This would require a return to the insane generics. I doubt the benefits would outweigh the increased friction on types.

You must be logged in to vote
1 reply
Comment options

What if you add a second generic for TableMeta to createColumnHelper?

Comment options

This is also something i was looking for recently. Whilst the meta option is definitely great; being able to have independent types for each table would help keep things a bit more tidy. Can understand why you wouldn't want to go down that route though @tannerlinsley

You must be logged in to vote
0 replies
Comment options

I found this discussion just before I was going to post about it. I don't like the insane generics thing too (and v7 added more problems with that as we had to define global types per the plugins we used). I would love to hear if someone found a solution to it. currently, I just add more props to meta, but I have no way to understand which types are related...

I do think adding a generic for meta is the solution here

You must be logged in to vote
0 replies
Comment options

I’m strongly in favor of restoring a per-table meta-type setter. In large codebases where dozens of tables each carry a different row-meta contract, forcing all meta functions into a single merged global interface quickly becomes unmanageable... duplicate definitions and unintended meta callbacks get pulled into tables where they don’t belong.

You must be logged in to vote
0 replies
Comment options

I don't think this would be so insane if the columnHelper and/or the table hook would accept an optional meta generic.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /