Hacker News new | ask | show | jobs
by mklim 3546 days ago
It depends on where you draw the line for "trivial". Does it need routing/browser history? What browsers are you supporting, any legacy ones? Does the frontend do any kind of translations or visualizations with the data it's getting from the server? Does the layout have a bunch of panes and reusable views? Do you want your frontend code to be testable? All of that is an order of magnitude simpler using an actual SPA library or framework. And if you're not doing any of the above, you're probably better off making a server side rendered app with some AJAX sprinkled in anyway. At that point making it an SPA at all is probably overkill.

The huge frontend frameworks have an upfront learning cost and tend to be unfortunately leaky abstractions, but they're still much easier to maintain than a jQuery/JS mess with a bunch of DOM-manipulation code and HTML strings living right next to the business logic. They at least force the code into an understandable architecture and separate the view from business concerns. Experienced developers know how to structure their frontend JS already, but novice ones--the same ones that would feel the pain of learning a framework/ecosystem on top of JS when they first try to pick it up for an SPA--almost certainly won't.