mixonic/htmlbars — pull request #2 by epicmiller (2014-07-01 06:58:30+00:00)
Title: Handlebars embedded in a node call the element helper using a cached reference

Handlebars embedded in a node call the element helper using a reference to the element which was cached before any hooks are called.

- Removed notion of 'sharedParent' hydration opcode in favor of the 'element' opcode
- ConsumeParent opcode is now always added when an element is opened.
- If the element contains more than two morphs, or if it has a handlebar embedded in the node itself, and element opcode is pushed to the hydration ast
- When the element opcode is called, the last parent value is added to the declarations array to be cached just like morph elements before any hooks are called
- This cached value is used when creating any morphs inside the element (like parent used to be used for) or in any element hook calls
- By using cached elements in hook calls helpers may modify the dom all they want without messing up program execution
- Cached elements are now stored as 'element(n)' rather than 'parent(n)'