GithubHelp home page GithubHelp logo

Get Templates about mu HOT 1 OPEN

raycmorgan avatar raycmorgan commented on May 3, 2024
Get Templates

from mu.

Comments (1)

raycmorgan avatar raycmorgan commented on May 3, 2024

Because partials can be recursive, you cannot expand the partial tags at compile time in Mustache. What Mu does is compile all the needed partials at compile time and references them in the cache during render time.

An simple example of a recursive template:

// person.html

<ul>
  {{#friends}}
    <li>
      {{>person.html}}
    </li>
  {{/friends}}
</ul>

Most client side Mustaches have a form of partials as well, I would try to figure out a way to send those down apart from the main template. Would having an easily accessible list of partial files that a template references be helpful? Something like: mu.whichPartials(compiledTemplateOrPath); // => ["foo.html", "bar.html"]

from mu.

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.