Comments (1)
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)
- How to output error code instead of missing partial? HOT 1
- Deprecated method: util.pump in new version of node
- Rendered data doesn't write correctly to HTTP stream. HOT 1
- Integration with express HOT 4
- Partials with relative path not implemented HOT 1
- "Error" event not being sent;
- Default file extension
- Memory leak due to infinite loop in recursive partials. HOT 1
- Silent failure when a template file does not exist
- feature request: custom delimiter HOT 1
- integrate with express? HOT 1
- partials with mu-cli.js HOT 4
- .write( string, encoding, offset, length is deprecated notice HOT 5
- No lambda support
- Write output to file HOT 1
- feature request: expose render context
- Is this repo dead? HOT 1
- External local stylesheets not loading
- Breaks on node 12, TypeError: util.puts is not a function
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 mu.