Commit Graph

7672 Commits

Author SHA1 Message Date
David Greenspan
ff0708bb39 fix Blaze._toDOM 2014-06-20 10:04:00 -07:00
David Greenspan
690d6d5ab2 Remove a bunch of UI code
We leave some of the dead code files in the “ui” package, but take them out of “package.js”.  Some render tests now fail and maybe should be ported.  Some test files are removed because they just tested the old code.
2014-06-19 12:09:16 -07:00
Maria Pacana
beb51fab1c Add comments to blaze/materialize.js; minor Deps fix
* Added comments to Blaze.toHTMLVisitor and Blaze.toDOM

* Changed `this` to `self` in Deps.
2014-06-17 17:32:29 -07:00
David Greenspan
8d51b20928 Implement created, destroyed, $
Passes 176/187 tests now
2014-06-16 15:31:24 -07:00
David Greenspan
9048528fd8 Make Vars stoppable; Withs stop on DOM removal 2014-06-09 20:47:22 -07:00
David Greenspan
8e464ec2c2 xxx janky code to see what With cleanup looks like 2014-06-09 20:13:46 -07:00
David Greenspan
5c23ec2e36 Merge remote-tracking branch 'origin/devel' into blaze-refactor 2014-06-09 19:58:19 -07:00
David Greenspan
63b608a6a2 Port tests that were using old toHTML/materialize
Some tests were actually passing because they used old code!  Not anymore.

Create Blaze.toHTML(func) and Blaze.toText(func), like Blaze.render.  Generally you should always build the HTMLjs from inside the func — and our tests should always be wrapping test content in a function literal, not passing around unrendered HTMLjs trees — but if you’re just using tags and Isolate, it doesn’t matter.
2014-06-09 19:56:28 -07:00
Emily Stark
f6cb154770 Make sure autoruns for {{#with}} get cleaned up.
Related to #2145, #2023, #2031.
2014-06-09 19:13:23 -07:00
Avital Oliver
6aba501e46 Fix ui hooks tests on IE 2014-06-09 18:10:02 -07:00
David Greenspan
a13476f195 Fix “nully attributes” test 2014-06-09 17:13:07 -07:00
David Greenspan
4e8472e970 Proper reactivity for calculated templates 2014-06-09 16:35:24 -07:00
Andrew Mao
e2ac94b89d Check for localStorage, catching exceptions - fixes #1291, fixes #1688.
Accessing `window.localStorage` can immediately throw an exception, which needs to be caught.
For more information, see http://www.w3.org/TR/webstorage/#dom-localstorage.
2014-06-09 15:53:17 -07:00
Emily Stark
ef3eaa427a Configure parties oauth in deploy-examples 2014-06-09 15:27:17 -07:00
Avital Oliver
76cb9bd36f Minor changes on deploy-example.sh 2014-06-09 14:55:27 -07:00
David Greenspan
f687e4198f Detect removal of Blaze.renders by jQuery 2014-06-09 14:55:11 -07:00
Avital Oliver
6be92962b3 Updated deploy-examples.sh script for Rainforest QA runs 2014-06-09 14:52:26 -07:00
David Greenspan
142af3a38f Blaze.Isolate does basic deduping 2014-06-09 14:29:29 -07:00
David Greenspan
9108c5debd Match devel’s behavior for inclusion arg context 2014-06-09 14:02:46 -07:00
David Greenspan
adcf6c853c Allow null in inclusion to match devel 2014-06-09 12:32:32 -07:00
David Greenspan
1365e63ff8 Start to make custom block helpers work
UI.contentBlock
2014-06-09 12:18:48 -07:00
Emily Stark
75deaa14a8 Port back-compat for .events = {...} syntax. 2014-06-08 09:30:34 -07:00
Emily Stark
32596145b6 UI._globalHelpers is now just an object, not a function.
See 49fcddb7.
2014-06-06 16:31:04 -07:00
Emily Stark
a4888f18fb Port javascript: URL prevention to blaze-refactor 2014-06-06 16:02:44 -07:00
Emily Stark
4dc2cb6e31 Port UI.dynamic to blaze-refactor 2014-06-06 15:20:29 -07:00
Avital Oliver
49fcddb76f Make {{#markdown}} work. 2014-06-06 14:50:25 -07:00
David Greenspan
ec64edcd1f Fix some tests that use “extend” 2014-06-06 14:46:53 -07:00
Emily Stark
783514511f Port e3cfccb206 to blaze-refactor.
Stop not updating form controls if they're focused.
2014-06-06 14:20:56 -07:00
Emily Stark
13d25197f5 Fix compiler output test again 2014-06-06 14:08:29 -07:00
Emily Stark
ba0770a908 Merge remote-tracking branch 'origin/devel' into blaze-refactor
Conflicts:
	packages/html-tools/tokenize.js
	packages/spacebars-compiler/package.js
	packages/spacebars-compiler/spacebars-compiler.js
	packages/spacebars-tests/template_tests.html
	packages/spacebars-tests/template_tests.js
	packages/spacebars/package.js
	packages/spacebars/spacebars-runtime.js
	packages/ui/domrange.js
	packages/ui/render_tests.js
2014-06-06 14:05:44 -07:00
Emily Stark
bcbd3b3810 Fix compiler output test 2014-06-06 12:30:18 -07:00
David Greenspan
51858c10d0 Make UI.safeEquals the default Blaze.Var behavior 2014-06-06 12:27:48 -07:00
Emily Stark
8ece3d7eac Merge branch 'blaze-inclusion-fix' into blaze-refactor
This breaks the "compiler output" test against, will fix in a separate
commit.
2014-06-06 12:18:03 -07:00
Emily Stark
d8c442faff Use UI.safeEquals for Blaze.With dataVar 2014-06-06 12:07:50 -07:00
David Greenspan
cff3b175c0 try to fix Spacebars.include2 2014-06-06 12:07:50 -07:00
Avital Oliver
af32d49c2b Remove tests for {{#isolate}} and {{#constant}}
We're no longer going to support these. We supported
them originally on Blaze to make the upgrade process
from Spark easier, but now there's no more need
for them.
2014-06-06 11:57:27 -07:00
Matthew Arbesfeld
daa2447c58 Add mongo dependency back to template tests 2014-06-06 11:52:50 -07:00
Avital Oliver
0e881d28a1 Test that would have caught a recent test failure
The bug itself was fixed in e5118295d3
2014-06-06 11:46:09 -07:00
Matthew Arbesfeld
86cf6d08db Fix failing spacebars compiler test 2014-06-06 11:45:33 -07:00
Matthew Arbesfeld
5fb16bcf36 Fix failing template tests 2014-06-06 11:40:47 -07:00
Matthew Arbesfeld
da4004880d Merge branch 'blaze-refactor' of https://github.com/meteor/meteor into blaze-refactor 2014-06-06 11:29:21 -07:00
Matthew Arbesfeld
fdcd43d057 Fix failing compiler tests 2014-06-06 11:28:56 -07:00
Avital Oliver
e5118295d3 Fix Blaze.getElementController
We had a bug in which event handlers inside {{#if}} blocks
didn't see the data context.

I'll commit a test that would have caught this after this commit.
2014-06-06 11:15:46 -07:00
David Greenspan
d3c7b92d80 Comments in renderpoint.js 2014-06-05 23:30:31 -07:00
Emily Stark
65b1eadf53 Tweak UI._templateInstance error message 2014-06-05 18:31:20 -07:00
Emily Stark
5f0067c4f8 Make UI._templateInstance throw when not in helper. 2014-06-05 18:20:51 -07:00
Avital Oliver
e3cfccb206 Stop not updating form controls if they're focused
On Blaze, we copied functionality we had on Spark: Don't update
form controls (INPUT, TEXTAREA) if they are focused and their underlying
value reactively updates. This was never meant to be the eventual
solution -- we'd eventually have a way to define strategies for two-way
data binding. Maybe you'd be able to define a callback that notifies
the app when a change happens to a field that hasn't been saved yet.

Moreover, not only is the feature incomplete, but with Blaze it works
much more poorly than in Spark. Due to fine-grained updates, users
his this more frequently and don't seem to like the behavior
(in Spark you would only hit this behavior if you set up your
preserve rules exactly right, which many users did not do).

So, we're just ripping out this functionality. Now if a field gets
edited by some other user while you're focused it will just lose its
value. Focus will remain.

Fixes #1965
2014-06-05 18:14:25 -07:00
Slava Kim
0f82f8406a Remove a dead import 2014-06-05 14:44:13 -07:00
David Glasser
df2820ffd9 Only do one query for forEach/count in Deps
They used to run the query twice: once for the actual result and once to
set up the observe. Now it shares the work between the observe and the
actual query.

This required me to inline the _depend helper, but I actually think this
made what's going on more direct and clear.

Drop the _allow_unordered hack. I'm not convinced that it was ever truly
valid; the observe code really doesn't support unordered observes with
skip and limit, and I could not remember what it was about count's use
that made it hypothetically safe.  Easier to just remove the hack (until
we maybe eventually actually fix #1643)

Stop using Deps.Dependency in an unidiomatic way; just use
Deps.currentComputation directly.
2014-06-05 13:18:51 -07:00
David Glasser
b5a0613f85 Remove cursor.rewind interface
Our cursor interface has no nextObject method, so there's no point in
having a rewind method. Its major effect is ensuring that
fetch/forEach/map return no documents if you've already called one of
them once. It's not clear why this is actually useful to anybody.

rewind is kept around as a no-op; if we later implement nextObject, we
can make rewind do something, but we still presumably would auto-rewind
before fetch/forEach/map.

In minimongo, remove the db_objects cache inside each cursor. The only
actual use of this cache was that if you called count multiple times, it
would return the same number without re-running the query, and you could
share the query work between N calls to count and one call to
fetch/forEach/map (but only one call! future calls would return
nothing!)  While there's a minor performance hit from getting rid of
this cache, it should also use a little less memory, and enable use
cases like

   {{#with someCursor}}
     {{#if count}}
        {{#each this}}
          ...
        {{/each}}
     {{/if}}
   {{/with}}

which didn't work before because even the deps invalidation didn't
rewind the cursor.

Also, as a minor optimization, skip an EJSON.clone if there's a
projection, because projection functions are guaranteed to clone.

Fixes #2114
2014-06-05 13:18:51 -07:00