mirror of
https://github.com/facebook/react.git
synced 2026-02-26 18:58:05 +00:00
remove examples/wrapup
Apparently it's no longer relevant.
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
var exec = require('child_process').exec;
|
||||
var jsxTask = require('./grunt/tasks/jsx');
|
||||
var browserifyTask = require('./grunt/tasks/browserify');
|
||||
var wrapupTask = require('./grunt/tasks/wrapup');
|
||||
var populistTask = require('./grunt/tasks/populist');
|
||||
var phantomTask = require('./grunt/tasks/phantom');
|
||||
var npmTask = require('./grunt/tasks/npm');
|
||||
@@ -16,7 +15,6 @@ module.exports = function(grunt) {
|
||||
copy: require('./grunt/config/copy'),
|
||||
jsx: require('./grunt/config/jsx/jsx'),
|
||||
browserify: require('./grunt/config/browserify'),
|
||||
wrapup: require('./grunt/config/wrapup'),
|
||||
populist: require('./grunt/config/populist'),
|
||||
phantom: require('./grunt/config/phantom'),
|
||||
npm: require('./grunt/config/npm'),
|
||||
@@ -42,10 +40,6 @@ module.exports = function(grunt) {
|
||||
// Our own browserify-based tasks to build a single JS file build
|
||||
grunt.registerMultiTask('browserify', browserifyTask);
|
||||
|
||||
// Similar to Browserify, use WrapUp to generate single JS file that
|
||||
// defines global variables instead of using require.
|
||||
grunt.registerMultiTask('wrapup', wrapupTask);
|
||||
|
||||
grunt.registerMultiTask('populist', populistTask);
|
||||
|
||||
grunt.registerMultiTask('phantom', phantomTask);
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv='Content-type' content='text/html; charset=utf-8'>
|
||||
<title>Basic Example (WrapUp)</title>
|
||||
<link rel="stylesheet" href="../shared/css/base.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Basic Example (WrapUp)</h1>
|
||||
<div id="container">
|
||||
<p>
|
||||
To install React, follow the instructions on
|
||||
<a href="http://www.github.com/facebook/react/">GitHub</a>.
|
||||
</p>
|
||||
<p>
|
||||
If you can see this, React is not working right.
|
||||
Make sure to run <code>grunt</code>.
|
||||
</p>
|
||||
</div>
|
||||
<h4>Example Details</h4>
|
||||
<ul>
|
||||
<li>
|
||||
This is built with
|
||||
<a href="https://github.com/mootools/wrapup">WrapUp</a>.
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
</p>
|
||||
<p>
|
||||
Learn more at
|
||||
<a href="http://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
|
||||
</p>
|
||||
<script src="../../build/react.js"></script>
|
||||
<script>
|
||||
var ExampleApplication = React.createClass({
|
||||
render: function() {
|
||||
var elapsed = Math.round(this.props.elapsed / 100);
|
||||
var seconds = elapsed / 10 + (elapsed % 10 ? '' : '.0' );
|
||||
var message =
|
||||
'React has been successfully running for ' + seconds + ' seconds.';
|
||||
|
||||
return React.DOM.p(null, message);
|
||||
}
|
||||
});
|
||||
var start = new Date().getTime();
|
||||
setInterval(function() {
|
||||
React.renderComponent(
|
||||
ExampleApplication({elapsed: new Date().getTime() - start}),
|
||||
document.getElementById('container')
|
||||
);
|
||||
}, 50);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -10,7 +10,7 @@ module.exports = {
|
||||
archive: './build/react-' + version + '.zip'
|
||||
},
|
||||
files: [
|
||||
{cwd: './build/starter', src: ['**', '!examples/wrapup/**'], dest: 'react-' + version + '/'}
|
||||
{cwd: './build/starter', src: ['**'], dest: 'react-' + version + '/'}
|
||||
]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var grunt = require('grunt');
|
||||
var UglifyJS = require('uglify-js');
|
||||
|
||||
function minify(src) {
|
||||
return UglifyJS.minify(src, { fromString: true }).code;
|
||||
}
|
||||
|
||||
// Our basic config which we'll add to to make our other builds
|
||||
var basic = {
|
||||
outfile: './build/react-global.js',
|
||||
requires: {
|
||||
React: './build/modules/React.js'
|
||||
},
|
||||
debug: true
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
basic: basic
|
||||
};
|
||||
|
||||
// Create minified versions of each build
|
||||
for (var buildName in module.exports) {
|
||||
var build = module.exports[buildName];
|
||||
module.exports[buildName + '-min'] = grunt.util._.merge({}, build, {
|
||||
outfile: build.outfile.replace('.js', '.min.js'),
|
||||
debug: false,
|
||||
after: minify
|
||||
});
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var grunt = require('grunt');
|
||||
|
||||
module.exports = function() {
|
||||
var wrup = require('wrapup')();
|
||||
var config = this.data;
|
||||
|
||||
// This task is async...
|
||||
var done = this.async();
|
||||
|
||||
config.requires = config.requires || {};
|
||||
|
||||
Object.keys(config.requires).forEach(function(id) {
|
||||
wrup = wrup.require(id, config.requires[id]);
|
||||
});
|
||||
|
||||
wrup.options({
|
||||
sourcemap: config.debug && config.outfile.replace(/\.js$/i, ".map")
|
||||
}).up(function(err, src) {
|
||||
if (err) {
|
||||
grunt.log.error(err);
|
||||
done();
|
||||
}
|
||||
|
||||
// TODO: post processing hooks, scope?
|
||||
if (config.after) {
|
||||
src = config.after.call(this, src);
|
||||
}
|
||||
|
||||
grunt.file.write(config.outfile, src);
|
||||
done();
|
||||
});
|
||||
};
|
||||
@@ -42,7 +42,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "~2.34.1",
|
||||
"wrapup": "~0.12.0",
|
||||
"populist": "~0.1.4",
|
||||
"grunt-cli": "~0.1.9",
|
||||
"grunt": "~0.4.1",
|
||||
|
||||
Reference in New Issue
Block a user