Coder Social home page Coder Social logo

Comments (4)

sebastienros avatar sebastienros commented on August 16, 2024

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.

sebastienros avatar sebastienros commented on August 16, 2024

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.

jeremycook avatar jeremycook commented on August 16, 2024

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.

jeremycook avatar jeremycook commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.