This package was always included in apps, and even if it was possible to remove,
there wasn't a compelling story about when users would remove and replace
it. Plus, not all backwards-compatibility code could even live in it (eg, field
names of objects), so it was incomplete. It also introduced odd load order
constraints.
Instead, we introduce two conventions for backwards-compatibility code:
- Special comments of the form "// XXX COMPAT WITH 0.6.4"
- When feasible, put backwards-compatibility code in a file called
"deprecated.js" in the relevant package.
This is documented at:
https://github.com/meteor/meteor/wiki/Meteor-Style-Guide#deprecated-code-and-backwards-compatibility
Additionally, removed some symbols that existed for backwards compatibility with
Meteor 0.4.0 (changes made 10 months ago): Meteor.is_client, Meteor.is_server,
and (in a method) this.is_simulation.
Some package code is loaded in browsers, which may fail to parse code which uses
'return' or 'throw' as a method name. We used to inconsistently use fut.ret for
this purpose; instead, just consistently use fut['return'] and fut['throw']. We
don't bother to do this in tools code which is definitely never run outside of
Node.
Also remove some unused requires.
Fixes#1222.
Unfortunately, the Node Mongo driver wants to use its own proprietary
Binary type for binary data. We want to use Uint8Array, instead, so
we're going to be using a patched version of the BSON library that
allows this.
It allows us to install a handler for USER_DEFINED binary types, which
in our case we set up to recognize, accept, and provide Uint8Array
This works for server tests (Node uses v8) or for client tests in Chrome. Uses
a simple heuristic to guess which line in the stack trace is most likely to be
the actual high-level assertion. Adjustments to this heuristic and
implementations for other browsers are welcome :)
- Data streamed from the server is quiesced on a per-object basis, not a global
basis. We track which documents a method stubs modifies, and create individual
snapshots ("server documents") of those documents rather than whole-Collection
snapshots. Data writes from the server to documents not modified by stubs are
applied immediately to the local cache; other writes are applied to the
"server document" snapshots. Server documents are flushed to the local cache
when all method stubs that wrote to the document have sent their "data write"
message. (We still do "full database" quiescence after a reconnect.)
- Instead of calling method callbacks as soon as the result is received, we wait
until all data that precedes their "data done" message is flushed to the local
cache. This way, method callbacks can see all of their results locally. (This
applies to Collection mutator callbacks as well.) If this delay is
unacceptable, you can also specify the onResultReceived option to
Meteor.apply; this callback is given the method result as soon as it comes in,
and there's no guarantee that the local cache is up to date.
(This is a client-only change: server-side callbacks do not block on the
write fence.)
- Methods invoked with the "wait" option to Meteor.apply now wait until all
preceding methods are fully finished to be *sent*, not just to call their
callbacks. ie, previous calls block the "wait" method in the same way that
"wait" methods block subsequent calls.
- Remove Meteor.userLoaded and {{currentUserLoaded}}.
Meteor.userId() is now set only at the point where Meteor.user() is fully
loaded.
Current user data is published via an unnamed subscription, not via
"meteor.currentUser".
Replace them with Meteor.loggingIn() and {{loggingIn}}, which become true
as soon as the login method is sent (instead of only once it succeeds).
In accounts-ui, move the spinny into the dropdown, because it now shows up
before error messages would.
- Previously, if we received the "result" message from a method but no "data"
message, and then disconnected and reconnected, quiescence would be
permanently blocked. Now, not only do we allow the app to continue working,
but we even guarantee that the method's callback will be called at the
"reconnect quiescence" point.
- Remove reset function from the Store API (the interface between
_LivedataConnection and Collection), and add a boolean "reset" argument to
beginUpdate instead.
Add saveOriginals/retrieveOriginals functions to the Store API (pass-through
to minimongo implementation).
Allow "replace" messages to be passed to the Store API's update function
(in addition to set/unset).
Allow Store API implementations (eg tinytest_client) to not specify all
functions.
- Server-side tinytest results now stream into the result page instead of
appearing all at once at the end.
- Rename fields and methods of Meteor._LivedataConnection as camelCase, and
prepend all internal fields with _.
- Different Meteor._LivedataConnection objects now have separate
_userIdListeners _ContextSets.
- Remove snapshot/restore functionality from Minimongo collections. (Individual
queries still have result snapshots.) The "server documents" in
Meteor._LivedataConnection serve the equivalent purpose.
- Meteor.loginWithToken's callback is now a "call with error on error, call
with no args on success" callback like the other login callbacks.
- The test-only Meteor._LivedataConnection.onQuiesce function is removed.
Every single use of it is now supported by normal method callbacks.
Rely solely on indices (with some icky error parsing) to generate "user/email
already exists" errors.
Not yet making the ensureIndex API public. Not indexing the tiny
loginServiceConfiguration collection. Indexing tinytest_results.
For now, the old names still work as well.
This includes:
- Meteor.isServer/isClient
- this.isSimulation in methods
- Context.onInvalidate
- Meteor.status().retryCount/retryTime
Remove old backwards-compatibility "Sky" alias for "Meteor".
Update all examples in the docs to use camelCase.
Delete unused docs/client/projects.html file.
- A new `insecure` package reproduces the experience we had
before this change, in which all collections are by default
totally open to all changes
- With or without the `insecure` package, you can now call
collection.allow() to define which calls to the default
mutator methods should be allowed