Almost all applications that are written in the world today are glorified forms.
That's reality because 95% of apps are written for the business world. Most don't really do much apart from take some form data, apply business logic to it and show the results/send some messages.
Even most consumer apps like Facebook/Twitter/TikTok/Pintrest/etc. are basically glorified forms.
You can do save/load state all in nanoseconds, any competent programmer can easily aim for 50ms page loads, well under human detection.
This is incredibly basic stuff and how it was done for decades before SPAs.
Writing a stateful front-end that just asks for what it needs from a well-built API when it needs it is enormously simpler than trying to store all state in some server session and having to work around your own framework whenever you need a dynamic dropdown list.
We all seem to have collectively forgotten how awful web frameworks used to be, and how little interactivity the user actually expected. Things are way better now.
It's also possible to store ViewState "on the server side" instead of on the client side. So instead of sending megabytes up and down with every request, the client just gets a unique identifier. The downside is increased memory usage, but that's often better, especially for internal enterprise apps.
Yes, you would need multiple pages. But that is how most form-based SPAs work today anyway, and avoiding a page reload isn't always preferrable to just reloading if the SPA version requires heavy amounts of JS and the good-old-static version loads in the blink of an eye.
Yeah, but our users like interactive forms. When a widget is changed, they like feedback instantly.
Just about any shop that reloads the entire page when you change a single filter gets annoying pretty fast.
Imagine an online computer store: tick the box for "16GB RAM", wait for page to reload, tick "32GB RAM", wait for page reload, tick "512GB SSD", wait for page reload, tick "1TB", wait for page reload.
Now you may argue you still have to wait if it is an SPA, but then you're only waiting for the results. You can quickly tick all four boxes in an SPA and each one may cause a background request, but that doesn't matter because you don't have to wait for each request to complete to make your next selection.
Tick all the boxes and then click "Apply filter".
>
> Tick all the boxes and then click "Apply filter".
Many places do that, but it's not as user-friendly as not having to click "apply". If there's a large number of filters (Buying a computer on Amazon, for example), the "apply" button is off-screen most of the time - scroll to either the last filter or the first one to even know that there is an "apply" button.
Also, some fields do not work too well by having a separate "apply" filter step. You drop-down the manufacturer selection, choose "Lenovo", click apply and now there is a new drop-down for "Model".
The better experience is one where both those drop-downs exist, and second one is populated only after a choice is made on the first one. In all the pages I've seen that have drop-down #2 dependent on drop-down #1, those that got a JSON list via AJAX were much more pleasant to use than those that reloaded the entire screen just to add 5 items to the drop-down #2.
As the creator of the software, it's more important to have happy users than have an easier maintenance burden.
Doesn't that still reload the entire page when a checkbox is clicked?
Example:
I have an application where a form input expects an URL. As soon as any URL is entered, I need to:
1) Provide feedback on wether that's a valid URL or not, before the user submits the form
2) Show a suggestion for a page title, which is usually the <head> title extracted from that URL. If the user clicks on the suggestion, that should become the value of the next input in the form.
Other than this, this is a pretty basic form. But how do you give a decent experience without JavaScript?
Right, a bit of jQuery would do it in this case... but then more and more similar small tweaks are necessary, and before you realise you're swimming in spaghetti.
I can't make that logical jump. If you can't keep that tiny bit of code organized, why do you want to pile on the entirety of react and why would that be more organized?
Maybe you're saying it's a snowball of these things. I've seen that happen, but it didn't have to.
But, the worst part in my experience, is that without one of these "opinionated" frameworks such as React or Vue, each new developer that joins the team (after others leave) have a total different idea of how to organize the code, or they have a hard time understanding the "custom" organization and ideology behind the structure you've had to invent to keep in maintainable.
Again, I'm not a fan at all of frontend heavy frameworks, but they do solve a real problem, specially in large apps and large teams or teams with a lot of turnover.
I'd say it is the exact situation in the backend regarding using Flask vs Django, Sinatra vs Rails, etc... having a set of imposed opinions and structure have long term benefits as soon as you're not the only one working on the codebase.
maybe 50ms is under the "conscious detection" threshold (debateable, IMO...) but it will definitely feels "laggy"
In my experience with hiring, the only reason it has become easier to move a lot of logic and state to the frontend is because frontend developers are plentiful and easier to hire. I'm not dissing them: it's very easy to find great frontend devs that know their tools inside-out and also know the fundamentals of software engineering.
On the other hand, good backend developers are becoming rarer and rarer, and most of the new breed struggles to do virtually anything beyond a cookie-cutter REST API. Very few are knowledgeable about databases, for example. Very few know about deployment. Some of them aren't even familiar with HTTP as a protocol. Any backend dev that I interview that is as knowledgeable about their niche as the frontend devs I interview often gets two or three other offers and we have to raise offers very very often.
I'm pretty sure there's lots of great backend engineers who could do SSR like we did back in 1990-2010 with one hand behind their backs. But there just isn't enough of those. Most of the ones you see will have no idea how to deal with it.
On the other hand... maybe not, for more conservative industries? You don't need a full-blown frontend team to be very productive. A great frontend engineer (easy to find) and a cookie-cutter backend code-monkey (also easy to find) working together and getting paid 1x each are probably as productive as a great backend engineer you're thinking of paying 2x.
But the thing is that the 2x will bring some extra experience, less bugs... but that's not what companies are after.
So yep you have a point.
Also, is it really easier to everything on the server? I don't think it is so by definition. You could argue that a stateless REST API with client-side state management is less complex than doing everything server-side. It's a much more scalable solution and creating interactive user interfaces is very easy.
Ofcourse it could be that interactive user interfaces is not something you are aiming for. That's fine. But do understand that most applications are actually usually very interactive.