Skip to content

Conversation

@mununki
Copy link
Member

@mununki mununki commented Oct 4, 2022

I know that JsxDOM needs to be rewritten anyway when the new record extension is landed. But this PR would improve such things from current.

  • aria-* attribute with proper polymorphic variant expression e.g. #"true" instead #_true
  • OCaml reserved keyword begin_, end_, to_ are deprecated, now begin, end, to are available

@mununki mununki requested a review from cknitt October 4, 2022 02:00
@mununki
Copy link
Member Author

mununki commented Oct 4, 2022

I guess I should have run make artifacts?

@@ -0,0 +1,621 @@
/* Copyright (C) 2015-2016 Bloomberg Finance L.P.
Copy link
Member

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks good

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated 23f5fe0

Copy link
Member

@cknitt cknitt left a 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?

@as("aria-autocomplete") ariaAutocomplete?: [#inline | #list | #both | #none],
/* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */
@as("aria-checked")
ariaChecked?: [
Copy link
Member

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.

Copy link
Member Author

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 🤷‍♂️

Copy link
Member Author

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.

@mununki mununki requested a review from cknitt October 4, 2022 12:19
@mununki
Copy link
Member Author

mununki commented Oct 4, 2022

@cknitt I've changed most of string types you mentioned to enum. I've referred to mdn docs.

@cknitt
Copy link
Member

cknitt commented Oct 4, 2022

Thanks! There will be more props that are actually enums though, e.g. underlinePosition.

Maybe we should do the enum conversion separately and make sure it is complete?

@mununki
Copy link
Member Author

mununki commented Oct 4, 2022

Thanks! There will be more props that are actually enums though, e.g. underlinePosition.

Maybe we should do the enum conversion separately and make sure it is complete?

Sounds good to me.
Not sure underlinePosition can be a enum? Is it https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/underline-position?

@cknitt
Copy link
Member

cknitt commented Oct 4, 2022

Ah, right, sorry, confused it with https://developer.mozilla.org/en-US/docs/Web/CSS/text-underline-position.

@mununki
Copy link
Member Author

mununki commented Oct 4, 2022

Ah, right, sorry, confused it with https://developer.mozilla.org/en-US/docs/Web/CSS/text-underline-position.

Ah! text-underline-position seems CSS property though. 😃

@cknitt
Copy link
Member

cknitt commented Oct 4, 2022

Yes, googled it wrong. 😉

Still, I feel we should do the string -> enum conversions in a separate PR, possibly together with #5713.
@cristianoc what do you think?

@cristianoc
Copy link
Collaborator

Is this for existing props or new props not exposed before?
If existing, enums are a breaking change right.

@cristianoc
Copy link
Collaborator

So yes I guess separate PR.

@mununki
Copy link
Member Author

mununki commented Oct 4, 2022

Is this for existing props or new props not exposed before? If existing, enums are a breaking change right.

Oops, you're right. I think 23f5fe0 should be reverted, too many breaking I guess. What do you think @cknitt ?
Revert it and separated PR would be better.

@cknitt
Copy link
Member

cknitt commented Oct 4, 2022

23f5fe0 is the copyright only?
a2021bd should be reverted I think.

@mununki
Copy link
Member Author

mununki commented Oct 4, 2022

a2021bd

Oops, confused my turn 😉 Yes, a2021bd is correct.

@mununki
Copy link
Member Author

mununki commented Oct 4, 2022

@cknitt I reverted it 1f63c87 except ariaChecked which is not existed one.

@mununki
Copy link
Member Author

mununki commented Oct 4, 2022

@cknitt I mistakenly dropped the children field from JsxDOM.ml, I added it back.

@mununki
Copy link
Member Author

mununki commented Oct 5, 2022

@cknitt I think I'm done with this PR. Could you check another round?

@cristianoc
Copy link
Collaborator

This looks good to me. Would you mention the deprecated fields in the CHANGELOG?

Copy link
Member

@cknitt cknitt left a 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! 👍

@mununki
Copy link
Member Author

mununki commented Oct 5, 2022

This looks good to me. Would you mention the deprecated fields in the CHANGELOG?

20d6003

Copy link
Collaborator

@cristianoc cristianoc left a 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

@mununki mununki merged commit f8d1d3a into 10.1_release Oct 5, 2022
@mununki mununki deleted the rewrite-jsxdom branch October 5, 2022 23:00
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.

4 participants