341 Commits

Author SHA1 Message Date
Nick Martin
93cce72a65 Bump to version 0.1.4 v0.1.4 2012-02-09 15:02:04 -08:00
matt debergalis
99d3c6cdf5 cache bundled CSS and JS forever 2012-02-09 14:08:38 -08:00
Nick Martin
4abfc27128 Remove very spammy console message that were cluttering the console. 2012-02-08 22:48:45 -08:00
Nick Martin
23354ffcab Beginning of an automated test script for the CLI. 2012-02-08 22:44:43 -08:00
matt debergalis
4a39318519 Merge branch 'new-protocol' 2012-02-08 13:18:32 -08:00
Nick Martin
c84e8d572f Add a time field to the skeleton app's objects.
Skel counted empty objects, which Live Data will now delete.  Adding a
timestamp preserves each object.
2012-02-08 13:15:16 -08:00
Nick Martin
9273b9f69d Implement Live Data protocol: 'method' and 'result'.
The Minimongo insert/update/remove handlers are now implemented as
standard method invocations over the wire, though the client and server
implementations remain separate code paths.

Return values from server-side methods now get sent back to the client
via a 'result' message, but that result isn't wired up to anything
client-side yet.

Server now informs client when outstanding subscriptions and methods
invocations are fully reflected in 'data' messages back to the client.
2012-02-08 13:15:16 -08:00
Nick Martin
08fa853fca Implement Live Data protocol: 'connect' and 'connected'.
For now, high-level behavior is the same.  When the transport
disconnects, client doesn't attempt to reuse previous session.

Server always establishes a new Live Data session with each connect.
Server does not support method reply cache, and won't honor a client's
attempt to reuse a previous Live Data session id.
2012-02-08 13:11:14 -08:00
matt debergalis
acd3e24eec Implement Live Data protocol: 'sub', 'unsub', 'nosub'. 2012-02-08 13:10:58 -08:00
matt debergalis
d23b7ff197 Implement Live Data protocol: 'data'.
server now sends attribute diffs to the client, rather than sets of
documents.
2012-02-08 13:04:51 -08:00
Nick Martin
7a88230e48 Somehow 'reload' wasn't included in stream's package.js. Not sure how this worked for me previously. 2012-02-07 14:51:35 -08:00
David Greenspan
476db8cccb Meteor.Collection() -> new Collection() in tests 2012-02-07 12:06:51 -08:00
David Greenspan
f1368be4d8 Refactor liverange for clarity (and to learn it). Tests pass, whew! 2012-02-07 12:02:34 -08:00
Nick Martin
477dd7eed8 Merge branch 'automatic-reloads' 2012-02-06 23:16:25 -08:00
Nick Martin
88feb09b30 Comments and cleanups. 2012-02-06 23:15:31 -08:00
Nick Martin
c1c8f6f7fe Rework so as not to use window.location.hash. 2012-02-06 23:15:31 -08:00
Nick Martin
453cffe99a Make leaderboard safe for session being defined at startup (which happens on reloads). 2012-02-06 23:15:31 -08:00
Nick Martin
6623c245eb Implement reloading! Mostly works on Chrome. 2012-02-06 23:15:31 -08:00
Nick Martin
6f3cd0324c api.use must come before api.add_file otherwise it isn't loaded in time. 2012-02-06 23:15:31 -08:00
Nick Martin
03d06a33b1 Tweak retry timeout to try to reconnect quickly the first few times. This makes automatic reloads much faster. 2012-02-06 23:15:31 -08:00
Nick Martin
68511f2dc4 Wire up reload package. Doesn't actually do anything yet, but all the pieces should be in place now. 2012-02-06 23:15:31 -08:00
Nick Martin
cf4cab282e Add uuid to each server, make client save that off and reload if it changes. 2012-02-06 23:15:31 -08:00
Nick Martin
bd02b31a55 move uuid to it's own package, so stream can depend on it. 2012-02-06 23:15:31 -08:00
Nick Martin
8def45079a Queue connections while server is restarting. 2012-02-06 23:15:31 -08:00
matt debergalis
289818615c document findOne() 2012-02-06 18:58:31 -08:00
matt debergalis
6a0831d9b0 Align Minimongo and MongoDB semantics.
* remove() removes all documents in collection (previously, had to
  explicitly pass {} selector to MM).

* update() requires {multi: true} to update multiple documents.
  Previously we defaulted to true, now multi defaults to false.
2012-02-06 18:17:53 -08:00
matt debergalis
42f82d9f63 don't use options.limit in findOne() 2012-02-02 18:12:20 -08:00
matt debergalis
32d1e985a6 Document status states. 2012-02-02 17:26:04 -08:00
matt debergalis
0b3907a476 Import Meteor documentation 2012-02-02 17:20:07 -08:00
matt debergalis
6851bf66ae Make falsey and {_id: <falsey>} selectors match nothing.
In Livedata and Minimongo, make falsey selectors match no documents,
instead of all documents.  Same for {_id: undefined}.  This is a
departure from most MongoDB drivers, but offers a safety belt around
selectors that are rarely useful and easy to accidentally create
programmatically.

For remove(), also protect against accidentally destroying an entire
collection when passing no args.  To empty a collection, pass the
wildcard selector explicitly: foo.remove({});

For find(), keep the standard mongo behavior of returning all documents
when no selector is passed in by explicitly checking arguments.length.

This change also makes typical read cases cleaner, allowing:

 x = foo.findOne(Session.get('foo_id'));

instead of

 x = Session.get('foo_id') && foo.findOne(Session.get('foo_id'));
2012-02-02 16:46:43 -08:00
matt debergalis
c1d81b9f71 fix Collection.find() callsite in subscribe 2012-02-02 16:46:43 -08:00
Nick Martin
16315ee3b1 Bump to version 0.1.3 v0.1.3 2012-01-31 21:46:06 -08:00
Geoff Schmidt
36ee0d7dba fix 'meteor list' after running package tests 2012-01-31 21:34:53 -08:00
Nick Martin
8e4dede502 Bump to version 0.1.2 v0.1.2 2012-01-30 17:25:13 -08:00
Nick Martin
b024390adf Also ignore .git directories. 2012-01-30 16:04:52 -08:00
Nick Martin
2b521b72be Use new package API 2012-01-30 16:04:43 -08:00
Nick Martin
db627bf6eb Merge branch 'collection-api-cleanup' 2012-01-30 13:48:19 -08:00
Nick Martin
93ff43bb78 Remove stray console.log. 2012-01-30 12:42:23 -08:00
matt debergalis
44fb1d2150 use findOne() and set initial timestamp on items. 2012-01-30 12:03:18 -08:00
matt debergalis
0fa1d39cf7 simplify Collection API.
drops get(), fetch(n), and Collection.STOP
2012-01-30 12:03:06 -08:00
matt debergalis
fbf143a7e6 drop LiveResultsSet#indexOf 2012-01-28 18:38:44 -08:00
David Greenspan
b12465ffff Merge branch 'master' of github.com:meteor/meteor 2012-01-28 00:10:40 -08:00
David Greenspan
f2e6838691 fixes to minimongo, test driver, and tests 2012-01-28 00:10:35 -08:00
Geoff Schmidt
c616e4fb8b deploy --tests 2012-01-28 00:09:17 -08:00
Nick Martin
118a217fde Comment on bad side-effect of process.exit. 2012-01-27 23:37:37 -08:00
Nick Martin
b367f4a6e1 Add logging package and make call sites use it. This should clear up any lingering IE console issues. 2012-01-27 23:19:48 -08:00
Geoff Schmidt
18a3905052 make reload DTRT when there are parse errors in package.js 2012-01-27 22:57:07 -08:00
Geoff Schmidt
da9dfc03a6 reloading was broken. fix it. 2012-01-27 22:57:07 -08:00
matt debergalis
fc738af5d0 spacing 2012-01-27 20:59:08 -08:00
matt debergalis
5e7daaaff3 New Collection API
The new Collection API separates query handles from result sets.  It
allows template iterators to only redraw changed objects instead of
entire result sets.  This implementation also sets the stage for
minimongo indexes and better invalidation performance.

collection.find() now returns a Collection.Query handle.  To retrieve
results we provide these methods on Collection.Query:

Iterators (encouraged way to access results):

 * query.forEach(function (obj) { ... });
 * results = query.map(function (obj) { ... });

Cursor-based retrieval (iterators are built on fetch):

 * docs = query.fetch(maxlen); // return next [maxlen] (all) docs.
 * doc = query.get(skip);      // return next doc, skipping [skip] (0) docs.

Counter:

 * length = query.count(); // number of results in query.

Live queries (replaces findLive):

 * live_handle = query.observe({added: function (obj, idx) { ... },
                                removed: function (id, idx) { ... },
                                changed: function (obj, idx) { ... },
                                moved: function (obj, old_idx, new_idx) { ... }});

Convenience finders:

 * doc = collection.findOne({color: 'red'});
 * doc = collection.findOne(id_val);

On the client, calling forEach(), map(), fetch(), get(), or findOne()
inside an invalidation context will register a dependency on the entire
query result.  Any change to any objects invalidates the context.

Calling count() inside an invalidation context will register a
dependency that only triggers if objects enter or leave the result set.

Calling observe() does not register a dependency.
2012-01-27 20:59:08 -08:00