-
Notifications
You must be signed in to change notification settings - Fork 8
Description
cc @avital, @estark37, @tmeasday
In order to make "yield" and "contentFor" work with blaze in the last release of blaze-layout/iron-router, we overrode Component.lookup and Component.lookupTemplate. This is now breaking with additions that have been made to these functions in Core (related to UI._templateInstance()) in release/0.8.1-rc2. See:
iron-meteor/iron-router#691 (comment).
We should remove these overrides provided we can meet or change our original use cases. Those use cases are:
- When {{> yield}} is called, find the parent Layout component and call the yield method defined on that component.
- When {{> contentFor}} is called, find the parent Layout component and call the contentFor method defined on that component.
- When {{yield}} is called provide a helpful error message like: "Sorry, would you mind using {{> yield}} instead of {{yield}}?"
It's not immediately clear how we can tell Spacebars to lookup a rendered hierarchy of components for a method defined further up in the chain. But I recall some designs for this in Meteor's Blaze v2 hackpad. I need to verify that something exists. Alternatively, we can add the UI._templateInstance implementation logic to our override. But I'm hoping we can remove this hack.