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
jsx in ocaml #162
Comments
Should this be implemented as syntax extension, really? I think, in OCaml, one may define functions for html tags and then combine them, in usual manner, smth like — https://github.com/little-arhat/ocaml-fb-react-playground/blob/master/src/core.ml#L173 |
And why do you want react (and syntax extensions around it) in compiler or stdlib? There are many ways to handle UI, including many ways to handle virtual dom, some of them can be much more efficient in functional context than React (see elm's benchmarks). JaneStreet's guys now have some experiments with mixed approach https://github.com/janestreet/incremental. For me it looks like that such things definitely should be in different/side projects. And we'll help you, guys, with this stuff after release/beta ;) |
hi, thanks for your comments, this is just to raise some ideas,as you can see, I don't have time to implement it in the short term. but there are benefits of using a jsx syntax, easy to copy paste existing reactjs code and do static analysis |
@bobzhang you have "React binding" in Beta roadmap (near "Support goog.module"), so I thought it considered as must-have feature :)
Yes, and it can be done in library (for who want to copy paste react's code) |
(Side note: this is all already implemented: https://github.com/ocsigen/tyxml/) |
@Drup thanks for your link, I am aware of tyxml, it is slightly different here, jsx is mainly used for vdom(or react bindings), not for plain html |
Tyxml (and its syntax extension) also supports virtual dom via janestreet's bindings (see |
Just to clarify: Tyxml is not limited to textual html, it's a set of combinators that can be implemented on any html structure. For now, it's implemented on textual html (included in tyxml), dom tree (in jsoo), reactive dom trees (in jsoo with ocaml's React), virtual dom (the one I linked above) and client/server dom with reactive elements (in eliom). For all those structures you get the set of combinators, the typechecking and the html syntax extension directly. |
maybe delegated reasonml/reason#647 |
close it since reason are working on it |
for the record, we can do this once we have some basic bindings like
React.createElement
The text was updated successfully, but these errors were encountered: