Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions grunt/config/jsx/debug.json

This file was deleted.

39 changes: 35 additions & 4 deletions grunt/config/jsx/jsx.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
'use strict';

var grunt = require('grunt');

var rootIDs = [
"React",
"ReactTransitionGroup"
];

var getDebugConfig = function() {
return {
"debug": true,
"constants": {
"__VERSION__": grunt.config.data.pkg.version,
"__DEV__": true
}
};
};

var debug = {
rootIDs: rootIDs,
configFile: "grunt/config/jsx/debug.json",
getConfig: getDebugConfig,
sourceDir: "src",
outputDir: "build/modules"
};
Expand All @@ -16,7 +28,7 @@ var jasmine = {
rootIDs: [
"all"
],
configFile: debug.configFile,
getConfig: getDebugConfig,
sourceDir: "vendor/jasmine",
outputDir: "build/jasmine"
};
Expand All @@ -26,18 +38,37 @@ var test = {
"test/all.js",
"**/__tests__/*.js"
]),
configFile: "grunt/config/jsx/test.json",
getConfig: function() {
return {
"debug": true,
"mocking": true,
"constants": {
"__VERSION__": grunt.config.data.pkg.version,
"__DEV__": true
}
};
},
sourceDir: "src",
outputDir: "build/modules"
};


var release = {
rootIDs: rootIDs,
configFile: "grunt/config/jsx/release.json",
getConfig: function() {
return {
"debug": false,
"constants": {
"__VERSION__": grunt.config.data.pkg.version,
"__DEV__": false
}
};
},
sourceDir: "src",
outputDir: "build/modules"
};


module.exports = {
debug: debug,
jasmine: jasmine,
Expand Down
6 changes: 0 additions & 6 deletions grunt/config/jsx/release.json

This file was deleted.

7 changes: 0 additions & 7 deletions grunt/config/jsx/test.json

This file was deleted.

5 changes: 4 additions & 1 deletion grunt/tasks/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function() {
});

args.push.apply(args, rootIDs);
args.push("--config", config.configFile);
args.push("--config" /* from stdin */);

var child = spawn({
cmd: "bin/jsx-internal",
Expand All @@ -38,6 +38,9 @@ module.exports = function() {
}
});

child.stdin.write(JSON.stringify(config.getConfig()));
child.stdin.end();

child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
};
1 change: 1 addition & 0 deletions src/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"unused": "vars",

"globals": {
"__VERSION__": false,
"__DEV__": false,
"require": false,
"module": false,
Expand Down
4 changes: 4 additions & 0 deletions src/core/React.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ var React = {
isValidComponent: ReactComponent.isValidComponent
};

// Version exists only in the open-source version of React, not in Facebook's
// internal version.
React.version = __VERSION__;

module.exports = React;