Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DOM tree based JavaScript template engines

I am looking for a new Javascript template engine to replace old jQuery Template for my client side templating needs.

I'd prefer approach where the template engine deals with DOM trees instead of text strings and later dumps the content of the cooked string into innerHTML. This is better performance wise and I find DOM manipulation more proper way of constructing more of DOM tree.

What options I do have for Javascript template engine which would directly create DOM trees instead of being text based engines? I like Mustache.js's logicless approach, but it seems to operate on strings only. Native jQuery integration would also be a nice feature.

like image 594
Mikko Ohtamaa Avatar asked Feb 14 '12 18:02

Mikko Ohtamaa


Video Answer


3 Answers

Transparency:

https://github.com/leonidas/transparency/

PURE:

http://beebole.com/pure/documentation/

Plates

https://github.com/flatiron/plates

Why all this:

http://blog.nodejitsu.com/micro-templates-are-dead

like image 164
Mikko Ohtamaa Avatar answered Oct 21 '22 05:10

Mikko Ohtamaa


Distal

http://code.google.com/p/distal

like image 29
Kernel James Avatar answered Oct 21 '22 04:10

Kernel James


soma-template is a new one.

Pure DOM manipulation, a lot of features, natural syntax, fully extensible with other libraries such as underscore.string, function calls with parameters, helpers, watchers. Capability to update only some nodes if needed, templates inside the DOM itself.

http://soundstep.github.com/soma-template/

like image 2
Soundstep Avatar answered Oct 21 '22 04:10

Soundstep