blueimp/JavaScript-Templates

Not very popular

Closed this issue · 1 comments

This is not a code issue per se, but I think it is a issue to be discussed. Why tmpl is not very popular? I'm using for a few months, after switching from jsrender and I'm loving it. But when I google for the fastest or the best engine nobody mention it. Like this template chooser for exemple: http://garann.github.com/template-chooser/

I think I only knew about tmpl after searching here at Github. I maybe complaining about nothing but I guess popular code evolves fast, because there is more people around it.

To make sure how good is tmpl I edited a jsPref test, take a look: http://jsperf.com/hogan-vs-dot-js-vs-trimpath-zepto-js/7

So keep up the good work and let me know if there's something I can do to help.

Thanks for your interest, @renancouto.

Although the JavaScript Templates library serves its purpose as a minimal and fast JS template rendering engine that works on both client- and server-side, I'm also aware of its shortcomings.

For example, it doesn't do context-based escaping, so it needs extra care against XSS attack vectors when printing user data in other contexts as between HTML tags. Although this is something which most String-based template engines simply ignore, it is still important to remember.

I also think that e.g. logic-less template engines are more expressive, e.g. mustache or handlebars.
For example, the JavaScript Templates library lacks a simple way to iterate over arrays without having to write a for loop or to call a function.

Lastly, I think for most projects, the performance of the template engine is not a deciding factor.
Features that allow ease of development, simple testing and automatic protection against XSS and other attack vectors are something that I personally value more.

If you want a personal recommendation, I would suggest Angular JS.
It's a client-side JS framework that comes with its own, DOM-based templating engine that supports two-way data-binding and context-based escaping.