From d098b99bd8502ce4dbac8327f3cabcd60acb9fa8 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Fri, 12 Apr 2013 10:56:52 -0700 Subject: [PATCH 1/7] Avoid log spam on deployed apps from websocket unless you're actually using server-to-server DDP. --- packages/livedata/stream_client_nodejs.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/livedata/stream_client_nodejs.js b/packages/livedata/stream_client_nodejs.js index 312d7552052..70f83650959 100644 --- a/packages/livedata/stream_client_nodejs.js +++ b/packages/livedata/stream_client_nodejs.js @@ -1,9 +1,3 @@ -// WebSocket-Node https://github.com/Worlize/WebSocket-Node -// Chosen because it can run without native components. It has a -// somewhat idiosyncratic API. We may want to use 'ws' instead in the -// future. -var WebSocketClient = Npm.require('websocket').client; - // @param endpoint {String} URL to Meteor app // "http://subdomain.meteor.com/" or "/" or // "ddp+sockjs://foo-**.meteor.com/sockjs" @@ -18,7 +12,22 @@ var WebSocketClient = Npm.require('websocket').client; Meteor._DdpClientStream = function (endpoint) { var self = this; - self.client = new WebSocketClient; + // WebSocket-Node https://github.com/Worlize/WebSocket-Node + // Chosen because it can run without native components. It has a + // somewhat idiosyncratic API. We may want to use 'ws' instead in the + // future. + // + // Since server-to-server DDP is still an experimental feature, we only + // require the module if we actually create a server-to-server + // connection. This is a minor efficiency improvement, but moreover: while + // 'websocket' doesn't require native components, it tries to use some + // optional native components and prints a warning if it can't load + // them. Since native components in packages don't work when transferred to + // other architectures yet, this means that require('websocket') prints a + // spammy log message when deployed to another architecture. Delaying the + // require means you only get the log message if you're actually using the + // feature. + self.client = new Npm.require('websocket').client; self.endpoint = endpoint; self.currentConnection = null; From c059c384fdf9e7169f25cc36d86fbc0ed0a9da83 Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Fri, 12 Apr 2013 11:27:57 -0700 Subject: [PATCH 2/7] Unbreak Meteor when run from a home directory with spaces. http://stackoverflow.com/questions/15970272/cant-properly-install-meteor-0-6-1 --- meteor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meteor b/meteor index 784936e8273..b6f76317e29 100755 --- a/meteor +++ b/meteor @@ -32,9 +32,9 @@ PLATFORM="${UNAME}_${ARCH}" # Find the script dir, following one level of symlink. Note that symlink # can be relative or absolute. Too bad 'readlink -f' is not portable. ORIG_DIR=$(pwd) -cd $(dirname "$0") -if [ -L "$(basename $0)" ] ; then - cd $(dirname $(readlink $(basename "$0") ) ) +cd "$(dirname "$0")" +if [ -L "$(basename "$0")" ] ; then + cd "$(dirname $(readlink $(basename "$0") ) )" fi SCRIPT_DIR=$(pwd -P) cd "$ORIG_DIR" From 266431293b1db743c1c5d687714aa78f152056ea Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Fri, 12 Apr 2013 12:25:08 -0700 Subject: [PATCH 3/7] Update History.md --- History.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/History.md b/History.md index 84b1af855ef..86a65ce3f18 100644 --- a/History.md +++ b/History.md @@ -1,6 +1,11 @@ ## vNEXT +* Better stack traces for Meteor.Error. + +* Unbreak Meteor when running from a home directory with spaces. + http://stackoverflow.com/questions/15970272/cant-properly-install-meteor-0-6-1 + * `Spiderable.userAgentRegExps` can now be modified to change what user agents are treated as spiders by the `spiderable` package. From 168433beacec7b7b575b3708f57fa67a8ab19135 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Fri, 12 Apr 2013 13:21:12 -0700 Subject: [PATCH 4/7] Follow-up to d098b99b: make it work. --- packages/livedata/stream_client_nodejs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livedata/stream_client_nodejs.js b/packages/livedata/stream_client_nodejs.js index 70f83650959..b280561eea0 100644 --- a/packages/livedata/stream_client_nodejs.js +++ b/packages/livedata/stream_client_nodejs.js @@ -27,7 +27,7 @@ Meteor._DdpClientStream = function (endpoint) { // spammy log message when deployed to another architecture. Delaying the // require means you only get the log message if you're actually using the // feature. - self.client = new Npm.require('websocket').client; + self.client = new (Npm.require('websocket').client)(); self.endpoint = endpoint; self.currentConnection = null; From 7a05b7f1a418b74bd55f20086bff2dc3d93a34da Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Fri, 12 Apr 2013 13:58:01 -0700 Subject: [PATCH 5/7] remove unused var --- packages/spark/spark.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/spark/spark.js b/packages/spark/spark.js index d28a3a198ec..b94a72092b2 100644 --- a/packages/spark/spark.js +++ b/packages/spark/spark.js @@ -884,7 +884,6 @@ var applyChanges = function (doc, changeFields) { var idStringify; -var idParse; if (typeof LocalCollection !== 'undefined') { idStringify = function (id) { From 06252771137598e916faa4a733060d0539dd0276 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Fri, 12 Apr 2013 19:48:39 -0700 Subject: [PATCH 6/7] Document EJSON.isBinary. --- docs/client/api.html | 2 ++ docs/client/api.js | 7 +++++++ docs/client/docs.js | 1 + 3 files changed, 10 insertions(+) diff --git a/docs/client/api.html b/docs/client/api.html index e73cc060e51..2f9d40361ac 100644 --- a/docs/client/api.html +++ b/docs/client/api.html @@ -2635,6 +2635,8 @@

EJSON

containing numbers ranging from 0 to 255, and the `$Uint8ArrayPolyfill` key set to `true`. +{{> api_box ejsonIsBinary}} + {{> api_box ejsonAddType}} When you add a type to EJSON, Meteor will be able to use that type in: diff --git a/docs/client/api.js b/docs/client/api.js index e6f949c9685..a3367f4ba5a 100644 --- a/docs/client/api.js +++ b/docs/client/api.js @@ -140,6 +140,13 @@ Template.api.ejsonNewBinary = { descr: ["Allocate a new buffer of binary data that EJSON can serialize."] }, +Template.api.ejsonIsBinary = { + id: "ejson_is_binary", + name: "EJSON.isBinary(x)", + locus: "Anywhere", + descr: ["Returns true if `x` is a buffer of binary data, as returned from [`EJSON.newBinary`](#ejson_new_binary)."] +}, + Template.api.ejsonAddType = { id: "ejson_add_type", name: "EJSON.addType(name, factory)", diff --git a/docs/client/docs.js b/docs/client/docs.js index 658656a22fc..352262e2126 100644 --- a/docs/client/docs.js +++ b/docs/client/docs.js @@ -288,6 +288,7 @@ var toc = [ {name: "EJSON.equals", id: "ejson_equals"}, {name: "EJSON.clone", id: "ejson_clone"}, {name: "EJSON.newBinary", id: "ejson_new_binary"}, + {name: "EJSON.isBinary", id: "ejson_is_binary"}, {name: "EJSON.addType", id: "ejson_add_type"}, [ {instance: "instance", id: "ejson_type_clone", name: "clone"}, From 93497be27f3e7fee0bdde39daa8c907bee214f0b Mon Sep 17 00:00:00 2001 From: Nick Martin Date: Fri, 12 Apr 2013 20:42:17 -0700 Subject: [PATCH 7/7] History.md additions and tweaks. --- History.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/History.md b/History.md index 86a65ce3f18..5f21fbf0da5 100644 --- a/History.md +++ b/History.md @@ -1,22 +1,32 @@ ## vNEXT -* Better stack traces for Meteor.Error. +* Better stack traces for `Meteor.Error`. -* Unbreak Meteor when running from a home directory with spaces. - http://stackoverflow.com/questions/15970272/cant-properly-install-meteor-0-6-1 +* Add per-package upgrade notices to `meteor update`. + +* Experimental server-to-server DDP support: `Meteor.connect` on the + server will connect to a remote DDP endpoint via WebSockets. Method + calls should work fine, but subscriptions and minimongo on the server + are still a work in progress. + +* Upgrade d3 from 2.x to 3.1.4. See + https://github.com/mbostock/d3/wiki/Upgrading-to-3.0 for compatibility notes. + +* Return the inserted documented ID from `LocalCollection.insert`. #908 * `Spiderable.userAgentRegExps` can now be modified to change what user agents are treated as spiders by the `spiderable` package. -* Return the inserted documented ID from LocalCollection.insert. #908 +* Prevent observe callbacks from affecting the arguments to identical + observes. #855 -* Prevent observe callbacks from affecting the arguments to identical observes. #855 +* Fix meteor command line tool when run from a home directory with + spaces in its name. -* Upgrade d3 from 2.x to 3.1.4. See - https://github.com/mbostock/d3/wiki/Upgrading-to-3.0 for compatibility notes. +Patches contributed by GitHub users andreas-karlsson, jacott, +joshuaconner, and timhaines. -Patches contributed by GitHub users andreas-karlsson, jacott, and joshuaconner. ## v0.6.1 @@ -27,6 +37,7 @@ Patches contributed by GitHub users andreas-karlsson, jacott, and joshuaconner. Patches contributed by GitHub users andreas-karlsson and awwx. + ## v0.6.0 * Meteor has a brand new distribution system! In this new system, code-named