mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Merge pull request #3143 from jeffmo/flow_0_3_0
Update jsx binary to latest jstransform + latest flow syntax features
This commit is contained in:
commit
8e803cba23
2 files changed
+22
-4
No files matched your search
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
// -*- mode: js -*-
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
var transform = require('../main').transform;
|
||||
|
||||
@@ -14,15 +14,33 @@ require('commoner').version(
|
||||
).option(
|
||||
'--strip-types',
|
||||
'Strips out type annotations.'
|
||||
).option(
|
||||
'--es6module',
|
||||
'Parses the file as a valid ES6 module. ' +
|
||||
'(Note that this means implicit strict mode)'
|
||||
).option(
|
||||
'--non-strict-es6module',
|
||||
'Parses the file as an ES6 module, except disables implicit strict-mode. ' +
|
||||
'(This is useful if you\'re porting non-ES6 modules to ES6, but haven\'t ' +
|
||||
'yet verified that they are strict-mode safe yet)'
|
||||
).option(
|
||||
'--source-map-inline',
|
||||
'Embed inline sourcemap in transformed source'
|
||||
).process(function(id, source) {
|
||||
var sourceType;
|
||||
if (this.options.es6module) {
|
||||
sourceType = 'module';
|
||||
}
|
||||
if (this.options.nonStrictEs6module) {
|
||||
sourceType = 'nonStrictModule';
|
||||
}
|
||||
|
||||
// This is where JSX, ES6, etc. desugaring happens.
|
||||
var options = {
|
||||
harmony: this.options.harmony,
|
||||
sourceMap: this.options.sourceMapInline,
|
||||
stripTypes: this.options.stripTypes
|
||||
stripTypes: this.options.stripTypes,
|
||||
sourceType: sourceType,
|
||||
};
|
||||
return transform(source, options);
|
||||
});
|
||||
+2
-2
@@ -27,7 +27,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"commoner": "^0.10.0",
|
||||
"jstransform": "^8.0.0"
|
||||
"jstransform": "^9.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"benchmark": "~1.0.0",
|
||||
@@ -40,7 +40,7 @@
|
||||
"es3ify": "~0.1.2",
|
||||
"es5-shim": "^4.0.0",
|
||||
"eslint": "^0.14.1",
|
||||
"esprima-fb": "^10001.1.0-dev-harmony-fb",
|
||||
"esprima-fb": "^12001.1.0-dev-harmony-fb",
|
||||
"grunt": "~0.4.2",
|
||||
"grunt-cli": "~0.1.9",
|
||||
"grunt-compare-size": "~0.4.0",
|
||||
|
||||
Reference in new issue
Block a user