<story><title>Stop sending template engines to the browser. How to make 6-10x faster templates</title><url>http://andyet.net/blog/2012/sep/13/stop-sending-template-engines-to-the-browser-a-ret/</url></story><parent_chain><item><author>drblast</author><text>Does anyone going through all this this know how to manipulate the DOM directly?  It&apos;s ridiculously simple.&lt;p&gt;The whole approach strikes me as odd, unless I&apos;m missing something.</text></item></parent_chain><comment><author>Tichy</author><text>Don&apos;t know the current state, but for a while it was a lot faster to just replace the HTML source (innerHTML I think?) than to manipulate the DOM. Just the way the browsers were implemented. No idea if the situation has improved by now.</text></comment>
<story><title>Stop sending template engines to the browser. How to make 6-10x faster templates</title><url>http://andyet.net/blog/2012/sep/13/stop-sending-template-engines-to-the-browser-a-ret/</url></story><parent_chain><item><author>drblast</author><text>Does anyone going through all this this know how to manipulate the DOM directly?  It&apos;s ridiculously simple.&lt;p&gt;The whole approach strikes me as odd, unless I&apos;m missing something.</text></item></parent_chain><comment><author>Osiris</author><text>You are missing something.&lt;p&gt;My team uses Handlebars templates with Ember.js. We build templates with placeholders for bound values or other view templates. When rendered on the client side, a change to a data model causes an automatic change in any templates that are bound to that data.  In jQuery there&apos;s a potential for forgetting to write code to update a value or part of the page. With this templating system, it&apos;s all bound and auto-updated.&lt;p&gt;Another reason that we use templates is that we put all the template files up on a CDN. The only thing our server serves up is an empty DOM (just a body and a div), and the templates are all built into the DOM on the client side.&lt;p&gt;Lastly, managing a bunch of small tmpl files with the HTML we want is a lot easier than trying to embed HTML into JavaScript strings to use with jQuery. We just write up some HTML and an Ember view that renders that template in the right place on the page. Organizationally it&apos;s very simple and easy to maintain.</text></comment>