-
Notifications
You must be signed in to change notification settings - Fork 42
Props types cleanup #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also, in the type _props<'ref> = {
ref: 'ref,
// all the other props
}
type domProps = _props<domRef>
type props = _props<domRef => unit> instead of keeping the definitions in sync manually? |
That is very good question! I’m still not solving the puzzle why I think next step of JSX v4 is changing the internal representation for the lowercase without |
@mattdamon108 Ok, so basically the props types are still WIP and you are planning to unify them soon as part of the JSX v4 work? The reason I was asking is that there are many open issues and PRs about some adding some missing prop, and it would be ideal to be able to do that in a single place. So if I want to add missing props now, I guess I should do it in the |
I understood what you need. @cristianoc Can I start now for v10.1 or next? IMHO, it would be better to change the internal representation for the lowercase at the same time. |
Starting now sounds good. A long way to say: why not make a plan and post on the forum for feedback. |
Good point. Let me leave thoughts here first, then refine them to post on the forum. |
Rough thoughts to ask to the forum:
Anything else? |
Something about the runtime representation. If they move from deriving abstract to something else, is user code affected? |
|
AFAIK the runtime representation is the same in both cases, just the JS object The question is if there is user code using the |
So with the changes in #63 any DOM props updates will be performed in a single place in the compiler repo's |
Agreed! |
Why is there actually module Props = {
type domProps = JsxDOM.domProps
...
type props = ...
}
include Props instead of just defining (The generated accessors for |
I have no answer about it, I'm wondering why too. It is included also in |
Maybe we should just deprecate everything in the type domProps = JsxDOM.domProps
/** DEPRECATED */
module Props = {
@deprecated("Please use type ReactDOM.domProps")
type domProps = JsxDOM.domProps
@deriving(abstract)
@deprecated("Please use type ReactDOM.domProps")
type props = {
...
}
} |
In my humble guess, maybe there was a need to contain two kind of props there? |
If so, |
JSX v3 is still using |
// ReactDOMRe.res
type domProps = JsxDOM.props Maybe it is needed too. |
Do you mean @deprecated("Please use type ReactDOM.domProps")
type props = JsxDOM.domProps in the root scope? I will create a PR. |
Actually not. I guess,
|
Ah, right, sorry, I misunderstood, overlooked the "Re" in ReactDOMRe". 😉 |
I think this is done now, at least as far as the rescript-react repo is concerned. |
@mattdamon108 I have a question regarding props types:
Why are domProps and props as defined in
rescript-react/src/ReactDOM.res
Line 58 in d5d9168
rescript-react/src/ReactDOM.res
Line 1085 in d5d9168
@deriving(abstract)
types and not just?
The text was updated successfully, but these errors were encountered: