Code Monkey home page Code Monkey logo

Comments (4)

zordius avatar zordius commented on May 25, 2024
  1. Now the priority of tags parsing in lightncandy is compileSection -> compileCustomHelper -> compileVariable . (check the code from line 1232 ~ line 1246) , so these are true now:
    • You can not overwrite build-in helpers by custom helpers, ex: {{#each }}
    • When you use duplicate names on both custom helper and variable , custom helper will be used.
  2. The priority of tags parsing can be changed if we think another way is better.
  3. I think lightncandy should align with handlebars.js behavior. So, I need to write some tests on handlebars.js, then decide the correct order by the testing results.

from lightncandy.

mendezcode avatar mendezcode commented on May 25, 2024

Yes, it does make sense. Behavior should be aligned with handlebars.js, completely agree.

Variables can be accessed using @root.variable, so I think it can be left as-is, now that I think of it.

from lightncandy.

zordius avatar zordius commented on May 25, 2024

Based on this test : http://jsfiddle.net/TY8cJ/1/

custom helper > default helper > variable

This behavior will be applied to lightncandy later.

from lightncandy.

zordius avatar zordius commented on May 25, 2024

After I review the code of lightncandy deeply , the current order is

compileBlockCustomHelper > compileBlockBegin > compileCustomHelper > compileVariable

So the behavior already same with handlebars.js . No more fix required, and close this. Thanks.

from lightncandy.

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.