Generally I am backend and fullstack developer and a tech-lead. I am choosing dev tools over the years.
For back-end, I've chosen Typesafe Stack. It makes apps reactive and relatively easy to scale and maintain. And it's fun to code in Scala.
For front-end, I use Angular.js, previously it was knockout.js, YUI, Mootools, jquery, vanilla.
But with Angular.js I am really confused. Problem is not in a tool itself, but in the way the Web evolves.
The aim is to fasten application, make it more responsive, reactive, interactive. It leads us to single-page apps. Angular.js is good for it.
But.
For a modern app, it is extremely important to render first page ASAP. For single-page app, it cannot happen before resolving main template, then loading all the scripts, then launching app, routing request, then asking server for some REST resources, binding it into templates, and then showing it to the user.
A lot of network latency to wait for! A lot of sequential requests coming one after another.
So it takes looong time to see the content. Also it makes it hard to be indexed via search engines, and limits accessibility (Reader mode in Safari usually doesn't respect markup generated by angular.js).
Well, one can solve the problem of searchability by tools like prerender.io. Ok, even if it looks ugly, but what's about the first page load?
I've heard that Twitter finally became to render content on back-end, and then wrap it with scripts. How?
I've seen some projects on node.js with the same purpose. They renders content with the same javascript that client actually gets, and fed it the result html. Then wraps it with, say, React.js triggers and codes, or even angular.js. But what if Node.js backend is not our choice?
So the requirements are very natural:
- Ability to (pre)render content on back-end
- Wire scripts on the page after it was loaded
- Do not replace page content with something generated by scripts
- Use html5 routing for all other page views
- Avoid node.js, at least don't use it as the main back-end technology
Am I alone against this problem? How do you think of it?