Closed Drup closed 4 years ago
Alright, the tests finally pass.
<Svg.Line> .... </Svg.Line>
. The first letter is turned lowercase (apparently, it's not syntactically valid to put a lowercase there ....).<> ..... </>
is now recognized and supportedCurrent issues:
...{foo}
. Unfortunately, the spread operator is super limited in where you can put it, which makes it impossible to write several things that the PPX would accept. For instance [%html "<p>bar" elt1 "foo" elt2 "baz</p>"]
should translate to <p> "bar" ...{elt1} "foo" ...{elt2} "baz" </p>
which isn't allowed<Tyxml.element />
to locally enable tyxml's jsx.I added the toggle. The syntax is [@@@tyxml.jsx bool]
in ocaml, and [@tyxml.jsx bool];
in reason.
@Khady I'm highly tempted to change the antiquotes so that in <foo> "bar" other </foo>
, other
must be a list of elements instead of a single one. A single element would be inserted by ([other])
(which is kinda verbose), and hopefully at some point, we can make reason accept [other]
(without parens).
This would be much more consistent with the ppx, and more expressive.
Hmm I’m probably not the best person to ask as I’m not using jsx extensively. But I tend to believe that I prefer the current setup.
I think keeping somewhat close to the react ppx would be preferable. I would rather have to spread a list than always wrap things with lists.
My issue is that the spread operator is only available if it's the only child. You can't write <> "foo" ...bar </>
.
Everything's green, let's merge the current version! I kept the antiquotations as before.
@Khady @ulrikstrid I'll let you test this for a week. If someone's motivated to write a reason-inclined documentation, I would appreciate it as well ^^'
Follow up of #247
cc @Khady @jorisgio @ulrikstrid