Commit Graph

6133 Commits

Author SHA1 Message Date
David Greenspan
135aefbdee Fix broken newargs semantics
All tests pass (except one which is a todo on shark).

If `{{> foo bar}}` is to desugar into `{{#with bar}}{{> foo}}{{/with}}`, there needs to be an explicit block in the generated code in which `self.lookup("foo")` binds the correct data context (`bar`).  So we now generate a UI.With rather than trying to call it from Spacebars.include.  This simplifies Spacebars.include, which is nice.

Define `lookupTemplate` because `self.lookup(.., {template: true})` pretty-prints bigly.
2014-02-02 12:26:48 -08:00
David Greenspan
ae21a7e4dd Add an XXX for failing test 2014-02-01 22:26:36 -08:00
David Greenspan
45b5885def Move re-render's isolateValue to UI; fix bugs
* Use isolateValue around `foo` in `{{> foo}}` as well as `{{#foo}}` (i.e. whether or not there's a content block)
* Make UI.With always embox its argument; this is achieved by moving embox/isolateValue from Spacebars into UI.  As a side effected, all reactive closures now use isolateValue, so we avoid re-rendering in a few more cases.
* Avoid calling data argument of `{{#with someHelper}}` twice ever instead of once ever (when helper isn't invalidated)
2014-02-01 19:58:13 -08:00
David Greenspan
ad5c294624 whitespace 2014-02-01 19:44:19 -08:00
David Greenspan
a7575b2d2e Remove stray console.log 2014-02-01 19:43:50 -08:00
David Greenspan
a538501efe Fix bug in newargs; fix some tests 2014-01-29 18:32:47 -08:00
David Greenspan
36ab81daa3 Merge remote-tracking branch 'origin/shark' into shark-newargs
Conflicts:
	packages/spacebars-compiler/compile_tests.js
	packages/spacebars-compiler/spacebars-compiler.js
2014-01-29 18:30:31 -08:00
Avital Oliver
f21e63b495 Merge branch 'devel' into shark 2014-01-29 14:32:45 -08:00
Avital Oliver
fb446cbe16 Tests for our _.each patch 2014-01-29 14:32:13 -08:00
David Glasser
9b7ac6080b History update 2014-01-29 13:53:43 -08:00
yeputons
4facd57f5f #1751: add IPv6 loopback check to force-ssl 2014-01-29 13:52:48 -08:00
Avital Oliver
3347009f51 Merge branch 'devel' into shark 2014-01-29 13:19:14 -08:00
Avital Oliver
a4b9dd52f3 Fix _.each patch on IE.
The patch was originally introuduced in
bab936eac9
2014-01-29 13:17:34 -08:00
Avital Oliver
da3c410f56 Improve {{> foo}} lookup test release/shark-1-29-2014-e 2014-01-29 11:16:29 -08:00
Avital Oliver
4676a71af0 Add test for {{> foo}} lookup in data context 2014-01-29 10:30:55 -08:00
Avital Oliver
6d0348da5d Improve {{> foo}} lookup order
We now look for a helper named 'foo' (which can return
a dynamically chosen template object) before looking
for a global template named 'foo'. This is consistent
with the principle that adding a helper should generally
override other things with the same name (ie data properties)

This change was motivated by frontpage, which had both
a template and a helper named 'body'.
2014-01-28 22:53:31 -08:00
David Glasser
764ceb6077 add a test for observeChanges/limit/initial 2014-01-28 17:44:48 -08:00
David Glasser
25fd3a344c optionify LocalCollection._getRawObjects 2014-01-28 17:44:48 -08:00
David Glasser
9f253e6a0b minimongo: Make update-by-id O(1) 2014-01-28 17:44:48 -08:00
David Glasser
4352b79502 clean up minimongo 'query' object
delete unused fields, rename underscored fields
2014-01-28 15:41:53 -08:00
David Glasser
c8a1df81a7 optimize paused remove({}) which oplog uses 2014-01-28 15:41:53 -08:00
David Glasser
cf3ffa88a9 check for paused earlier 2014-01-28 15:12:14 -08:00
Avital Oliver
f728523599 Merge branch 'devel' into shark release/shark-1-29-2014-c 2014-01-28 15:00:19 -08:00
David Glasser
604cd853f3 Update http-proxy to 1.0.2 from our fork of 1.0.1
Only real change is changing a bad console.log into invoking our error
handler, which we need for not printing too much junk in the runner
  https://github.com/nodejitsu/node-http-proxy/commit/daad4703
2014-01-28 11:57:36 -08:00
Slava Kim
cb2f2adb1b Do less deep copies 2014-01-28 10:11:27 -08:00
David Glasser
297b97659b Merge branch 'oplog-localcollection' into devel 2014-01-27 22:34:59 -08:00
David Glasser
a65b978972 Refactor OplogObserveDriver to use LocalCollection
This should be a good starting point for implementing limit/sort/skip.
2014-01-27 21:57:00 -08:00
David Glasser
980b70596d More comments about our sort inconsistency 2014-01-27 21:56:17 -08:00
David Glasser
782ff1bcae Optionify the barely-used LocalCollection name arg 2014-01-27 21:40:24 -08:00
David Glasser
ed83f00fc1 Rename _SynchronousQueue to _UnyieldingQueue
Allow server uses of LocalCollection to prefer _UnyieldingQueue. This
will mean that, as long as their observeChanges callbacks do not yield,
calls to insert/update/remove will not yield either.
2014-01-27 21:19:32 -08:00
David Glasser
390dafea01 Move _SynchronousQueue into another file
This commit does not build but exists so that the next commit shows
diffs better.
2014-01-27 21:18:24 -08:00
David Glasser
f065ffd80f Merge branch 'devel' into shark
Conflicts:
	packages/minimongo/minimongo.js
	packages/minimongo/observe.js
	packages/minimongo/wrap_transform.js
	packages/mongo-livedata/collection.js
	packages/mongo-livedata/mongo_driver.js
	packages/mongo-livedata/mongo_livedata_tests.js
2014-01-27 16:34:15 -08:00
David Glasser
204959b509 Fix pronoun in docs 2014-01-27 16:30:43 -08:00
David Glasser
f53bf0ab82 Docs for wrapTransform 2014-01-27 16:29:59 -08:00
David Glasser
c18f7339bf Merge branch 'shark-backports' into devel 2014-01-27 16:24:12 -08:00
David Glasser
d577b05136 Review of wrapTransform with avital
- move _makeNonreactive into wrapTransform
- Use EJSON.equals for _id comparison
- Return null for nonexistent transforms
- Use isPlainObject for objectness check
- Add unit tests; remove some end-to-end tests

Also, add an EJSON.clone to the recently backported observeHandle._fetch
2014-01-27 16:22:30 -08:00
David Greenspan
89b11490d6 Fix "atoms" title tag 2014-01-27 15:27:32 -08:00
David Glasser
b5a14c5d30 Initial backport of wrapTransform from shark 2014-01-27 15:25:19 -08:00
David Glasser
20766ac05e Backport observeHandle._fetch from shark 2014-01-27 15:25:19 -08:00
David Glasser
c5e90053f2 Fix bug caused by d868325 2014-01-27 15:22:55 -08:00
David Greenspan
5038c63d08 Merge shark, including shark-isolate-helpers work 2014-01-27 15:21:23 -08:00
David Greenspan
b26f0271a0 Rename HTML.evaluate{Dynamic,}Attributes 2014-01-27 14:44:19 -08:00
David Greenspan
599ac16632 Treat null/undefined/false attributes as absent
So, in HTML, the following are equivalent, and both mean that a checkbox is checked, because the `checked` attribute is present:

- `<input type="checkbox" checked>`
- `<input type="checkbox" checked="">`

We can't mess with that.  On the other hand, in Spacebars before this commit, the following would *also* result in the checkbox being checked, regardless of whether `foo` evaluates to null, undefined, false, or the empty string:

- `<input type="checkbox" checked={{foo}}>`
- `<input type="checkbox" checked="{{foo}}">`

With this commit, the checkbox will NOT be checked if `foo` evaluates to null, undefined, or false.

To achieve this:

- In HTMLjs, an attribute is considered absent if its value is "nully" after being fully evaluated (i.e. after expanding functions and components via HTML.evaluateDynamicAttributes / HTML.evaluate).  A nully value is one consisting of null, undefined, an empty array, or an array of those things.  `false` is not nully and renders as "false".  An empty string is not nully, and will "prop open" an attribute that would otherwise collapse into absence.

- Spacebars.mustache converts null, undefined, and false to null.  So if you use {{foo}} anywhere in a template and foo evaluates to "false", that gets to converted to a null in HTMLjs (which is ignored).  (true is rendered as "true".)

- When parsing HTML, an attribute that consists of *no tokens* becomes an empty string in the HTMLjs, which props open the attribute (unlike null or an empty array).  (Since comment tokens are stripped during tokenization, if there are only comments in an attribute value that counts as no tokens.)
2014-01-27 14:44:19 -08:00
David Greenspan
7c58b08f53 Fix an apparent typo 2014-01-27 14:44:19 -08:00
David Greenspan
54a2423acb Don't ignore falsy helpers
We were weirdly ignoring helpers that were falsy constants, so in `Template.main.foo = 0` / `{{foo}}` you'd get nothing, while if you did `Template.main.foo = function () { return 0; }` you would get "0".
2014-01-27 14:44:19 -08:00
David Greenspan
43cb4f8cc8 Rename tests in html-tools package to html-tools 2014-01-27 14:44:19 -08:00
David Glasser
3104ddb6e5 Style change to skel to match shark. 2014-01-27 14:17:31 -08:00
Avital Oliver
f8f94c7118 Try to fix inconsistent release manifest generation; Take 2 2014-01-27 14:15:53 -08:00
Avital Oliver
91c4d3d8a2 Try to fix inconsistent release manifest generation
Apparently on some platforms "a5" < "a-" and on others
"a-" < "a5"
2014-01-27 14:15:53 -08:00
David Glasser
b71d938f9d History update for jQuery backported from shark 2014-01-27 14:09:21 -08:00