You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Partial blocks are supposed to be evaluated in the calling context, for some reason. This has been implemented rather quickly by evaluating the block before running the partial and inlining the result as text.
i.e.
{{>@partial-block }} will always work
{{>@partial-block custom-context abc=def }} might succeed and be incorrect
{{>@partial-block abc=def }} will succeed and be incorrect if abc is defined in the outer scope
This could be fixed with quite a bit of work. It's not simple, because we need to stash the outer context and figure out which one to use when @partial-block is called. there's no sane way to do it, would have to lace the partial rendering code with special cases.
In the meantime, avoid passing arguments to a partial block
Yeah we definitely went over this a few months ago when I decided not to fix it. Overriding stuff in the partial-block really doesn't make sense to me, I don't think it should be allowed.
Just wanted to make sure it's in our handlebars guidelines. Since it's just inlined text, it'll render almost every time.
Partial blocks are supposed to be evaluated in the calling context, for some reason. This has been implemented rather quickly by evaluating the block before running the partial and inlining the result as text.
i.e.
{{>@partial-block }}
will always work{{>@partial-block custom-context abc=def }}
might succeed and be incorrect{{>@partial-block abc=def }}
will succeed and be incorrect if abc is defined in the outer scopeThis could be fixed with quite a bit of work. It's not simple, because we need to stash the outer context and figure out which one to use when
@partial-block
is called. there's no sane way to do it, would have to lace the partial rendering code with special cases.In the meantime, avoid passing arguments to a partial block
@damncabbage @charleso @russ-ambiata
The text was updated successfully, but these errors were encountered: