-
-
Notifications
You must be signed in to change notification settings - Fork 238
Unable to reassign include arguments locally within the include file itself #404
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
Comments
I see the current implementation is render: function * (ctx: Context) {
ctx.bottom()[this.key] = yield this.liquid._evalValue(this.value, ctx)
} It's assigning to the first scope in context stack. The idea is to skip transient scopes like the one created by Feel free to post back if you're stuck. I can help or continue your work! |
@harttle Per your suggestion, ee830f9 seems to fix the previously failing test I wrote here: AleksandrHovhannisyan@ee830f9#diff-144b633c9a17150f1e3fc00aebe1d21d22c09b622b0f8f81b457a718282842b9R197 However, it also causes 5 other tests to fail. Specifically, these ones:
With these results:
Any idea what I may have done wrong? The tests pass if I revert this line: https://github.com/AleksandrHovhannisyan/liquidjs/blob/reassignment/src/builtin/tags/render.ts#L59 |
Hi @harttle! Just following up to see if you had a chance to take a look at my branch. Let me know if you want me to clarify any changes I made or if I misunderstood the requirements. Thanks! |
Ah, I guess you'll need to call |
Hi @harttle, thanks for getting back and clarifying! Unfortunately, I don't think I'll be able to tackle this ticket. Please feel free to assign it to someone else or continue where I left off. (As an aside: I think it may be worth documenting some of the code, with inline comments or jsDoc, to make it easier for others to contribute. This was my biggest pain point.) |
@AleksandrHovhannisyan feel free to create a pull request (even incomplete), I can try to continue your work. At least I also think it's a bug worth fixing. |
## [9.28.4](v9.28.3...v9.28.4) (2021-10-31) ### Bug Fixes * allow `{%render%}` to reassign argument, [#404](#404) ([124f4c4](124f4c4))
After digging into Liquid and LiquidJS (I wrote this part long time ago and it takes me quite a while to figure it out, sorry for this), I find that:
|
@harttle Sounds good, thank you! Since 11ty uses 124f4c4#diff-d31563acb42db2c893c52aa0555c10ce781e05097b0b59cd5a403472972e7300R91 |
@AleksandrHovhannisyan I'm pretty sure 11ty v1 (beta) supports the Although I do see that https://github.com/11ty/eleventy/blob/19b4884e83e420a3b42f334aa922140f9cb18353/package.json#L107 is pinned to a very specific version of liquidjs, so we might need to tweak that line from the 11ty side (or else you can try manually installing the latest liquidjs locally and then try setting your own custom library instance. UPDATE: Filed 11ty/eleventy#2059 from the 11ty side to bump liquidjs version back to latest. |
@pdehaan Gotcha—yeah, Zach mentioned that even if this fix got in, we wouldn't be able to take advantage of it yet due to this regression, which is pinning liquid to |
Related 11ty issue: 11ty/eleventy#2000
Steps to reproduce:
Example:
parent.html
child.html
Expected behavior: the output is
green
.Observed behavior: the output is
red
.If it's okay, I'd like to take a crack at fixing this (if you think it's realistic for a first-time contributor). I have a failing test locally to confirm, but I'll need to figure out where in the code it's breaking.
The text was updated successfully, but these errors were encountered: