Commit Graph

22 Commits

Author SHA1 Message Date
Ben Alpert
ceb92cd78c Replace vendor/constants recast transform with babel
Built files look the same up to parenthesization and quoting. This only saves 1.5 seconds out of ~20 on a clean build but it's a little simpler.
2015-05-04 17:05:42 -07:00
Ben Alpert
93a782b40b Use Babel to build React
Size comparison:

```
   raw     gz Compared to master @ 6ed98ec0c8
     =      = build/JSXTransformer.js
-15736  -3247 build/react-with-addons.js
  +287     +7 build/react-with-addons.min.js
-14412  -2887 build/react.js
  +274    +15 build/react.min.js
```

Differences mostly look to be various bits of whitespace that Babel ends up removing during its transforms (https://gist.github.com/spicyj/21ef31f4d95fb7a58daf). In minified files, mostly additions of `"use strict";`.
2015-05-04 14:14:09 -07:00
Paul O’Shannessy
c4a2e4d414 Fix module option parsing of jsx command 2015-03-11 14:26:51 -07:00
Paul O’Shannessy
d40be68d2c Expose --target flag on jsx executable
Valid values are 'es3' and 'es5'.
es3: perform reserved words quoting, don't use defineProperty
es5: default, don't do the above, class methods non-enumerable
2015-02-20 13:37:42 -08:00
Paul O’Shannessy
112f7aa249 Move option parsing into react-tools proper.
We were doing some preprocessing for module options in the command line. Since
we also expose the same API via react-tools (and JSXTransformer), we need to do
the same processing from the API. So just move it all to the same place.
2015-02-19 09:46:25 -08:00
jeffmo
332a782d28 Add --es6module and --non-strict-es6module flags to jsx bin 2015-02-13 17:51:35 -05:00
Paul O’Shannessy
9016665c0e Enable strip-types transform for internal code
Flow is coming so we need to be ready.
2014-12-14 12:51:39 -08:00
jeffmo
808730df59 Add support for a --strip-types flag to bin/jsx 2014-09-05 16:28:46 -04:00
Paul O’Shannessy
fc3a3801de Add support for inline sourcemaps in jsx executable
--source-map-inline
2014-07-12 19:49:11 -07:00
Paul O’Shannessy
d1a337b9db Move jsx_whitespace_transform
Also add readme and more details to package.json so it can be published.
2014-02-13 15:58:19 -08:00
JeffMo
f368f18b61 jsx whitespace codemod utility 2014-01-27 13:08:36 -08:00
cpojer
8dbc530d1c Add --harmony option to jsx. 2014-01-09 15:21:48 -08:00
cpojer
31359e9962 Add more useful ES6 transforms to jsx-internal. 2013-12-05 10:20:24 -08:00
Ben Newman
c2ef6e343d Make bin/jsx --version output the React version according to package.json.
Closes #329.
2013-11-07 10:52:02 -05:00
Ben Newman
658f41cb30 Simplify bin/jsx to perform just the JSX transform.
We will continue using `bin/jsx-internal`, well, internally.

Note that this version no longer respects `@providesModule`, and it
doesn't do anything special with constants like `__DEV__`, so we can no
longer get to claim that `bin/jsx` can be used to build the core.

I'm happy about this, personally, because it demonstrates the flexibility
of Commoner.
2013-09-06 16:20:25 -04:00
JeffMo
2d048f1f34 Move to using jstransform and esprima-fb npm modules 2013-08-22 15:28:41 -07:00
Ben Newman
7ef5172d80 Don't call require("mock-modules").register("test/all", ...).
The "test/all" module will never be mocked, nor should it ever need to be
reset by `dumpCache`.
2013-07-19 11:10:02 -04:00
Ben Newman
b763d7d029 Use a separate grunt/config/jsx config file for tests.
No longer injecting __MOCK__ as a global constant (it's just a config
property now).

Turns out the `grunt jsx:debug` task was never necessary for tests.
2013-07-15 19:41:40 -04:00
Ben Newman
37014e1002 Call require("mock-modules").register in every mockable module.
Mocking happens only when config.constants.__MOCK__ is true.
2013-07-15 18:10:49 -04: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
75897c2dcd Initial public release 2013-05-29 12:54:02 -07:00