Commit Graph

37 Commits

Author SHA1 Message Date
Paul O'Shannessy 5b17e75707 Support more properties for image maps
Supporting the `<area>` tag is pretty useless if we don't support the necessary properties.
2014-06-30 20:54:44 -07:00
Paul O’Shannessy 5eb57fa51b Add support to JSX transform for <hyphenated-tags>
This only adds support for whitelisted tags, not arbitrary ones.

Closes #1539
2014-06-30 20:54:41 -07:00
Sebastian Markbage e6134c307e [react jsx transform] Spread attribute -> Object.assign
Add support for spread attributes. Transforms into an Object.assign just
like jstransform does for spread properties in object literals.

Depends on https://github.com/facebook/esprima/pull/22
2014-06-26 15:40:02 -07:00
Paul O’Shannessy af1af19d39 Sync out transform tests 2014-06-19 15:14:54 -04:00
Paul O’Shannessy 2c85658c69 [jsx] Make sure we throw when we get XML namespaces
https://github.com/facebook/esprima/commit/aad8a2b798ca80342a744aac2869fc1feb0065dd
replaced XJSIdentifer with XJSNamespacedName for namespaced items, so we
need to adjust here accordingly.
2014-06-19 15:07:08 -04:00
Jeff Morrison 9ef6156d5c Merge pull request #760 from syranide/jsxns
Support for JSX tag namespaces <React:DOM:div />
2014-05-22 15:51:49 -07:00
Jon Beebe c50dbb0ec1 Adds svg pattern and mask components 2014-05-08 07:16:28 -05:00
Andreas Svensson aa044c6b61 Add support for JSX member expressions <React.DOM.div /> 2014-05-08 00:10:10 +02:00
Sven Helmberger 8e0d17c756 Add tspan to JSX transform 2014-04-24 19:13:01 +02:00
Jeff Morrison 9c2b9b1eb6 Merge pull request #970 from syranide/jsxws
Normalize whitespace for transformed JSX code
2014-04-04 10:20:43 -07:00
Paul O’Shannessy d88d479685 Merge pull request #1193 from spicyj/jsx-polygon
Add polygon tag to transform
2014-03-17 10:07:23 -07:00
Andreas Svensson 60d7a02d44 Normalize whitespace for transformed JSX code 2014-03-12 10:03:16 +01:00
Andreas Svensson 280ff2e5a7 Unbreak JSX comment comma fix 2014-03-11 00:31:59 +01:00
Andreas Svensson aa70419f9d Fix empty JSX expressions sometimes emitting erroneous commas 2014-03-06 13:01:03 +01:00
Ben Alpert 42444f6bb9 Add polygon tag to transform
Fixes #1144.
2014-02-27 12:32:24 -08:00
Paul O’Shannessy 7b773a6b3d make <hasOwnProperty/> transform correctly 2014-02-24 18:03:02 -08:00
Ben Alpert 472be09ff6 Make JSX transform not break on 'constructor' attr 2014-02-20 21:44:58 -08:00
Paul O’Shannessy 8a47813baa Update copyrights for 2014.
grep -rl 'Copyright 2013 Facebook' static_upstream | xargs perl -pi -w -e s/Copyright 2013 Facebook/Copyright 2013-2014 Facebook/g;'

Not going to check in a script to do this since it will just change every year.
Closes #1006
2014-02-18 17:06:43 -08:00
JeffMo adcbf0806c Sync out transforms from fb internal 2014-02-15 12:35:32 -08:00
Andreas Svensson c16b5659a0 Implement stricter whitespace rules 2014-01-22 21:00:10 +01:00
Jeff Morrison 33fe8eebda Merge pull request #799 from spicyj/display-name
Add display name in more cases
2014-01-07 12:58:23 -08:00
Ben Alpert f0fdabae7b Add display name in more cases 2014-01-07 09:36:47 -08:00
Matt Harrison c4d918aca0 Added support for 4 extra SVG tags: stop, defs, linearGradient, radialGradient 2014-01-05 11:17:04 +00:00
Nick Thompson d270e2b1c7 Don't add displayName in transform if already defined
This ensures we don't add displayName in the transform if it's already been
defined. This is especially important when in strict mode, where duplicate
properties in an object is an exception.
2014-01-03 16:07:10 -08:00
Paul O’Shannessy b2507066b6 Don't call utils.traverse in transform
Accidental change we missed in review of #495.
2013-11-20 15:36:54 -08:00
Andreas Svensson a39b8fda70 utils.* is now used everywhere 2013-11-15 11:17:24 +01:00
JeffMo a4f8ad1bb0 Switch utility function calls -> namespaced calls 2013-10-31 13:45:16 -07:00
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