Commit Graph

283 Commits

Author SHA1 Message Date
Mitar
11b7397857 Moved binding of template helpers to the function. 2015-04-24 04:16:18 -07:00
Mitar
8b723b26f9 Updated methods to move more checks into methods. 2015-04-03 19:55:48 -07:00
Mitar
28fee7e46c Allow also a function for reactivity. 2015-03-31 00:23:58 -07:00
Mitar
93eb5c3f4d Allow extending lookup for templates as well. 2015-03-28 04:28:31 -07:00
Mitar
c8212d0553 templateInstance is needed as well. 2015-03-26 15:18:12 -07:00
Mitar
ba99e6f3d8 Use Blaze._getTemplateHelper directly.
This allows one to override Blaze._getTemplateHelper with a custom implementation.
2015-03-26 14:30:33 -07:00
David Greenspan
28c760e05c Avoid recursion when materializing DOM (Fix #3028)
This way we don't get a stack overflow when materializing nested
Views.  Certain browser/OS combinations seem to have particularly
low budgets (especially Firefox/Windows apparently).

Verified by running https://github.com/mxab/meteor-call-stack-exceed
on Chrome/Mac.  Nesting limit used to be about 160, but now you get
unlimited nesting (tried up to 10,000, which renders in about 7-8
seconds).

Tested for correctness by running all package tests.
2015-03-25 17:39:36 -07:00
David Greenspan
9872572a4e Replace DOMMaterializer visitor with a function
This already reduces stack usage, allowing deeper recursion,
but we'll see if we can reduce it even more.
2015-03-25 17:39:35 -07:00
David Greenspan
8ac310b9db Fix #3942
I don't know how to repro this for a test, but this pretty clearly
should fix the issue!  This is how the code should have been written
the first time.
2015-03-17 15:20:16 -07:00
David Glasser
21bdac8734 Merge branch 'master' into devel
Conflicts:
	History.md
	packages/accounts-password/package.js
	packages/accounts-password/password_server.js
	packages/constraint-solver/package.js
	packages/meteor-tool/package.js
	packages/non-core/npm-bcrypt/package.js
	packages/package-version-parser/package-version-parser-tests.js
	packages/package-version-parser/package-version-parser.js
	packages/package-version-parser/package.js
	tools/selftest.js
2015-03-17 13:41:14 -07:00
David Glasser
4daaa76b12 METEOR@1.0.4 2015-03-17 13:06:07 -07:00
Slava Kim
9a29988016 Merge pull request #3937 from meteor/callbacks-docs
Better documentation for callbacks taking arguments
2015-03-17 07:21:11 +00:00
Slava Kim
dab2782434 Document a whole bunch of missing arguments/returns 2015-03-14 23:04:09 -07:00
David Glasser
891a9c3893 1.0.4-rc.2 2015-03-10 11:49:25 -07:00
David Glasser
c72f20ccea Use correct symbol for Template
The blaze package defines Blaze.Template, not Template, and should find
it there.

(Apps tend to put `Template = Blaze.Template` globally on the client via
templating package, but that's not guaranteed, and doesn't happen on the
server.)
2015-03-09 17:14:44 -07:00
David Glasser
e7a9bdb507 1.0.4-rc.1 2015-03-09 16:20:50 -07:00
Sashko Stubailo
ed60db429c Change documentation for Template.currentData in events 2015-03-09 14:21:37 -07:00
Sashko Stubailo
5c7873dfa8 Revert "Make event handlers get called with target's view"
This reverts commit 72887bb0ee.
2015-03-09 14:21:37 -07:00
Sashko Stubailo
4dafb236af Change documentation for Template.currentData in events 2015-03-09 13:37:45 -07:00
Sashko Stubailo
a4d5e95bb1 Revert "Make event handlers get called with target's view"
This reverts commit 72887bb0ee.
2015-03-09 13:36:23 -07:00
David Glasser
873018df44 Minor version bumps to packages with new features
* accounts-base: client-side login hooks
* accounts-password: emailTemplates features
* autoupdate: reload via Node IPC messages (and SIGHUP)
* blaze: template-level subscriptions and onRendered/etc hooks
* ddp: client-side onStop callback, permessage-deflate, subscriptionId
  on subscription handles
* http: npmRequestOptions, HTTPInternals.NpmModules
* mongo: validated against 2.6, oplog-backlog,
  rawCollection/rawDatabase, MongoInternals.NpmModules
* reactive-dict/session: Session.set({k1: v1, k2: v2})
* templating: attributes on <body>
* webapp: WebAppInternals.NpmModules
2015-03-05 22:30:22 -08:00
David Glasser
7ff27f4e17 Update more docs about onStop 2015-03-05 21:36:18 -08:00
Slava Kim
f6dfcc4032 Remove an extra colon 2015-02-26 19:01:30 -08:00
Slava Kim
de052f11f8 Merge branch 'tracker-profiler' into devel
Actually contains annotations to Blaze useful for tracker-profiler but not the
package itself. These changes are also useful to the future tools.
2015-02-26 18:58:49 -08:00
Slava Kim
be93ffc1d7 Annotate Blaze autoruns for debugging and better errors 2015-02-26 18:44:52 -08:00
Slava Kim
62ac82c835 Bump 2015-02-24 21:16:41 -08:00
Sashko Stubailo
c0aab1e8d3 Template-level subscriptions 2015-02-11 18:10:33 -08:00
Sashko Stubailo
f29c954458 Bump a bunch of version numbers for new preview 2015-02-09 13:23:24 -08:00
Sashko Stubailo
b3cb7a49f7 Merge branch 'devel' into windows-cr
Conflicts:
	packages/application-configuration/package.js
	packages/ctl-helper/package.js
	packages/ctl/package.js
	packages/dev-bundle-fetcher/package.js
	packages/follower-livedata/package.js
	packages/jquery/package.js
	packages/star-translate/package.js
	packages/test-in-browser/package.js
	tools/bundler.js
	tools/compiler.js
	tools/package-client.js
	tools/package-source.js
	tools/package-version-parser.js
	tools/server/boot.js
2015-02-04 13:56:54 -08:00
Sashko Stubailo
8149538e9c stop underscore from failing on non-existent function
For Template.body, there is no template instance, so the _.bind inside helpers
fails
2015-01-29 19:33:55 -08:00
Sashko Stubailo
d2d05bedf5 Improve comment 2015-01-28 10:15:23 -08:00
Sashko Stubailo
7201dbe84c Fix broked COMPAT comment 2015-01-28 10:06:38 -08:00
Sashko Stubailo
b0ecad0ce2 Fix documentation of Template.currentData 2015-01-26 16:16:30 -08:00
Avital Oliver
5862ec0363 Make Template.instance() correct in this.autorun() in templates
A previous change decoupled "current view" from "current template instance".
The code made sure to preserve "current view" explicitly within
`this.autorun`, but now we need to do the same for "current template instance"
2015-01-26 15:52:44 -08:00
Avital Oliver
99ca826040 Fix test failure by binding Template.instance() later
Prior to this change, a dependency was registered on
`Template.instance` when wrapping a helper, rather
than when it is called. This caused templates to get
re-rendered more frequently than necessary as caught
by a test failure, and probably many other bugs.
2015-01-26 15:19:56 -08:00
Sashko Stubailo
a769371e5b Make a new dynamic variable for Template.instance() 2015-01-23 16:51:22 -08:00
Sashko Stubailo
72887bb0ee Make event handlers get called with target's view 2015-01-23 15:05:34 -08:00
Slava Kim
7576e0f3f6 Add a comment about why we grab template callbacks first and then fire them
later
2015-01-21 20:11:22 -08:00
Slava Kim
27f249bfed A lot of crazy package bumps 2015-01-21 14:03:55 -08:00
Slava Kim
f146489c27 Fix the bug of firing a rendered callback when it was added too late 2015-01-21 12:26:51 -08:00
Slava Kim
e2b78cfd0b Merge branch 'templateEventsMethods' into devel
Adds Template#onRendered, Template#onCreated and Template#onDestroyed methods
2015-01-21 11:02:09 -08:00
ekatek
c5bc843816 bring README.md files up to 1.0.3 compatibility
Fill in all packages without README.md files with a short
README.md mentioning that this is an internal Meteor package.

Break up the top paragraph of a couple of existing README.md
files to be proper long description.

There is more work to do here, involving line wrapping and the like.
2015-01-20 12:21:35 -08:00
Slava Kim
9e7c14ac81 Globally replace Template.rendered callbacks to Template.onRendered
In:

- examples
- some blaze tests
- packages

Change:

- rendered -> onRendered()
- created -> onCreated()
- destroyed -> onDestroyed()
2015-01-16 16:36:23 -08:00
Slava Kim
6aff197c47 Better comments.
In response to Sashko's comments.
2015-01-16 10:47:51 -08:00
Slava Kim
fcf8f6616d Set the language in Blaze's readme's markdown 2014-12-21 18:00:13 -08:00
David Glasser
6b204ca73a Bump package versions for 1.0.2 2014-12-19 10:31:59 -08:00
David Glasser
73b809c122 Bump versions for 1.0.2. 2014-12-11 22:44:41 -08:00
David Glasser
0ed8a9b32d bump package versions for a test release 2014-12-10 14:50:11 -08:00
David Glasser
6ea8443f30 Update calls to addFiles, onUse, and onTest 2014-12-09 20:18:31 -08:00
David Greenspan
ab92f117ae Expand fix for #3130
If you Blaze.remove a View that is a template rendered by Blaze.renderWithData, or included with an implicit “with” as in `{{> myTemplate someData}}`, Blaze will now remove the DOM of the template, and also remove the implicit “with” (in both cases).

As background, Blaze.remove only works on Views that were attached directly under a DOM element, not inside another View.  Blaze.render always attaches the resulting View directly under a DOM element, but Blaze.renderWithData creates a “with” View around the template View.  Previously, you could Blaze.remove the “with” View (which is returned by renderWithData), but if you got access to the template’s View some other way and tried to remove it directly, nothing would happen.  Now, the correct thing happens (the View is destroyed and the DOM is removed).

In the future, we should consider whether Blaze.remove should work on arbitrary Views, not just Views attached under a DOM element.
2014-12-09 13:17:12 -08:00