-
Notifications
You must be signed in to change notification settings - Fork 473
Rewrite JsxDOM.ml to res #5723
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
Rewrite JsxDOM.ml to res #5723
Conversation
|
I guess I should have run |
jscomp/others/jsxDOM.res
Outdated
| @@ -0,0 +1,621 @@ | |||
| /* Copyright (C) 2015-2016 Bloomberg Finance L.P. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bloomberg Finance does not seem right to me.
@cristianoc What should the copyright header be like for new files?
Maybe
Copyright (C) 2022- Authors of ReScript
or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then we should probably also add this to the CONTRIBUTING doc, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated 23f5fe0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are quite a few properties that are strings now and could actually be enums (I listed a few of them below). But maybe we do that in a separate cleanup?
jscomp/others/jsxDOM.res
Outdated
| @as("aria-autocomplete") ariaAutocomplete?: [#inline | #list | #both | #none], | ||
| /* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */ | ||
| @as("aria-checked") | ||
| ariaChecked?: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unified formatting across this file would be nice. I.e. have this on one line, and run the formatter over the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I ran the formatter too, in my case it added a line-break 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make it to one line, it looks better.
|
@cknitt I've changed most of string types you mentioned to enum. I've referred to mdn docs. |
|
Thanks! There will be more props that are actually enums though, e.g. Maybe we should do the enum conversion separately and make sure it is complete? |
Sounds good to me. |
|
Ah, right, sorry, confused it with https://developer.mozilla.org/en-US/docs/Web/CSS/text-underline-position. |
Ah! |
|
Yes, googled it wrong. 😉 Still, I feel we should do the string -> enum conversions in a separate PR, possibly together with #5713. |
|
Is this for existing props or new props not exposed before? |
|
So yes I guess separate PR. |
|
@cknitt I mistakenly dropped the |
|
@cknitt I think I'm done with this PR. Could you check another round? |
|
This looks good to me. Would you mention the deprecated fields in the CHANGELOG? |
cknitt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattdamon108 Looks good to me! 👍
|
cristianoc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ready to go
I know that
JsxDOMneeds to be rewritten anyway when the new record extension is landed. But this PR would improve such things from current.#"true"instead#_truebegin_,end_,to_are deprecated, nowbegin,end,toare available