It almost never has to be complicated. People just enjoy making it so.
Looks at their inventory management system
jQuery would fit well here.
onSomethingChanged() {
$('#foo').prop('disabled', true);
$('#spinner').removeClass('invisible');
$('#error-1').prop('hidden', true);
$('.buttons').hide();
if (value) {
$('#btn-2').show();
} else {
$('#btn-2').hide();
$('#btn-3').show();
}
// etc ...
}Round trips are just fine. Browsers are smart, servers are fast, and HTML compresses well. The site you're reading right now (HN) requires a reload. Stackoverflow requires a reload. Neither are slow to use.
If your page is really that complicated, then I suggest Vue or Preact which are efficient and designed to progressively enhance pages instead of rebuilding everything in JS.
Sites like HN and Stackoverflow have a vastly different audience than most bread-and-butter sites, and tackle different kind of issues.
If you really need a offline site then a simple service worker is all you need to cache the pages, not a big JS app.
You can write bad apps in any language and environment, similarly a site/app is not bad just because it's done in Y.
I would like to trade out AngularJS for Vue someday, though.
1. Render model from your JS object.
2. attach events
3. Change model
4. Go to step 1
But it could have very easily gone the other way. If your website had complicated validation rules on multi-page forms (not unheard of in healthcare) the site would be better off for some basic state management interacting with a standardized authentication/authorization framework that you didn't have to write.
From what you're describing, it sounds like you did right by the client in this circumstance. But sometimes, it does have to be complicated. And in those circumstances, frameworks and javascript (unlike garbage) have an important place.