106 Commits

Author SHA1 Message Date
David Greenspan
30d809c3f5 smartpatch comments 2012-04-26 11:51:36 -07:00
David Greenspan
02469a8031 more liverange docs 2012-04-26 11:18:08 -07:00
David Greenspan
55dd0eb494 test for event handler order in nested chunks 2012-04-26 11:18:08 -07:00
David Greenspan
8db8b54d7c findParent tests and fixes 2012-04-26 11:18:08 -07:00
David Greenspan
3cb5bf7c33 API cleanup and liverange documentation 2012-04-26 11:18:08 -07:00
David Greenspan
009c588ee3 refactor for clarity 2012-04-26 11:18:07 -07:00
David Greenspan
e533a1867e first working version of fixed event bugs 2012-04-26 11:18:07 -07:00
David Greenspan
4583a9e3f1 namespace jquery binds 2012-04-26 11:18:07 -07:00
David Greenspan
69efcbbbc6 comments 2012-04-26 11:18:07 -07:00
David Greenspan
3a09e65cb0 rename makeItem 2012-04-26 11:18:07 -07:00
David Greenspan
d4e2bd6475 fix events to properly target top-level elements 2012-04-26 11:18:07 -07:00
David Greenspan
49f2d6a90e IE mystery solved 2012-04-26 11:18:06 -07:00
David Greenspan
7ffb59fa61 use exec instead of replace for clarity 2012-04-26 11:18:06 -07:00
David Greenspan
c676cce057 get rid of liverange finalizers 2012-04-26 11:18:06 -07:00
David Greenspan
7fdea86f45 remove newly obsolete visit methods 2012-04-26 11:18:06 -07:00
David Greenspan
ffd02bf1aa move diff/patch into smartpatch 2012-04-26 11:18:06 -07:00
David Greenspan
365cd81f55 recursive liverange destroy 2012-04-26 11:18:06 -07:00
David Greenspan
4af0a8b9f7 move liverange cleanup into liveui 2012-04-26 11:18:06 -07:00
David Greenspan
bb2a6834af improved diff/patch fuzz test 2012-04-26 11:18:06 -07:00
David Greenspan
7e8279f245 shorter, random diff/patch fuzz test; clarify comments 2012-04-26 11:18:06 -07:00
David Greenspan
2614ad84bd extra test case 2012-04-26 11:18:06 -07:00
David Greenspan
9d5d6f2a52 LiveUI tests for current event selector limitations, plus reactive listener cleanup 2012-04-23 13:11:50 -07:00
David Greenspan
d734492e59 gitignore .meteor directories in packages 2012-04-17 20:02:00 -07:00
David Greenspan
1969148071 remove accidentally-committed line 2012-04-16 15:56:32 -07:00
David Greenspan
27227084cc Patch value of text fields when updating, unless element is focused 2012-04-16 15:33:45 -07:00
David Greenspan
7f25cd8a2b additional misc LiveUI tests 2012-04-16 15:29:55 -07:00
David Greenspan
fe7a6f6839 take render_mode callbacks out of Context into own special 2012-04-11 16:02:19 -07:00
David Greenspan
4d1689bb4d liveui: shorten CallbackReceiver code 2012-04-11 15:14:53 -07:00
David Greenspan
2866c154fe liveui: kill bounds checking in CallbackReceiver 2012-04-11 15:02:09 -07:00
David Greenspan
4cca9a8082 even more helpful LiveUI message on mismatched tags 2012-04-08 10:13:57 -07:00
David Greenspan
bf04fccb72 new query diffing algorithm with fuzz tests 2012-04-03 22:37:11 -07:00
David Greenspan
3dc7c83da0 use === in liveui 2012-04-03 22:30:56 -07:00
David Greenspan
ee3d306adc templates changes with Geoff (a couple fixes, a couple reverts, comments) 2012-04-03 22:30:54 -07:00
David Greenspan
d73c18aae5 fix extra event handlers in patching 2012-04-03 22:10:21 -07:00
Nick Martin
82ac8e324e fix listChunk event bug (with tests) 2012-04-03 22:10:21 -07:00
David Greenspan
89ce396ae5 Overhaul liveui & templating to support "smart patch" and rendering HTML (rebase-2) 2012-04-03 22:10:20 -07:00
Geoff Schmidt
b3fc3150d4 simplify signature of observe()'s remove callback 2012-03-16 18:26:19 -07:00
Geoff Schmidt
76c57526f7 rework public API for defining tests 2012-03-02 05:22:40 -08:00
Geoff Schmidt
cab5afbb91 move test reporting functions out of globals 2012-03-02 03:57:30 -08:00
Geoff Schmidt
f31226e388 rename minimongo Collection => LocalCollection 2012-02-16 22:41:16 -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
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
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
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
Geoff Schmidt
d1d5604976 Refactor bundler; new package API 2012-01-27 20:02:26 -08:00
Geoff Schmidt
e5eb42e55c Refactor package API/bundler 2012-01-27 20:02:24 -08:00
David Greenspan
c2c903f3ef fix a couple tests 2012-01-27 20:01:59 -08:00
David Greenspan
ad801a61ac add a TBODY in IE 2012-01-20 16:00:05 -08:00
David Greenspan
db3f8b3ebc jquery-like fragment creation, placeholder comments; still broken in IE 2012-01-20 16:00:05 -08:00