diff --git a/grunt/config/jsx/debug.json b/grunt/config/jsx/debug.json new file mode 100644 index 0000000000..1596c562e8 --- /dev/null +++ b/grunt/config/jsx/debug.json @@ -0,0 +1,6 @@ +{ + "debug": true, + "constants": { + "__DEV__": true + } +} diff --git a/grunt/config/jsx/jsx.js b/grunt/config/jsx/jsx.js index d1602f6f91..b8a049da92 100644 --- a/grunt/config/jsx/jsx.js +++ b/grunt/config/jsx/jsx.js @@ -1,24 +1,12 @@ 'use strict'; -var grunt = require('grunt'); - var rootIDs = [ "React" ]; -var getDebugConfig = function() { - return { - "debug": true, - "constants": { - "__VERSION__": grunt.config.data.pkg.version, - "__DEV__": true - } - }; -}; - var debug = { rootIDs: rootIDs, - getConfig: getDebugConfig, + configFile: "grunt/config/jsx/debug.json", sourceDir: "src", outputDir: "build/modules" }; @@ -27,7 +15,7 @@ var jasmine = { rootIDs: [ "all" ], - getConfig: getDebugConfig, + configFile: debug.configFile, sourceDir: "vendor/jasmine", outputDir: "build/jasmine" }; @@ -37,37 +25,18 @@ var test = { "test/all.js", "**/__tests__/*.js" ]), - getConfig: function() { - return { - "debug": true, - "mocking": true, - "constants": { - "__VERSION__": grunt.config.data.pkg.version, - "__DEV__": true - } - }; - }, + configFile: "grunt/config/jsx/test.json", sourceDir: "src", outputDir: "build/modules" }; - var release = { rootIDs: rootIDs, - getConfig: function() { - return { - "debug": false, - "constants": { - "__VERSION__": grunt.config.data.pkg.version, - "__DEV__": false - } - }; - }, + configFile: "grunt/config/jsx/release.json", sourceDir: "src", outputDir: "build/modules" }; - module.exports = { debug: debug, jasmine: jasmine, diff --git a/grunt/config/jsx/release.json b/grunt/config/jsx/release.json new file mode 100644 index 0000000000..1dd48f20fd --- /dev/null +++ b/grunt/config/jsx/release.json @@ -0,0 +1,6 @@ +{ + "debug": false, + "constants": { + "__DEV__": false + } +} diff --git a/grunt/config/jsx/test.json b/grunt/config/jsx/test.json new file mode 100644 index 0000000000..e897023aab --- /dev/null +++ b/grunt/config/jsx/test.json @@ -0,0 +1,7 @@ +{ + "debug": true, + "mocking": true, + "constants": { + "__DEV__": true + } +} diff --git a/grunt/tasks/jsx.js b/grunt/tasks/jsx.js index 62bcecff70..290816711f 100644 --- a/grunt/tasks/jsx.js +++ b/grunt/tasks/jsx.js @@ -24,7 +24,7 @@ module.exports = function() { }); args.push.apply(args, rootIDs); - args.push("--config" /* from stdin */); + args.push("--config", config.configFile); var child = spawn({ cmd: "bin/jsx", @@ -38,9 +38,6 @@ module.exports = function() { } }); - child.stdin.write(JSON.stringify(config.getConfig())); - child.stdin.end(); - child.stdout.pipe(process.stdout); child.stderr.pipe(process.stderr); }; diff --git a/src/.jshintrc b/src/.jshintrc index f098432e6d..60ff8d05c2 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -19,7 +19,6 @@ "unused": "vars", "globals": { - "__VERSION__": false, "__DEV__": false, "require": false, "module": false, diff --git a/src/core/React.js b/src/core/React.js index bee85668e9..1d7d9c3a0e 100644 --- a/src/core/React.js +++ b/src/core/React.js @@ -30,7 +30,6 @@ var ReactDefaultInjection = require('ReactDefaultInjection'); ReactDefaultInjection.inject(); var React = { - version: __VERSION__, DOM: ReactDOM, PropTypes: ReactPropTypes, initializeTouchEvents: function(shouldUseTouch) {