mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge branch 'fibers-uglify-upgrade' into devel
This branch: - Updates fibers to 1.0.0, which hopefully fixes crash/stack overflow issues. This version stops exporting a global 'Fiber' object which means some server code needs to do some more requires. - Updates uglify-js to (a Meteor bugfix fork) off of 2.2.3. This is a complete rewrite of Uglify and appears to fix infinite recursion bugs that were discovered on the engine branch and while investigating lodash. We also now are able to minify all code in one pass instead of as separate pieces. - Stops using a Meteor bugfix fork of fstream, because they have taken our fork. This also affects the nested copy used by tar.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
set -e
|
||||
set -u
|
||||
|
||||
BUNDLE_VERSION=0.2.12
|
||||
BUNDLE_VERSION=0.2.14
|
||||
UNAME=$(uname)
|
||||
ARCH=$(uname -m)
|
||||
|
||||
@@ -88,7 +88,6 @@ npm install mime@1.2.7
|
||||
npm install semver@1.1.0
|
||||
npm install handlebars@1.0.7
|
||||
npm install mongodb@1.1.11
|
||||
npm install uglify-js@1.3.4
|
||||
npm install clean-css@0.8.3
|
||||
npm install useragent@1.1.0
|
||||
npm install request@2.12.0
|
||||
@@ -98,7 +97,13 @@ npm install keypress@0.1.0
|
||||
npm install sockjs@0.3.4
|
||||
npm install http-proxy@0.8.5
|
||||
npm install underscore@1.4.2
|
||||
npm install fstream@0.1.21
|
||||
npm install tar@0.1.14
|
||||
npm install websocket@1.0.8
|
||||
|
||||
# uglify-js has a bug which drops 'undefined' in arrays:
|
||||
# https://github.com/mishoo/UglifyJS2/pull/97
|
||||
npm install https://github.com/meteor/UglifyJS2/tarball/9a4d0d86ed
|
||||
|
||||
# progress 0.1.0 has a regression where it opens stdin and thus does not
|
||||
# allow the node process to exit cleanly. See
|
||||
@@ -109,16 +114,10 @@ npm install progress@0.0.5
|
||||
# which make the dev bundle much bigger. We need a better solution.
|
||||
npm install mailcomposer@0.1.15
|
||||
|
||||
# Use our version of fstream with a bug fixed. Also have tar use it.
|
||||
# See https://github.com/isaacs/fstream/pull/11 .
|
||||
npm install https://github.com/meteor/fstream/tarball/91c56e7
|
||||
cd tar/node_modules
|
||||
npm install https://github.com/meteor/fstream/tarball/91c56e7
|
||||
cd ../..
|
||||
|
||||
# If you update the version of fibers in the dev bundle, also update the "npm
|
||||
# install" command in docs/client/concepts.html.
|
||||
npm install fibers@0.6.9
|
||||
# install" command in docs/client/concepts.html and in the README in
|
||||
# app/lib/bundler.js.
|
||||
npm install fibers@1.0.0
|
||||
# Fibers ships with compiled versions of its C code for a dozen platforms. This
|
||||
# bloats our dev bundle, and confuses dpkg-buildpackage and rpmbuild into
|
||||
# thinking that the packages need to depend on both 32- and 64-bit versions of
|
||||
|
||||
@@ -378,36 +378,23 @@ _.extend(Bundle.prototype, {
|
||||
var self = this;
|
||||
|
||||
/// Javascript
|
||||
var code_parts = [];
|
||||
var codeParts = [];
|
||||
|
||||
_.each(self.js.client, function (js_path) {
|
||||
var code = self.files.client[js_path].toString('utf8');
|
||||
codeParts.push(self.files.client[js_path].toString('utf8'));
|
||||
|
||||
// Uglify has a bug -- it will incorrectly minifiy files that
|
||||
// contain the 'debugger' statement.
|
||||
// https://github.com/mishoo/UglifyJS/issues/243
|
||||
// For now, just skip minification of such files.
|
||||
// XXX fix uglify, and once that happens, go back to
|
||||
// concatenating before minifying, rather than vice versa
|
||||
// https://app.asana.com/0/159908330244/522242142181
|
||||
if (!(code.match(/debugger/))) {
|
||||
var ast = uglify.parser.parse(code);
|
||||
ast = uglify.uglify.ast_mangle(ast);
|
||||
ast = uglify.uglify.ast_squeeze(ast);
|
||||
code = uglify.uglify.gen_code(ast);
|
||||
}
|
||||
|
||||
code_parts.push(code);
|
||||
delete self.files.client[js_path];
|
||||
});
|
||||
var final_code = code_parts.join('\n;\n');
|
||||
var combinedCode = codeParts.join('\n;\n');
|
||||
var finalCode = uglify.minify(
|
||||
combinedCode, {fromString: true, compress: {drop_debugger: false}}).code;
|
||||
|
||||
var hash = crypto.createHash('sha1');
|
||||
hash.update(final_code);
|
||||
hash.update(finalCode);
|
||||
var digest = hash.digest('hex');
|
||||
var name = path.sep + digest + ".js";
|
||||
|
||||
self.files.client_cacheable[name] = new Buffer(final_code);
|
||||
self.files.client_cacheable[name] = new Buffer(finalCode);
|
||||
self.js.client = [name];
|
||||
|
||||
/// CSS
|
||||
@@ -574,7 +561,7 @@ _.extend(Bundle.prototype, {
|
||||
"This is a Meteor application bundle. It has only one dependency,\n" +
|
||||
"node.js (with the 'fibers' package). To run the application:\n" +
|
||||
"\n" +
|
||||
" $ npm install fibers\n" +
|
||||
" $ npm install fibers@1.0.0\n" +
|
||||
" $ export MONGO_URL='mongodb://user:password@host:port/databasename'\n" +
|
||||
" $ export ROOT_URL='http://example.com'\n" +
|
||||
" $ export MAIL_URL='smtp://user:password@mailhost:port/'\n" +
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////// Requires //////////
|
||||
|
||||
require("fibers");
|
||||
var Fiber = require("fibers");
|
||||
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
|
||||
@@ -641,7 +641,7 @@ have `npm` available, and run the following:
|
||||
|
||||
$ cd bundle/server/node_modules
|
||||
$ rm -r fibers
|
||||
$ npm install fibers@0.6.9
|
||||
$ npm install fibers@1.0.0
|
||||
{{/warning}}
|
||||
|
||||
{{/better_markdown}}
|
||||
|
||||
@@ -31,6 +31,8 @@ if (Meteor.isServer) {
|
||||
}
|
||||
});
|
||||
|
||||
var Fiber = __meteor_bootstrap__.require('fibers');
|
||||
|
||||
var sleep = function (ms) {
|
||||
var fiber = Fiber.current;
|
||||
setTimeout(function() {
|
||||
|
||||
2
meteor
2
meteor
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
BUNDLE_VERSION=0.2.12
|
||||
BUNDLE_VERSION=0.2.14
|
||||
|
||||
# OS Check. Put here because here is where we download the precompiled
|
||||
# bundles that are arch specific.
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
return result;
|
||||
});
|
||||
|
||||
var Fiber = __meteor_bootstrap__.require('fibers');
|
||||
// Listen to incoming OAuth http requests
|
||||
__meteor_bootstrap__.app
|
||||
.use(connect.query())
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var Fiber = __meteor_bootstrap__.require('fibers');
|
||||
|
||||
/******************************************************************************/
|
||||
/* LivedataSession */
|
||||
/******************************************************************************/
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
(function () {
|
||||
|
||||
var Fiber = __meteor_bootstrap__.require('fibers');
|
||||
|
||||
var nextSlot = 0;
|
||||
|
||||
Meteor.EnvironmentVariable = function () {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var Fiber = __meteor_bootstrap__.require('fibers');
|
||||
|
||||
Tinytest.add("fibers - synchronous queue", function (test) {
|
||||
var q = new Meteor._SynchronousQueue;
|
||||
var output = [];
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
var path = __meteor_bootstrap__.require('path');
|
||||
var MongoDB = __meteor_bootstrap__.require('mongodb');
|
||||
var Fiber = __meteor_bootstrap__.require('fibers');
|
||||
var Future = __meteor_bootstrap__.require(path.join('fibers', 'future'));
|
||||
|
||||
_Mongo = function (url) {
|
||||
|
||||
@@ -108,6 +108,7 @@ Tinytest.addAsync("mongo-livedata - basics", function (test, onComplete) {
|
||||
|
||||
// sleep function from fibers docs.
|
||||
var sleep = function(ms) {
|
||||
var Fiber = __meteor_bootstrap__.require('fibers');
|
||||
var fiber = Fiber.current;
|
||||
setTimeout(function() {
|
||||
fiber.run();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function () {
|
||||
var Fiber = __meteor_bootstrap__.require('fibers');
|
||||
var handlesForRun = {};
|
||||
var reportsForRun = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user