It seems that a front end framework is almost mandatory for any modern web app, but these frameworks are often unnecessary. In my latest project, I was looking into using Angular.js. Visit the Angular site, and you’d think it would solve all of your problems. (Note: my project is very simple, larger and more complex apps obviously have other priorities.)
The far better solution was simply jQuery and Mustache.js. I could have done without Mustache, and jQuery was already being included anyway. jQuery’s
$.ajax function is incredibly powerful, especially for interactions with a pre-existing API. jQuery fit around my uses; Angular felt like it was trying to force its structure on me. With the
$.ajax function, I was able to implement all the access points for my API in under forty lines of code. Had I combined this with a proper templating language like Jade, it would have been less.
The plan going forward is to make a loose wrapper for the
$.ajax function and combine it with a templating language. That will become my own front end framework, and hopefully I’ll be able to make it have a simple single-page implementation. It would have been nice to have a single page app, but sometimes it’s just more trouble than it’s worth.