Skip to content

Polyvariant attributes: to bump or not to bump #10

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

Closed
dodomorandi opened this issue Feb 18, 2021 · 3 comments
Closed

Polyvariant attributes: to bump or not to bump #10

dodomorandi opened this issue Feb 18, 2021 · 3 comments

Comments

@dodomorandi
Copy link

First of all, thank you for this project. I think that it should be mentioned in reason-react repo and website, your work deserves much more attention from outside 😊 .

Said that, I was interested to open a PR for something I wanted for a long time: support for polyvariant attributes. However, just a few days ago rescript 9.0 came out, and because its intrinsic major breaking change, they decided to make the syntax clearer.
The question is: should I make a PR for the 8.3 version using the older syntax or should I bump bs-platform to 9 and use the new syntax?
Obiously, if you intend to postpone this feature for future releases, just close the issue for now without worries.
Thanks again for your work!

@ryyppy
Copy link
Member

ryyppy commented Feb 23, 2021

not sure what you are asking here. What parts of rescript/react do you want to bump to polyvariants?

@dodomorandi
Copy link
Author

I am going to use an example to make things more clear.
Take the very first commented property in domProps:

/* [@optional] [@as "aria-current"] ariaCurrent: page|step|location|date|time|true|false, */

This could not be expressed using Reason syntax, with Rescript it is possible.

This is how I would write in with bs-platform 8.3:

@optional @as("aria-current")
ariaCurrent: [#page | #step | #location | #date | #time | #\"true" | #\"false"],

This is the same thing using the syntax of bs-platform 9.0.

@optional @as("aria-current")
ariaCurrent: [#page | #step | #location | #date | #time | #"true" | #"false"],

In theory, next release of rescript-react could use bs-platform 9.0, therefore it could make sense to use the newer (and clearer) syntax. But if you think that for now it is better to stick with bs-platform 8.x, I am going to use the old syntax to make the PR 😊

@dodomorandi
Copy link
Author

Closing this, because as discussed in #12, all props will be implemented using a ppx, therefore it is not about "how to implement" polyvariants but how the ppx is going to handle the codegen.

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 a pull request may close this issue.

2 participants