Previously, had only switched over the default for minimongo --
so there's lots of stuff that actually didn't work.
With this change, two tests are still failing; I will fix them and
then do some more cleanup tomorrow.
**Caveats:**
- I have not written any more tests; I perhaps should
- I have not yet written any code to keep current Collections from mixing
strings and ObjectIDs
- I don't actually know if the default should be ObjectID. I should discuss
with people about this.
... but preserve other types on the outside of minimongo.
So far passing all current regression tests, but moment of truth
when we switch over to ObjectID yet to come.
- Decide that queries need to be recomputed in _modifyAndNotify directly
instead of in _removeFromResults and friends; this is because the choice of
which _fooFromResults function to invoke might not actually be correct in the
presence of skip and limit. (The previous code still worked because all three
of those functions had the same code for the skip/limit case.)
- If update or remove affects more than one doc for a query, only recompute it
once at the end instead of once per doc.
- 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.
This will eventually be used to replace snapshot/restore. snapshot/restore are
used to implement full-database quiescence; saveOriginal/retrieveOriginal will
be used to implement per-object quiescence.
Also, throw on duplicate-ID insert.
Select from minimongo would match objects who different in deep keys (not
values). It seems like the object matching of selector.js was intended to work
this way (the name `b_keys` implies that it should be the keys of `b` after
all), but was mis-implemented.
Fixes#455 - a subtle bug with almost-overlapping subscriptions
(glasser added another test case and cleaned up test whitespace.)
Unordered observations have no moved callback and don't pass indices to the
other callbacks. This is used for the automatic cursor publication (because DDP
collections are not ordered) and for Cursor.count(). Internally, the results of
unordered observations are stored as objects instead of an array. This change
has no publicly observable changes, but should increase performance, especially
server-side (since the _diffQuery that drives DDP subscription updates no longer
needs the full complexity of the ordered move detector).
Also, minor optimization to LocalCollection.Cursor._getRawObjects where the
selector is a single ID that is not in the collection (now O(1) instead of
O(n)).
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.