-
Notifications
You must be signed in to change notification settings - Fork 193
Expose inverse block to component hook #340
Conversation
@@ -909,9 +914,9 @@ export function getCellOrValue(reference) { | |||
return reference; | |||
} | |||
|
|||
export function component(morph, env, scope, tagName, params, attrs, template, visitor) { | |||
export function component(morph, env, scope, tagName, params, attrs, template, inverse, visitor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just make this:
export function component(morph, env, scope, tagName, params, attrs, templates, visitor) { }
Where templates
is an object that contains template
and inverse
properties? That would in theory align us for future work in Handlebars/HTMLBars for named blocks without changing the component hook signature again...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
htmlbars is chock full of functions that accept template
and inverse
as separate arguments. To do this right, we would change almost all of them to pass around a templates
object instead. That looks like a big refactor. I'm going to limit my change to the component
hook for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I will make an issue to track refactoring the rest...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created: #341
Any chance for tests? |
If there were any existing tests covering these areas, I would happily have extended them. But there are not, and I don't have sufficient context to create a meaningful test harness from scratch. |
Expose inverse block to component hook
Published as 0.13.17. |
This exposes the inverse template to the component hook, and parameterized
bindBlock
andyield
so they can optionally use other block names (which will presumably just be "inverse" for now).