From 374dd8f39bf24dd459f43041c54675af864bac6f Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 17 Sep 2012 15:03:06 -0700 Subject: [PATCH 1/9] Make sure under_score names work in package tests. --- packages/tinytest/package.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/tinytest/package.js b/packages/tinytest/package.js index f60b29f4bd..893c78500d 100644 --- a/packages/tinytest/package.js +++ b/packages/tinytest/package.js @@ -4,6 +4,11 @@ Package.describe({ }); Package.on_use(function (api) { + // "past" is always included before app code (see init_from_app_dir) but not + // before packages when testing. This makes sure that tests see + // backward-compatibility hooks, at least if they use tinytest. + api.use('past'); + api.use('underscore', ['client', 'server']); api.add_files('tinytest.js', ['client', 'server']); From 036916fb31678c13762bb9bebafbfe7ee10858a6 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 17 Sep 2012 15:18:59 -0700 Subject: [PATCH 2/9] First draft of Meteor 0.4.1 release notes. --- History.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/History.md b/History.md index 5ec2d0a1fa..2bdfcd330d 100644 --- a/History.md +++ b/History.md @@ -1,6 +1,62 @@ ## vNEXT +## v0.4.1 + +* New `email` smart package, with `Email.send` API. + +* Upgrade Node from 0.6.17 to 0.8.8, as well as many Node modules in the dev + bundle; those that are user-exposed are: + * coffee-script: 1.3.3 (from 1.3.1) + * stylus: 0.29.0 (from 0.28.1) + * nib: 0.8.2 (from 0.7.0) + +* All publicly documented APIs now use camelCase rather than under_scores. The + old spellings continue to work for now. New names are: + - Meteor.isClient/isServer + - this.isSimulation inside a method invocation + - Meteor.deps.Context.onInvalidate + - Meteor.status().retryCount/retryTime + +* Spark improvements + * Optimize selector matching for event maps. + * Spark._currentRenderer shouldn't persist into timer callbacks. + * Fix bug caused by interaction between template.preserve and + {{#constant}}. #323 + * Allow {{#each}} over a collection of objects without _id. #281 + * Added a script to build a standalone spark.js that does not depend on + Meteor. + * Meteor and Spark no longer depend on jQuery unless you need IE7 + support. (All Meteor apps still include jQuery, for now.) + +* If you use Meteor.setTimer/setInterval/defer inside a method + invocation, and the callback is invoked before all writes directly + created by the invocation are committed, and the callback creates + writes, then those writes will be added to the same "write fence" + as the method's own writes, causing the client to wait for those + writes to be committed before quiescing. + +* Optimize LocalCollection.remove(id). + +* Make Meteor.Cursor.forEach fully synchronous even if the user's callback + yields. #321. + +* Avoid running full query result diffs on the client when unnecessary. + +* Better error reporting when a package in `.meteor/packages` does not exist. + +* Better error reporting for coffeescript. #331 + +* Better error handling in Handlebars.Exception. + +* Fix internal docs for bundler API add_resource. #326 + +* Change the implementation of the "meteor deploy" password prompt to not crash + Emacs M-x shell. + +* Upgrade bootstrap to version 2.1.1. #336, #337, #288, #293 + + ## v0.4.0 * Merge Spark, a new live page update engine From 7ffd598e2617976f318b45c88e5af2eaa0bc6372 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 17 Sep 2012 15:20:54 -0700 Subject: [PATCH 3/9] Don't tell end users to run "meteor add". --- packages/domutils/domutils.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/domutils/domutils.js b/packages/domutils/domutils.js index fdc7e6efb7..53f266d601 100644 --- a/packages/domutils/domutils.js +++ b/packages/domutils/domutils.js @@ -5,11 +5,10 @@ DomUtils = {}; (function () { var qsaFindAllBySelector = function (selector, contextNode) { + // If IE7 users report the following error message, you + // can fix it with "meteor add jquery". if (! document.querySelectorAll) - // IE 7 - throw new Error( - "This browser doesn't support querySelectorAll. " + - "You need Sizzle or jQuery (`meteor add jquery`)."); + throw new Error("This browser doesn't support querySelectorAll."); // the search is constrained to descendants of `ancestor`, // but it doesn't affect the scope of the query. From b54daf2c740247567f8584d3d46d9d2823e03191 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 17 Sep 2012 16:07:54 -0700 Subject: [PATCH 4/9] Second draft of 0.4.1 release notes. --- History.md | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/History.md b/History.md index 2bdfcd330d..32bdc65cd6 100644 --- a/History.md +++ b/History.md @@ -3,7 +3,8 @@ ## v0.4.1 -* New `email` smart package, with `Email.send` API. +* New `email` smart package, with [`Email.send`](http://docs.meteor.com/#email) + API. * Upgrade Node from 0.6.17 to 0.8.8, as well as many Node modules in the dev bundle; those that are user-exposed are: @@ -11,50 +12,50 @@ * stylus: 0.29.0 (from 0.28.1) * nib: 0.8.2 (from 0.7.0) -* All publicly documented APIs now use camelCase rather than under_scores. The - old spellings continue to work for now. New names are: - - Meteor.isClient/isServer - - this.isSimulation inside a method invocation - - Meteor.deps.Context.onInvalidate - - Meteor.status().retryCount/retryTime +* All publicly documented APIs now use `camelCase` rather than + `under_scores`. The old spellings continue to work for now. New names are: + - `Meteor.isClient`/`isServer` + - `this.isSimulation` inside a method invocation + - `Meteor.deps.Context.onInvalidate` + - `Meteor.status().retryCount`/`retryTime` * Spark improvements * Optimize selector matching for event maps. - * Spark._currentRenderer shouldn't persist into timer callbacks. - * Fix bug caused by interaction between template.preserve and - {{#constant}}. #323 - * Allow {{#each}} over a collection of objects without _id. #281 + * `Spark._currentRenderer` shouldn't persist into timer callbacks. + * Fix bug caused by interaction between `Template.foo.preserve` and + `{{#constant}}`. #323 + * Allow `{{#each}}` over a collection of objects without `_id`. #281 * Added a script to build a standalone spark.js that does not depend on Meteor. * Meteor and Spark no longer depend on jQuery unless you need IE7 support. (All Meteor apps still include jQuery, for now.) -* If you use Meteor.setTimer/setInterval/defer inside a method - invocation, and the callback is invoked before all writes directly - created by the invocation are committed, and the callback creates - writes, then those writes will be added to the same "write fence" - as the method's own writes, causing the client to wait for those - writes to be committed before quiescing. +* If you use `Meteor.setTimer`/`setInterval`/`defer` inside a method invocation, + and the callback is invoked before all writes directly created by the + invocation are committed, and the callback creates writes, then those writes + will be added to the same "write fence" as the method's own writes, causing + the client to wait for those writes to be committed before quiescing. -* Optimize LocalCollection.remove(id). - -* Make Meteor.Cursor.forEach fully synchronous even if the user's callback +* Make `Meteor.Cursor.forEach` fully synchronous even if the user's callback yields. #321. +* Upgrade bootstrap to version 2.1.1. #336, #337, #288, #293 + +* Change the implementation of the `meteor deploy` password prompt to not crash + Emacs M-x shell. + +* Optimize `LocalCollection.remove(id)` to be O(1) rather than O(n). + * Avoid running full query result diffs on the client when unnecessary. * Better error reporting when a package in `.meteor/packages` does not exist. * Better error reporting for coffeescript. #331 -* Better error handling in Handlebars.Exception. +* Better error handling in `Handlebars.Exception`. -* Fix internal docs for bundler API add_resource. #326 -* Change the implementation of the "meteor deploy" password prompt to not crash - Emacs M-x shell. - -* Upgrade bootstrap to version 2.1.1. #336, #337, #288, #293 +Patches contributed by GitHub users fivethirty, tmeasday, and xenolf. ## v0.4.0 From 30d20ea8db672554f5fa4aff4d948ee6d4f0a774 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 17 Sep 2012 18:31:37 -0700 Subject: [PATCH 5/9] Preserve spaces in arguments to admin/node.sh. --- admin/node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/node.sh b/admin/node.sh index 3326cd3bc8..ba712deb85 100755 --- a/admin/node.sh +++ b/admin/node.sh @@ -12,4 +12,4 @@ fi cd "$ORIGDIR" export NODE_PATH="$TOPDIR/dev_bundle/lib/node_modules" -exec "$TOPDIR/dev_bundle/bin/node" $* +exec "$TOPDIR/dev_bundle/bin/node" "$@" From 18b55d05c0b70cca488e7ad5e090e32999713626 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 17 Sep 2012 18:35:18 -0700 Subject: [PATCH 6/9] Revert "Work around debian build issue related to node fibers." This reverts commit 6121400983cc692eddb1acf27ed1df5257fc1842. We will solve this by deleting distracting versions of fibers.node rather than by working around them. This will fix rpmbuild as well. --- admin/debian/rules | 6 ------ 1 file changed, 6 deletions(-) diff --git a/admin/debian/rules b/admin/debian/rules index 7b223eeb5e..6a83b44185 100755 --- a/admin/debian/rules +++ b/admin/debian/rules @@ -17,11 +17,5 @@ override_dh_prep: tar -C debian/tmp/usr/lib -xzf $(TARBALL) echo -n 'deb' > debian/tmp/usr/lib/meteor/.package_stamp -# node fibers distributes copies of the library pre-compiled for many -# different architectures. This confuses shlibdeps. Just ignore the -# fibers library. -override_dh_shlibdeps: - dh_shlibdeps -Xfibers.node - %: dh $@ From e50d71a208d1234ec6a2fc7cdcec4f5e541c66b6 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 17 Sep 2012 18:38:31 -0700 Subject: [PATCH 7/9] Only include the correct architecture's fibers.node in the dev bundle. --- admin/generate-dev-bundle.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/admin/generate-dev-bundle.sh b/admin/generate-dev-bundle.sh index efc27770e6..3761eef2a4 100755 --- a/admin/generate-dev-bundle.sh +++ b/admin/generate-dev-bundle.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -u BUNDLE_VERSION=0.2.2 UNAME=$(uname) @@ -182,7 +183,6 @@ npm install mongodb@1.1.5 npm install uglify-js@1.3.3 npm install clean-css@0.6.0 npm install progress@0.0.5 -npm install fibers@0.6.9 npm install useragent@1.1.0 npm install request@2.11.0 npm install http-proxy@0.8.2 @@ -201,6 +201,19 @@ git clone http://github.com/akdubya/rbytes.git npm install sockjs@0.3.1 rm -rf rbytes +npm install fibers@0.6.9 +# 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 +# libstd++. Remove all the ones other than our architecture. (Expression based +# on build.js in fibers source.) +FIBERS_ARCH=$(node -p -e 'process.platform + "-" + process.arch + "-v8-" + /[0-9]+\.[0-9]+/.exec(process.versions.v8)[0]') +cd fibers/bin +mv $FIBERS_ARCH .. +rm -rf * +mv ../$FIBERS_ARCH . +cd ../.. + cd "$DIR" curl "$MONGO_URL" | tar -xz From 9285bd9cabebf184a08e27e795f6016283ba3350 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 17 Sep 2012 18:51:21 -0700 Subject: [PATCH 8/9] Bump dev bundle version number to 0.2.3. --- admin/generate-dev-bundle.sh | 2 +- meteor | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/generate-dev-bundle.sh b/admin/generate-dev-bundle.sh index 3761eef2a4..6f495e7c2d 100755 --- a/admin/generate-dev-bundle.sh +++ b/admin/generate-dev-bundle.sh @@ -3,7 +3,7 @@ set -e set -u -BUNDLE_VERSION=0.2.2 +BUNDLE_VERSION=0.2.3 UNAME=$(uname) ARCH=$(uname -m) diff --git a/meteor b/meteor index 34c354c120..70e583c498 100755 --- a/meteor +++ b/meteor @@ -1,6 +1,6 @@ #!/bin/bash -BUNDLE_VERSION=0.2.2 +BUNDLE_VERSION=0.2.3 # OS Check. Put here because here is where we download the precompiled # bundles that are arch specific. From 7ff08603a9b0912927df1a3f4621b3b245be3f4a Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Mon, 17 Sep 2012 22:15:05 -0700 Subject: [PATCH 9/9] Catch errors in Meteor.publish handlers Previously, it seemed that bugs in publishers would sometimes prevent future subscriptions from working, grinding the app to a halt. --- packages/livedata/livedata_server.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/livedata/livedata_server.js b/packages/livedata/livedata_server.js index 5454629b40..e10c9d73de 100644 --- a/packages/livedata/livedata_server.js +++ b/packages/livedata/livedata_server.js @@ -314,7 +314,13 @@ _.extend(Meteor._LivedataSession.prototype, { else self.universal_subs.push(sub); - var res = handler.apply(sub, params || []); + try { + var res = handler.apply(sub, params || []); + } catch (e) { + Meteor._debug("Internal exception while starting subscription", sub_id, + e.stack); + return; + } // if Meteor._RemoteCollectionDriver is available (defined in // mongo-livedata), automatically wire up handlers that return a