You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the merge of #66, the code has full control over the types of makeProps. Many props are defined as string when in reality (the HTML spec) doesn't allow any string and defines an enum or some sort of combination. It might happen to some props that are defined as int or bool as well.
The benefit from moving away from string-based API are:
Safety, within a string there could be a typo without noticing it.
Learnability. Users might be able to learn about HTML and their APIs.
Correctness, generate valid HTML does have a good impact on on-page SEO.
There have been a few efforts on rescript-react to push that direction but didn't land yet (a few comments by @dodomorandi in rescript-lang/syntax#235) and I'm not sure if there's a positive intent to do so.
Further investigations are on my plate, where I might try to change the html.ml list of attributes into per-element basis and ensure that the generated HTML from React components is valid.
The text was updated successfully, but these errors were encountered:
After the merge of #66, the code has full control over the types of
makeProps
. Many props are defined asstring
when in reality (the HTML spec) doesn't allow any string and defines an enum or some sort of combination. It might happen to some props that are defined asint
orbool
as well.The benefit from moving away from string-based API are:
There have been a few efforts on
rescript-react
to push that direction but didn't land yet (a few comments by @dodomorandi in rescript-lang/syntax#235) and I'm not sure if there's a positive intent to do so.We have the possibility to do it.
Other references:
The plan for this is to check TyXML and https://html.spec.whatwg.org/#global-attributes and manually ensure that most of our attributes make sense.
Further investigations are on my plate, where I might try to change the
html.ml
list of attributes into per-element basis and ensure that the generated HTML from React components is valid.The text was updated successfully, but these errors were encountered: