Comments (4)
I will look into some examples/tests from shopify, but it looks like a bad behavior to me. All this variables should be local to the template, and not leak on subsequent renderings. But we need proof.
from fluid.
I can't find anything related in the tests https://github.com/Shopify/liquid/blob/9c72ccb82f4e7a1f158b59741596a473c499875e/test/integration/tags/include_tag_test.rb
It looks like the template shouldn't change the parent's variables, but that's it. From the documentation, the other values are actually defining the main context variables, so what you are seeing seems expected. We would need to check on a shopify site probably.
from fluid.
I'm with you on it "seems expected" but also "looks like bad behavior". It makes for all sorts of unfortunate problems that basically require me to Nil out variables before calling another include.
If it is by design according to Shopify may I suggest we make up our own tag like partial
that has the scoped behavior you and I seem to expect.
from fluid.
Jekyll's implementation of include appears to align with what we expect, at least that's my impression after reading this: https://hamishwillee.github.io/2014/11/13/jekyll-includes-are-functions/
from fluid.
Related Issues (20)
- MemberNameStrategies. SnakeCase strategy use uppercase attribute has a bug HOT 1
- Is support aot? HOT 10
- How to write to call the test function HOT 4
- Where filter does not handle truthy values correctly
- Loop template can't rendering HOT 3
- Minimal api sample doesn't work when run on linux
- A lot of views to generate and a lot of data HOT 4
- FluidValue.ToXXXValue() methods should take TemplateContext as an argument
- Slice ArgumentOutOfRangeExceptions
- Fluid.Core-2.5.1-beta-0: 2 vulnerabilities (highest severity is: 7.5)
- liquid.net.0.10.0.nupkg: 2 vulnerabilities (highest severity is: 7.5) HOT 1
- Check buffer types from ASP.NET HOT 2
- After upgrading to 2.8.0 My durable function would no longer start. HOT 3
- Directory.Packages.props does not respect PrivateAssets HOT 6
- FluidViewRenderer.RenderViewAsync writes to stream syncronously in some situations HOT 3
- I can't see the iterated value in the result HOT 1
- Listing in readme - Used By section ? HOT 2
- The == operator only compares the reference HOT 1
- System.MissingMethodException with Parlot >= 0.0.27 HOT 4
- Proposal for Passing Information from Template to Host App Using Scoped Variables HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluid.