Overview/Motivations
This is a comparison/survey of some templating systems that can be used with node.js, for the purpose of selecting an appropriate one to refactor Parsoid's round-trip testing code. Using a templating system will allow us to separate code from UI, cleaning up the current mix of HTML and JavaScript. This page focuses on DOM-based options, as we are considering using a DOM-based templating system, in line with longer term goals of Parsoid. This page is a work in progress; suggestions are welcome!
Factors to consider in choosing a templating system
Logic-less vs with logic
Server-side vs client-side
Security (are data values rendered into views escaped correctly?)
Partials (are they available; do we need them?)
Speed
Maintainability (is the system maintained/used a lot?)
DOM-based vs string-based
DOM-Based Templating Systems
Test Cases
Test cases, rendering tables and lists from JavaScript objects, are to be found in this GitHub repo, along with notes in the readme about how the different systems bind data.
Maintenance/Usage data (as of 12/16/2013)
Transparency
From npmjs.org: current version last updated 7 months ago; 144 downloads in the last week; 765 downloads in the last month.
From Github: latest commit 7 months ago; 12 contributors.
PURE
From npmjs.org: current version last updated 3 years ago; 15 downloads in the last week; 68 downloads in the last month.
From Github: latest commit 1 month ago; 4 contributors.
Weld
From npmjs.org: current version last updated 2 years ago; 21 downloads in the last week; 96 downloads in the last month.
From Github: latest commit 10 months ago; 8 contributors.
Dependencies
Plates
From npmjs.org: current version last updated; 170 downloads in the last week; 654 downloads in the last month.
From Github: latest commit 7 months ago; 24 contributors.
DOM.js
From npmjs.org: current version last updated 10 months ago; 21 downloads in the last week; 110 downloads in the last month.
From Github: latest commit 6 days ago; 1 contributor.
Dependencies
Other DOM-Based Templating Systems
These seem to be newer/less developed/used.
Mold.js - "handlebars like syntax"
Soma-template - also looks like handlebars
Dombars - based on handlebars
Template-Tal - this is a template attribute language, like Distal
Recommendations
References/links
Templating systems discussed above
Other surveys/comparisons
- List of templating engines for node
- "The client-side templating throwdown: mustache, handlebars, dust.js, and more" - another templating system comparison using a test case
- "Templating with JavaScript" - includes discussion of factors to be used in selecting a templating system
- "Transparency vs Other Templating Engines" - speed comparison of templating engines including Distal, DOM.js, Plates and Transparency