1- Does not integrate well with form data binding and validation libraries. To use PURE to do data entry implies doing data conversion (string HTTP parms to int, float, Decimal fields) manually, while there are already well written and tested server side form libs that cope with these tasks, as well as data sanitation before insertion into DB (read SQL Injection, etc.)
2- PURE has altering properties on the DOM. When used with a data visualization lib like Hightcharts, PURE goes on to alter the rendering of barcharts and line charts (lines or bars in the just disappear). This issue was really hard to debug, and had cost me hours to find.
3- No support to template inheritance: shared sections in the website (like menus, etc.) are to be replicated manually throughout all the template files. If one section changes or one menu item needs to be removed, this needs to be done manually for ALL the templates that display that menu item; this is not DRY and an anti-pattern in a templating technology (Headaches and time wasted).
4- PURE makes it difficult to return conditional HTML to the client, when the rendering logic is associated with a user profile. This is a recipe for security holes in the webapp, as all html parts of a multi-user profile page are served to the client.
Server side templating engines like Mako or Jinja2 make it easy to say what part of the page to generate and send over the wire to the client
5- Speed. When there’s a huge bunch of data some of browsers (e.g. Safari) are processing JSON very slow. Due to this even Twitter moved back to server-side templates: http://engineering.twitter.com/2012/05/improving-performance-on-twittercom.html
6- Caching. If your end points only return JSON, then all you'll be able to cache on the backend is JSON. The client will always have to spend time building the HTML elements from that data. If your end points return HTML, you can cache that instead. By rendering on the server, you can cache the final shape of your data. So not only does your client not have to generate templates, your server doesn't have to either.
7- Initial load. Comparing the initial flow of the two approaches, it should be obvious that client-side rendering is going to be slower. It requires more JavaScript to be downloaded, which is more JavaScript to parse. It requires a 2nd HTTP request to load the content, and then requires more JavaScript to generate the template. Even if the initial JavaScript gets cached, it still needs to get parsed, and the 2nd request isn't going to happen until the document is loaded.
--
You received this message because you are subscribed to the Google Groups "JavaScript Templates Engine PURE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Pure-Unobtrusive-Rende...@googlegroups.com.
To post to this group, send email to Pure-Unobtrusive...@googlegroups.com.
Visit this group at http://groups.google.com/group/Pure-Unobtrusive-Rendering-Engine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.