google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.18k stars 580 forks source link

Finish JSX support #1998

Closed arv closed 8 years ago

arv commented 8 years ago

We now support JSX using the jsx option. However we do not yet support JSXSpreadAttribute.

JSXSpreadAttribute :
  { ... AssignmentExpression }
unbug commented 8 years ago

I can't find any document to how to use this feature, and the online demo looks not support JSX yet, do I miss sth?

arv commented 8 years ago

The option jsx is not on by default.

http://google.github.io/traceur-compiler/demo/repl.html#%2F%2F%20Options%3A%20--jsx%0A%0A%3Ca%20b%3D%22c%22%20d%3D%7B42%7D%2F%3E

and with a custom React.createElement function:

http://google.github.io/traceur-compiler/demo/repl.html#%2F%2F%20Options%3A%20--jsx%3Ddummy%0A%0Afunction%20dummy()%20%7B%7D%0A%0A%3Ca%20b%3D%22c%22%20d%3D%7B42%7D%2F%3E

arv commented 8 years ago

This bug has been fixed:

http://google.github.io/traceur-compiler/demo/repl.html#%2F%2F%20Options%3A%20--jsx%0A%0Aconst%20o%20%3D%20%7B%0A%20%20a%3A%20'c'%2C%0A%20%20d%3A%2042%2C%0A%7D%3B%0A%0A%3Ca%20%7B...o%7D%2F%3E