ml-in-barcelona / jsoo-react

js_of_ocaml bindings for ReactJS. Based on ReasonReact.
https://ml-in-barcelona.github.io/jsoo-react
MIT License
138 stars 19 forks source link

Don't require to open Dsl when using Reason #142

Closed davesnx closed 2 years ago

davesnx commented 2 years ago

Right now you need to open React.Dom.Dsl.Html when using Reason, which I believe we could avoid it (and have a similar experience as BuckleScript) and transform div calls into React.Dom.Dsl.Html.div automatically by the PPX.

glennsl commented 2 years ago

This was discussed briefly here. In short, the problem is that it would only work for Html, not Svg or any other namespace we, or third-parties, might choose to implement in the future. Unless there's some way to "escape" the hard-coding.

davesnx commented 2 years ago

Sure, just wanted to open an issue (it should have been a Discussion) to talk more about it. The last time I read something about it was on the PR related to the PPX https://github.com/ml-in-barcelona/jsoo-react/pull/128#issuecomment-1024908940

I tend to believe that the reason version of this library should be 1to1 with reason-react just for the sole purpose of migrating from one to the other, this is a tiny difference thought.

I saw you mention a few places, why wouldn't work for SVG?

Nevermind, I will close this issue and open a Discussion instead