Commit Graph

41 Commits

Author SHA1 Message Date
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
petehunt 90e2258791 response to code review 2013-12-06 11:56:30 -08:00
petehunt 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
JeffMo 9c35189ad1 Add support for empty XJS expressions 2013-06-28 13:10:20 -07:00
petehunt 7053f59ad1 Remove second argument to invariant() 2013-06-23 21:58:59 -07:00
Ben Newman 000928f9dc Use recast.parse and .print for require("vendor/constants").propagate.
This removes the need to pass a callback, which is a nice improvement.
2013-06-17 16:30:32 -04:00
Ben Newman 0f87e8ee87 Rename Woodchipper-related stuff.
No functional changes introduced by this commit.

Renamed:

    woodchipper.js -> constants.js
    Woodchipper -> ConstantVisitor
    debranch -> propagate
2013-06-17 16:21:51 -04:00
Paul O’Shannessy c79a59b599 Improve JSXTransformer
The biggest improvement is that we'll now insert each parsed JSX script
back into a `<script>` tag with the body set. This allows the browser to
execute these scripts normally. Using `Function(functionBody)` or
`eval(functionBody)` both execute in window scope, but `var` assignments
don't actually get set on window (unlike everywhere else).

I also did some cleanup to make the code a little bit more readable.
In my minimal test cases this didn't break anything (scripts loaded in
the right order).
2013-06-17 10:52:16 -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
Ben Newman c740373b31 Fix some silly uses of Function.prototype.bind in jasmine-support.js. 2013-06-03 13:20:13 -04:00
Ben Newman 03f92bb155 Polyfill Function.prototype.bind during tests. 2013-06-03 13:20:13 -04:00
Ben Newman f8af93237a Use bin/jsx and browserify to build a jasmine bundle. 2013-06-03 13:20:13 -04: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