Encountered this bug when I tried to update an app that was generating Blaze warnings about the deprecated old-style helper to a 0.9.4 RC. The problem is that the type of the string `'Log'` is being checked rather than the value of the `Log` variable, which obviously returns true, and then the code breaks on the `&& Log` check, which is undefined.
with back-compat.
The “old-style” syntax is `Template.foo.bar = …` instead of `Template.foo.helpers({bar: …})`.
Properties of back-compat to test: You can replace an old-style helper (overwrite it). You can delete an old-style helper. We don’t have to support these capabilities, but we used them both in our test code, so apps probably do it too.
We print a deprecation once per helper. This leads to a lot of warnings! It’s helpful for porting, though developers who for some reason don’t want to port yet may want a way to disable them.
`spacebars-tests` pass.
Rename inclusion macros (with back-compat) to: Template.dynamic, Template.contentBlock, Template.elseBlock.
Update all uses and mentions of UI in the repo, unless they are there for back-compat or testing reasons.
To do: Run unit tests. Update docs for UI.dynamic. Document Template.contentBlock and Template.elseBlock.
By choosing names like Template.registerHelper(…) and Template.instance() (instead of Blaze), we can separate the “Templates” section and the “Blaze” section of the docs.
(The test doesn’t really cover the case we encountered in iron-layout.)
It’s normal to end up calling Blaze.remove on an already-destroyed View, or a View that is not attached directly the DOM but has a parentRange (it’s just that it takes a situation like iron-layout to actually have a pointer to such a View in your code).
Also improve info strings on blaze and ui
Not in this commit:
* Change all uses of `ui` package to use `blaze`
* Change all references to UI symbol to Blaze
* Change docs accordingly