title: Templating language for both client-side and server-side rendering
body: <p>I'm investigating JavaScript templates as a way to render our views. The goal is to be able to render client-side for users that have JavaScript enabled to to render the same templates/data server side for those users (and crawlers) that don't. </p>
  
  <p><strong>Requirements</strong></p>
  
  <ol>
  <li>Client side rendering.</li>
  <li>Server side rendering (JVM support a nice-to-have).</li>
  <li>Reasonable support for loops, conditionals, text manipulation, partials, macros and extensions/plugins.</li>
  <li>Reasonably big/active community of users.</li>
  </ol>
  
  <p><strong>Unsatisfactory solutions found so far</strong></p>
  
  <ol>
  <li><a href="http://mustache.github.com/" rel="noreferrer">Mustache</a>: supports server and client side rendering, big/active community, but the "logic-less" templates seem very restrictive and painful. </li>
  <li><a href="http://nodejs.org/" rel="noreferrer">Node.js</a> plus <a href="http://documentcloud.github.com/underscore/" rel="noreferrer">underscore</a>: JS templates like underscore provide all the template flexibility I need, but rendering them server-side using Node.js is VERY fragile. node.js is new and fairly unstable and its package management (exports...) requires lots of hacks for things to work properly.</li>
  <li><a href="http://code.google.com/closure/templates/" rel="noreferrer">Google Closure Templates</a>: these compile down to JS and Java and have a lot of the features I want. Unfortunately, browsing the Google groups, it looks like lots of basic features are missing (such as ability to <a href="http://groups.google.com/group/closure-templates-discuss/browse_thread/thread/a65179c527580aab/cfb883bb88e84df9" rel="noreferrer">loop over associative arrays</a>) and the <a href="http://code.google.com/closure/templates/docs/plugins.html" rel="noreferrer">documentation for making your own plugins</a> is very sparse and painful looking. Moreover, I can't tell who in the online community is using it, Google isn't accepting open source contributions for it, and they don't have the bandwidth to release new features.</li>
  <li><a href="https://github.com/elado/isotope" rel="noreferrer">isotope</a>: write templates in JS and use <a href="https://github.com/jbarnette/johnson/" rel="noreferrer">Johnson</a>, a Ruby wrapper for the Mozilla SpiderMonkey JS runtime, to render those templates server side. Seems promising, but the project hasn't had commits in over 6 months.</li>
  <li><a href="https://github.com/tobi/liquid" rel="noreferrer">Liquid</a> with <a href="https://github.com/darthapo/liquid.js" rel="noreferrer">Liquid.js</a>: the Liquid templating language looks superb, but the liquid.js project seems to be untested (no testing in IE!), has no documentation, it's not clear if anyone uses it, and it hasn't been updated in a while.</li>
  </ol>