Skip to content

Conversation

@cknitt
Copy link
Member

@cknitt cknitt commented Oct 1, 2022

@cknitt cknitt requested a review from mununki October 1, 2022 07:06
@zth
Copy link
Member

zth commented Oct 1, 2022

Vaguely related, but has there been discussions recently on if we can tackle specializing the dom props types so they match each HTML element? Ie div doesn't have the same dom props as input, etc.

@cristianoc
Copy link
Collaborator

cristianoc commented Oct 1, 2022

Vaguely related, but has there been discussions recently on if we can tackle specializing the dom props types so they match each HTML element? Ie div doesn't have the same dom props as input, etc.

In general, that requires an ad-hoc mechanism outside the language (e.g. some special computation in the JSX), or some form of subtyping.
It might be that the hypothetical type t2 = {...t, x:s} mechanism would help.

Perhaps even just describing what those types should look like would be useful as that would allow to answer the question of what mechanism is required.

@mununki
Copy link
Member

mununki commented Oct 1, 2022

Vaguely related, but has there been discussions recently on if we can tackle specializing the dom props types so they match each HTML element? Ie div doesn't have the same dom props as input, etc.

That would be worthy. Currently some fields in domProps only related to specific element, such as "x", "x1, "x2" is for <svg />. Maybe we can define multiple domProps per each specific element later.

@mununki
Copy link
Member

mununki commented Oct 1, 2022

It might be that the hypothetical type t2 = {...t, x:s} mechanism would help.

This syntax will make defining domProps tasks much easier!

@cristianoc
Copy link
Collaborator

One reason for describing the types in some form is to help see exactly how much expressivity is required.
E.g. if {...t, x: is enough or {...s, ...t} is required where 2 types are combined. E.g if there are 5 types s each of which needs to be extended with the same 72 fields t.

@cknitt
Copy link
Member Author

cknitt commented Oct 1, 2022

Can we move the discussion to a separate issue and merge the PR?

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.

5 participants