meteor/meteor — pull request #1904 by cmather (2014-03-09 02:18:24+00:00)
Title: Put range.removed code in a Deps.nonreactive callback

@avital, @dgreensp
cc @tmeasday

When a range is removed, if the component instance has a destroyed callback
defined, updateTemplateInstance is called and the destroyed callback is called
in the context of the updated templateInstance. updateTemplateInstance calls
getComonentData() which can create a reactive dependency. This doesn't seem
necessary since we're removing the range and causes problems for iron-router.

The problem surfaced in iron-router in combination with using the {{#each
helper. The each helper is currently the only builtin that adds a destroyed
callback. If a previous layout used "{{#each" and a new layout rendered, the
previous range would be removed inside the new computation. If the data context then invalidated the computation, the new layout would render again.