mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Remove jsx task & jsx-internal script
These haven't been used in a long time so it's time to get rid of them.
This commit is contained in:
@@ -11,7 +11,6 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
jsx: require('./grunt/config/jsx'),
|
||||
browserify: require('./grunt/config/browserify'),
|
||||
npm: require('./grunt/config/npm'),
|
||||
clean: [
|
||||
@@ -62,9 +61,6 @@ module.exports = function(grunt) {
|
||||
spawnGulp(['react:clean'], null, this.async());
|
||||
});
|
||||
|
||||
// Register jsx:normal and :release tasks.
|
||||
grunt.registerMultiTask('jsx', require('./grunt/tasks/jsx'));
|
||||
|
||||
// Our own browserify-based tasks to build a single JS file build.
|
||||
grunt.registerMultiTask('browserify', require('./grunt/tasks/browserify'));
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
// -*- mode: js -*-
|
||||
// vim: set ft=javascript :
|
||||
|
||||
'use strict';
|
||||
|
||||
var babel = require('babel');
|
||||
|
||||
var devExpressionPlugin = require('fbjs/scripts/babel/dev-expression');
|
||||
|
||||
var TRANSFORM_IGNORE_RE = /^WebComponents$/;
|
||||
|
||||
require('commoner').version(
|
||||
require('../package.json').version
|
||||
).resolve(function(id) {
|
||||
var context = this;
|
||||
|
||||
// Note that the result of context.getProvidedP() is cached for the
|
||||
// duration of the build, so it is both consistent and cheap to
|
||||
// evaluate multiple times.
|
||||
return context.getProvidedP().then(function(idToPath) {
|
||||
// If a module declares its own identifier using @providesModule
|
||||
// then that identifier will be a key in the idToPath object.
|
||||
if (idToPath.hasOwnProperty(id)) {
|
||||
return context.readFileP(idToPath[id]);
|
||||
}
|
||||
|
||||
// Otherwise assume the identifier maps directly to a path in the
|
||||
// filesystem.
|
||||
return context.readModuleP(id);
|
||||
});
|
||||
|
||||
}).process(function(id, source) {
|
||||
var context = this;
|
||||
|
||||
// This is hacky but that's ok… It really only matters for tests since it
|
||||
// won't otherwise be in the dependency tree.
|
||||
if (!TRANSFORM_IGNORE_RE.test(id)) {
|
||||
// This is where JSX, ES6, etc. desugaring happens.
|
||||
source = babel.transform(source, {
|
||||
blacklist: ['spec.functionName', 'validation.react'],
|
||||
plugins: [devExpressionPlugin],
|
||||
filename: id,
|
||||
}).code;
|
||||
}
|
||||
|
||||
return source;
|
||||
});
|
||||
@@ -1,25 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var grunt = require('grunt');
|
||||
|
||||
var rootIDs = [
|
||||
'React',
|
||||
'ReactWithAddons',
|
||||
// deprecated is used in the npm package but not anywhere else, so build it.
|
||||
'deprecated',
|
||||
];
|
||||
|
||||
var normal = {
|
||||
rootIDs: rootIDs,
|
||||
getConfig: function() {
|
||||
return {
|
||||
commonerConfig: grunt.config.data.pkg.commonerConfig,
|
||||
};
|
||||
},
|
||||
sourceDir: 'src',
|
||||
outputDir: 'build/modules',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
normal: normal,
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var grunt = require('grunt');
|
||||
var expand = grunt.file.expand;
|
||||
var spawn = grunt.util.spawn;
|
||||
|
||||
module.exports = function() {
|
||||
var done = this.async();
|
||||
var config = this.data;
|
||||
|
||||
var args = [
|
||||
'--cache-dir', '.module-cache',
|
||||
'--relativize',
|
||||
'--follow-requires',
|
||||
'--use-provides-module',
|
||||
config.sourceDir,
|
||||
config.outputDir,
|
||||
];
|
||||
|
||||
var rootIDs = expand({
|
||||
nonull: true, // Keep IDs that don't expand to anything.
|
||||
cwd: 'src',
|
||||
}, config.rootIDs).map(function(id) {
|
||||
return id.replace(/\.js$/i, '');
|
||||
});
|
||||
|
||||
args.push.apply(args, rootIDs);
|
||||
args.push('--config');
|
||||
|
||||
var child = spawn({
|
||||
cmd: 'node',
|
||||
args: [path.join('bin', 'jsx-internal')].concat(args),
|
||||
}, function(error, result, code) {
|
||||
if (error) {
|
||||
grunt.log.error(error);
|
||||
done(false);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
child.stdin.write(JSON.stringify(config.getConfig()));
|
||||
child.stdin.end();
|
||||
|
||||
child.stdout.pipe(process.stdout);
|
||||
child.stderr.pipe(process.stderr);
|
||||
};
|
||||
Reference in New Issue
Block a user