4 ms·
We do actually want JSX to be flexible and usable for not just React, which is why we're trying to write a formal specification of the syntax with multiple pars
by spicyj 12y ago
We do actually want JSX to be flexible and usable for not just React, which is why we're trying to write a formal specification of the syntax with multiple parser implementations:
http://facebook.github.io/jsx/ http://facebook.github.io/jsx/
We intentionally don't specify semantics to give different transpilers the flexibility to compile the JSX into whatever's appropriate for the library you're using.
- sebmarkbage 12y agoYea, note that mithril is on that list. The syntax was where people unified. There wasn't agreement on semantics and this is moving closer to that. It's possible that this will eventually unify again. E.g. around a replacement for an object literal. E.g. a standard record type.
- simplify 12y agoA specification is great, and I'm happy to see that. However, even though it's true that transpilers can compile JSX with arbitrary semantics, it still requires writing your own transpiler. JSX is a great syntax, and these changes mean nothing if you're a transpiler writer. What I was hoping for was the JSX transpiler that React uses would become flexible enough for any library to use, without the need to modify/rewrite the transpiler itself. Yes it's possible for someone else to write something like this, but writing a compiler is no small feat =/
- malandrew 12y agoJSX is a great syntax It's really not. It's just mixing syntaxes to solve the problem that mixed syntaxes causes. Higher order functions (i.e. createFactory) is a much better solution.
- mehh 12y agoReact looks interesting JSX does not. I was considering using React for my next project , but I really do not want JSX or Coffescript or any of this other crap. Dojo suffered terribly by having a split brain, I think you guys a following a well worn path. I don't care if JSX is this or that, I simply have no interest in using or learning it because its not significant enough nor applicable outside of your framework and enforces anyone else who I work with to also adopt it. This isn't just my opinion, having discussed using React this was the general consensus in a team of very different people, I stated that its fine because you don'e need to use JSX ... but at the moment it looks like you are focusing on moving developers in the direction we don't want to go.