-
-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline partials "leak" - another scenario #539
Comments
Adding the files in the example above, in case you find it useful. |
Hi @jknack, While debugging this scenario, I noticed a few behaviors that I am not quite sure I understand:
I would really love to contribute a fix to this issue, however, I was not able to think of anything simple enough that would not involve breaking changes (especially considering point number 3 that I raised). Will be glad to hear your insights on this and/or any suggestion for fixing the issue. Thanks! |
Hi @jknack, thanks for the fix. Sorry for bugging on this with a such long comments :) but either I didn't get it right or that the fix does not really cover the scenario that I have described. You can see that also in the test that you added the expected result is not the same as I described - the "inherit1" partial is not rendering the "inline partial defined by inherit1, called from base" content, which was defined in the partial block (if needed I can commit a change to the test that better describes the expected result, I believe it will fail though). I am assuming that this is because the fix requires to call {{>@partial-block}} in order to render the inner content of an inherited partial block, but this does not solve my problem since it requires to go over all templates that are being inherited and add {{>@partial-block}} to them. This is not so applicable since not all inheriting templates actually define a partial block when calling the base template, so you get a "[template] does not provide a @partial-block" exception. To my understanding the functionality that I am describing (inline partials remaining in the partial block context) is meant to be supported for without the need to call {{>@partial-block}}, as described in the second example of inline partials here ("Each inline partial is available to the current block and all children, including execution of other partials..."). Can you please shed some light on this? Am I missing something? This will be really helpful as my application heavily reuses templates and to workaround this issue I need do define empty inline partials in order to "reset" the ones that were defined by a sibling template. Thanks! |
Hi @jknack. Thanks for the fix of issue #523, it indeed resolved the scenario I have described. However, I ran into a different scenario in which this issue still happens. This time we have two inline partials, in the second we call another template. Setup is as follows:
main.hbs:
with the following partials:
base.hbs:
inherit1.hbs:
inherit2.hbs:
some-other-template.hbs:
The expected result is:
Actual result:
Again, the line "inline partial defined by inherit1, called from base" has "leaked" from inherit1.hbs to inherit2.hbs. I will continue trying to debug the code by myself but I can't promise anything :) as I am not yet completely familiar with the project's code. Will be great if you could take a look.
The text was updated successfully, but these errors were encountered: