749 Commits

Author SHA1 Message Date
David Glasser
e27304c999 Work around Node 0.8 brokenness with using /dev/stdin in subprocesses. 2012-09-19 13:50:06 -07:00
David Glasser
f0fd0c476c Make sure that Mongo remove calls finish before returning from _Mongo.remove.
This started causing test failures in deployed tests while testing the 0.4.1
release candidate; we think this may be related to bumping the mongodb node
driver version. (Maybe the change to this.poolSize in
f81870f7da
?)
2012-09-18 15:54:19 -07:00
David Greenspan
7b036318e7 Fix Spark CSS updating tests in Safari 4, iPad 2012-09-18 15:02:07 -07:00
David Greenspan
a0ded8c3d0 Fix Spark in Firefox 3.6-4 2012-09-18 15:01:28 -07:00
David Greenspan
1cf759ed7e Unit test driver on iPad: make tests clickable 2012-09-18 15:01:12 -07:00
David Glasser
58af66a110 Make email tests pass when deployed. 2012-09-18 13:30:41 -07:00
David Greenspan
1caf2da2b5 fix CSS preproc tests when Chrome is zoomed 2012-09-18 11:23:49 -07:00
David Greenspan
7ff08603a9 Catch errors in Meteor.publish handlers
Previously, it seemed that bugs in publishers would sometimes
prevent future subscriptions from working, grinding the app to
a halt.
2012-09-17 22:17:32 -07:00
David Glasser
7ffd598e26 Don't tell end users to run "meteor add". 2012-09-17 15:20:54 -07:00
David Glasser
374dd8f39b Make sure under_score names work in package tests. 2012-09-17 15:03:06 -07:00
David Greenspan
ce4e415bb7 jQuery dependency package.js changes 2012-09-17 14:42:28 -07:00
David Greenspan
d50654bbee whitespace 2012-09-17 14:42:28 -07:00
David Greenspan
f1a932c1df Error if no jQuery and no querySelectorAll (IE 7) 2012-09-17 14:42:27 -07:00
David Greenspan
efd5560b0f Remove Meteor dependency on jQuery/Sizzle
Meteor will use jQuery for selector matching if it's present on the
client (which at the moment is always), but it now will use bare
querySelectorAll on modern browsers and IE 8+ if there is no jQuery.
There is no other dependence on jQuery in Meteor.
2012-09-17 14:42:27 -07:00
David Glasser
5e622215ba Change all publicly documented APIs to use camelCase.
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.
2012-09-17 14:26:45 -07:00
David Greenspan
3364cb7b64 Clean up Spark efficient events hack with DomUtils
To test whether an element in the event bubbling chain matches a
selector, we now modify the selector to include an ID for the
element in question (which we assign if it doesn't have one),
so we search for one node rather than listing and checking all
nodes that match the selector!  This makes a huge speed difference in
the jsparse demo, which binds a global handler over a big DOM tree.

The new domutils are matchesSelector(element, contextNode, selector)
and matchesSelectorClipped(element, contextNode, selector, clipStart,
clipEnd).

Note: Eventually make the args more like this W3C working draft:
http://www.w3.org/TR/selectors-api2/#matches
2012-09-17 11:47:46 -07:00
David Greenspan
e80066a9ef DomUtils.elementOrder rename and flip
=> compareElementIndex and returns -1,0,1 in the
tradition of comparators rather than the opposite
2012-09-17 11:47:46 -07:00
David Greenspan
6df0e5b88f spark efficiency hack 2012-09-17 11:47:46 -07:00
fivethirty
2c62b1df93 bump bootstrap from 2.0.4 to 2.1.1 2012-09-16 12:10:21 -07:00
David Greenspan
ffd6461e58 Simpler try/finally in deps 2012-09-16 01:30:16 -07:00
David Greenspan
e8256ef866 Spark._currentRenderer not an EnvironmentVariable
This isn't the kind of dynamic var that should
persist into timer callbacks, it should just be
on the stack.  Also cuts dependence of spark
on dynamics.
2012-09-16 01:22:21 -07:00
David Greenspan
10fdc9b261 Unit test for fix to #323 2012-09-16 01:09:36 -07:00
David Greenspan
5d9ff80461 Remove special Tinytest timer functions 2012-09-16 00:34:54 -07:00
David Greenspan
dcd26415fe Allow timer callbacks to participate in WriteFences.
This is a carefully considered change motivated by Tinytest, which
fires timers from a method and then waits for them before returning.
Because the timer callbacks didn't have a WriteFence, we had a race
condition a while back where the test client would quiesce before all
the results came in, which I fixed by giving Tinytest its own timer
functions that kept the environment, including the WriteFence.
I want to tear these special timer functions out now, since they are
necessary (before this commit) for very obscure reasons.  The race
condition is hard to reproduce and is affected by Mongo latency, the
order of the unit tests, etc.  (I reproduced it semi-stably to test
this commit, and it was tricky.)

The change is to give timer callbacks the WriteFence and allow them
to add writes before or after the fence fires.  Writes that they get
in before the fence is armed are included in the fence, and writes
made after the fence fires still succeed (the fence is "retired" and
doesn't complain that it has already fired).  In practice, this means
that methods that care about the writes happening as part of the
method, like Tinytest's run method, can wait for them, and methods
that don't care to wait will just return and let the writes trickle
down the pipe later (as they could before).

In a discussion with Geoff a few weeks ago, he said fences in general
should still complain about late writes unless they are put in a
special mode, so there is now a retire() method.
2012-09-16 00:34:37 -07:00
Tom Coleman
6a4f20ae55 Better error reporting for coffescript.
Use CS's inbuilt filename reporting, and use `bundle.error` rather than throwing.
Fixes #331
2012-09-16 12:10:09 +10:00
David Greenspan
8bd77fab4b add missing semicolon 2012-09-15 18:32:06 -07:00
David Greenspan
755b1bcfa2 fix Spark constant patching by improving elementContains (fix #323) 2012-09-15 13:34:04 -07:00
David Glasser
f340c35c02 Basic email support. 2012-09-14 18:38:29 -07:00
David Glasser
9cbd1fc888 Spark no-op fix: If we're going to annotate list items with a typed range, we
should be consistent and do that for non-initial items as well. (Nothing ever
looks for this type currently, though.)
2012-09-12 16:58:28 -07:00
David Glasser
951d62f401 Make LocalCollection.remove(id) O(1) instead of O(n). 2012-09-11 16:33:23 -07:00
David Glasser
64b8f77f05 Don't _diffQuery on the client unless necessary.
We want to _diffQuery when we've just quiesced after a method completion or a
subscription becomes ready, but if we're in the steady state and just got a
single subscription update from the server, we can run observers directly (which
should be faster).
2012-09-11 15:57:04 -07:00
David Greenspan
43a356a0be Fall back to UNIQUE_LABEL on {{#each cursor}} (#281) 2012-09-10 11:59:18 -07:00
Avital Oliver
c3bb216466 Make Handlebars.Exception properly report error text and stack trace 2012-09-07 10:55:17 -07:00
David Glasser
233626de86 Make Meteor.Cursor.forEach fully synchronous even if the user's callback yields.
Previously, if the callback yields (eg, if it does a DB query), the next
iteration of the callback could run, or the forEach could finish entirely,
because the future we waited on only checked to ensure that the callback was
*started* on all documents, not *finished*.

Fixes #321. Thanks to Scott Anderson for bug report with minimal reproduction
case.
2012-09-06 10:20:22 -07:00
David Greenspan
43e2562967 depend on Sizzle, not jQuery 2012-08-30 13:26:04 -07:00
David Greenspan
4664e0f506 Don't leak deps from template callbacks (fix #306) 2012-08-30 11:42:46 -07:00
Tom Coleman
2b7557472d Fixed problem with LocalCollection._deepcopy destroying dates.
In the browser, `deepcopy` seemed to be successfully cloning dates, but server-side this was not the case. Commit b21da0f274 introduced a `deepcopy` to the process of pulling data out of mongo, so this is needed. Fixes #295
2012-08-29 21:26:39 -07:00
Nick Martin
6f8f08714b Merge branch 'devel' into spark 2012-08-27 13:48:45 -07:00
David Greenspan
9005cf34a0 more events decl changes 2012-08-23 12:23:07 -07:00
David Greenspan
99c0bfc548 Wrap all templates in labelBranch with name
This allows multiple helpers with different names to be called from a Template helper with no landmark ambiguity.
2012-08-23 11:58:14 -07:00
David Greenspan
0ddc169a9c fix race condition on list cleanup 2012-08-22 18:40:47 -07:00
David Greenspan
379f608043 begin updating examples for new API 2012-08-22 18:14:15 -07:00
David Greenspan
9fe768989f past-tense created/rendered/destroyed
Consensus is that "render" is too confusing a name for what's obviously a callback (after the template is rendered).  We prefer past tense rather than oncreate, onrender, ondestroy.
2012-08-22 16:58:48 -07:00
David Greenspan
c149a10735 Spark.UNIQUE_LABEL, no matching in bare each 2012-08-22 16:21:52 -07:00
David Greenspan
b379b03f70 all Handlebars helpers drop branch labels 2012-08-22 15:44:51 -07:00
David Greenspan
0efe0e26d3 Spark.labelBranch safe on non-element-balanced HTML 2012-08-22 15:15:41 -07:00
David Greenspan
a995e364bf Fix preserve bug causing landmark not to match
Landmarks nested inside a DOM node in a re-rendered range weren't
being preserved, because the selector was being run on the old
DOM and new DOM with the context node from the old DOM.  Fix is to
only use the preservation root 'context' option for the case where
the landmark is above the re-rendered region.
2012-08-22 15:02:31 -07:00
David Greenspan
4794ebc447 minor test changes 2012-08-22 14:30:09 -07:00
David Greenspan
2283e3e76f fix removeEventListener args (FF test failure) 2012-08-22 12:11:55 -07:00
David Greenspan
e3c3fc6674 minor comment tweak 2012-08-22 11:19:27 -07:00