Tuesday, May 26, 2015

SPA Framework Templates Have No Reuse

For all the comparisons of SPA Frameworks I haven't seen much focus on the templating. There's a common complaint that all templating systems have drawbacks. One that I've not seen considered is that the templates are very specific to the framework. Wouldn't it be nice if the templating engine was truly a separate concern? Then when you build an app with a template you can keep all your markup when things change. Each framework does templating in its own way. Angular has you creating your own tags, Ember uses Handlebars markup, React seems to mix JavaScript and html-as-a-strig, Knockout uses data- attributes. All of these have their drawbacks, however consider if you or the developers of the framework are going to change the M/C/VM engine or perhaps go to the next framework. What amount of rework does that introduce? It would be nice to grab your favorite templating engine off the shelf, hook that into your favorite router, then add your controllers with a bit of DI and config everything works! Whether you like the ng-whatever syntax, the purity of data-bind, or the separation that {{item.name}} provides, or how about Jade with its minimalist markup? Then there's Express, Mongoose, Jade how about that! Grab a template engine (Jade), a router/controller (Express), and a model engine (Mongoose), run them all on Node and hit go! I have to have a better look at this!

No comments:

Post a Comment