Commit Graph
62 Commits
Author SHA1 Message Date
Andreas Svensson aa70419f9d Fix empty JSX expressions sometimes emitting erroneous commas 2014-03-06 13:01:03 +01: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
Ben Alpert 5795376961 Strip calls to warning() in __DEV__
Fixes #1120.
2014-02-17 19:01:45 -08:00
JeffMoandjeffmo adcbf0806c Sync out transforms from fb internal 2014-02-15 12:35:32 -08:00
Ben Alpert 89bcecc76f Disable source maps when defineProperty is missing
Fixes #1053.
2014-02-11 00:10:06 -08:00
Ben Newman 77c53dd5d4 Revert "More optimizations and fix for JSXTransformer build"
This reverts commit f1b7db9aef.
2014-02-03 19:05:15 -05:00
Ingvar Stepanyan f1b7db9aef More optimizations and fix for JSXTransformer build
* Dropped dependency on emulation of Node.js native modules.
* Added deamdify step for JSXTransformer build.
2014-01-31 21:53:08 +02:00
Andreas Svensson c16b5659a0 Implement stricter whitespace rules 2014-01-22 21:00:10 +01:00
Fabio M. Costa de7a92afa7 Updating error message to also show part of the code, making it easier to find the error 2014-01-20 11:57:35 -08:00
Fabio M. Costa d829d1ab9b Adding current page's url for inline code and code improvement 2014-01-20 11:57:34 -08:00
Fabio M. Costa b1a949ed45 Adds the filename to JSXTransform error message, making it easier to debug JSX syntax errors. 2014-01-20 11:55:17 -08:00
cpojer 8dbc530d1c Add --harmony option to jsx. 2014-01-09 15:21:48 -08: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
Christopher Chedeau 9454282bfc Merge pull request #819 from mtharrison/add-more-svg-tags
Added support for 4 extra SVG tags
2014-01-06 15:44:15 -08:00
Ben Newman b7b4bcfd2e Merge pull request #764 from spicyj/browser-source-maps
Add source map support to browser transformer.
2014-01-06 14:38:00 -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 ThompsonandPaul O’Shannessy 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
Ben Alpert 7675611e5f Add source map support to browser transformer 2013-12-31 12:03:34 -07:00
Ben Newman f3a6775098 Upgrade recast dev dependency to v0.5.6.
Paving the way for source maps.
2013-12-17 14:50:36 -05:00
Ben Alpert 277abbfe7b Fix lint error (unused variable) 2013-12-09 12:29:03 -08:00
petehuntandPaul O’Shannessy 90e2258791 response to code review 2013-12-06 11:56:30 -08:00
petehuntandPaul O’Shannessy 5466d0a063 first work: __DEV__
fix invariant

Get browserify working

remove dead code elimination step since it is not needed due to minifier

use industry standard NODE_ENV
2013-12-06 11:56:29 -08:00
cpojer 31359e9962 Add more useful ES6 transforms to jsx-internal. 2013-12-05 10:20:24 -08:00
Ben Alpert 3a75d70501 Allow running one spec/suite in the web interface
This is the proper way to make it filter the spec list:

https://github.com/pivotal/jasmine/blob/1_3_x/spec/runner.html

I submitted the jasmine-jsreporter change as a pull request here:

https://github.com/detro/jasmine-jsreporter/pull/2

Fixes #563.
2013-11-24 00:53:29 -05: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
Ben Newman b61eacd3c5 Explicitly require the assert module in vendor/constants.js. 2013-11-14 13:48:08 -05:00
Ben Newman da717977ed Better comments for vendor/constants.js. 2013-11-13 15:33:10 -05:00
Ben Newman 2b763fc452 Rewrite vendor/constants.js to use require("ast-types").traverse.
Most notably, this new style of transformation gives us access to
this.parent.node, which allows us to avoid replacing identifiers that are
not actually free variables, such as member expression properties.

Closes #496.
2013-11-13 15:33:10 -05:00
Andreas Svensson 595b482478 JSXTransformer now supports IE8 2013-11-08 23:04:43 +01:00
Thomas Aylott 7bbf6cbfd1 browser support for jasmine-support 2013-11-06 15:30:51 -05:00
Thomas Aylott f65f7b3bbd IE8 support in jasmine-support 2013-11-06 15:30:50 -05:00
Thomas Aylott 284d8d67bd Upgrade to the latest version of jasmine
Necessary for IE8 support
2013-11-06 15:30:50 -05:00
Thomas Aylott 3df6942cde SauceLabs Browser testing via Travis 2013-11-06 15:30:50 -05:00
JeffMo a4f8ad1bb0 Switch utility function calls -> namespaced calls 2013-10-31 13:45:16 -07:00
SanderSpies 6839704c4b #JSX => #jsx 2013-10-15 19:11:19 +02:00
Ben Alpert 0a45325621 Actually make exec work
The spec for eval (http://es5.github.io/x15.1.html#x15.1.2.1) says "If Type(x) is not String, return x." and that's exactly what's happening here -- it gets {code: ...} and does nothing.
2013-09-30 18:51:39 -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
SanderSpies cd79ed32cb - removed creation of the id within the tooling integration doc (expect this to be done by @zpao's pull request)
- removed the if statement and now always provide a warning message (as proposed by @spicyj)
- improved the warning message
2013-09-19 06:48:38 +02:00
SanderSpies d2bf50c63d Give the user a warning when using unoptimized JSX code and send the user to the correct location in the documentation to optimize. 2013-09-19 00:55:10 +02:00
Ben Newman adda400602 Make constant propagation smarter about pruning if statements. 2013-09-18 13:33:45 -04: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
Jakub Malinowski 795a84d60f Do not export load in JSXTransformer unless in a browser environment 2013-07-23 23:01:38 +02:00
Jakub Malinowski 2b9dd04f4d Allow to execute JSXTransformer outside of browser environment 2013-07-20 15:10:36 +02: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