Commit Graph

10 Commits

Author SHA1 Message Date
Jeff Morrison
b5a11a431e Merge pull request #336 from spicyj/jsx-spacing
JSX: Respect original spacing and newlines better
2013-09-20 10:59:21 -07:00
Ben Alpert
f69112cb3f JSX: Respect original spacing and newlines better
Fixes #335.

Now this JSX:

```
/** @jsx React.DOM */
var HelloMessage = React.createClass({
  render: function() {
    return <div>
      Look!
      <a href=
        "http://www.facebook.com/">Facebook
      </a>
    </div>;
  }
});
```

produces

```
/** @jsx React.DOM */
var HelloMessage = React.createClass({displayName: 'HelloMessage',
  render: function() {
    return React.DOM.div(null,
      " Look! ",
      React.DOM.a( {href:
        "http://www.facebook.com/"}, "Facebook "
      )
    );
  }
});
```

rather than the less-desirable

```
/** @jsx React.DOM */
var HelloMessage = React.createClass({displayName: 'HelloMessage',
  render: function() {
    return React.DOM.div(null,
" Look! ",      React.DOM.a( {href:"http://www.facebook.com/"}, "Facebook "      ),
    );
  }
});
```
2013-09-10 17:14:36 -07:00
Paul O’Shannessy
d83fe785c5 Stop transforming class -> className
Update the broken examples too (`git grep class=`)
2013-09-09 15:37:43 -07:00
JeffMo
2d048f1f34 Move to using jstransform and esprima-fb npm modules 2013-08-22 15:28:41 -07:00
Paul O’Shannessy
91562ba934 Sync JSX tags from upstream
This is the other part of fc5f7e0e85. This
file isn't part of our sync process so needs to be done separately.
2013-07-08 12:51:11 -07:00
JeffMo
9c35189ad1 Add support for empty XJS expressions 2013-06-28 13:10:20 -07:00
Paul O’Shannessy
06cff60bc1 Sync latest JSX transform - all children passed as separate arguments
This was a part of e1fe13d0cb upstream.
2013-06-13 18:18:54 -07:00
Paul Seiffert
510ced1d13 Removed duplicate object type check 2013-05-31 07:13:49 +02:00
Paul Seiffert
b03f04ff24 Fixing Bug in JSX transformer
The bug fixed by this commit prevented the correct parsing of
`var` statements with multiple variables being declared. Instead
of trying to parse a whole 'variable declarations' (a `var`
statement with all its declarations), this visitor now only
parses single 'variable declarators'.
2013-05-30 20:51:15 +02:00
Paul O’Shannessy
75897c2dcd Initial public release 2013-05-29 12:54:02 -07:00