jstransform failed
riobard opened this issue · 4 comments
riobard commented
Test file hi.js
:
/** @jsx React.DOM */
'use strict';
var React = require('react');
var Foo = React.createClass({
getInitialState: () => ({}),
render: () => <div />,
});
$ browserify -t [ reactify --es6 ] hi.js
Error: Parsing file /tmp/hi.js: Line 5: Unexpected token )
react-tools
v0.10 supports --harmony
flag which also uses jstransform
. It can deal with the test file correctly:
$ jsx --harmony < hi.js
built Module("<stdin>")
/** @jsx React.DOM */
'use strict';
var React = require('react');
var Foo = React.createClass({displayName: 'Foo',
getInitialState: function() {return {};}),
render: function() {return React.DOM.div(null );},
});
Is there any plan to default to that instead?
riobard commented
Hmm, I think it's a jstransform
bug. Closing now for further investigation.
riobard commented
This is indeed a jstransform
bug. See https://github.com/facebook/jstransform/issues/10 for followup.
andreypopp commented
I've bumped jstransform to 0.4.0 and tested your issue — now it works. Released reactify 0.12.0. Thanks for the report!
riobard commented
That's fast! :) 👍