Parsoid/Round-trip testing/Templates
Overview/Motivations
editThis 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
editLogic-less vs with logic
editServer-side vs client-side
editSecurity (are data values rendered into views escaped correctly?)
editPartials (are they available; do we need them?)
editSpeed
editMaintainability (is the system maintained/used a lot?)
editDOM-based vs string-based
editDOM-Based Templating Systems
editTest Cases
editTest 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)
editTransparency
editFrom 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
editFrom 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
editFrom 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
editPlates
editFrom 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
editFrom 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
editOther DOM-Based Templating Systems
editThese 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
editReferences/links
editTemplating systems discussed above
editOther surveys/comparisons
edit- 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