The solution to bad url routing in SPAs is distributing our work across a madcap wild ass front-end/back-end split with ill defined borders & no protocols? What's happening now is 500% more complicated.
But the magic is well packaged & available by default.
The SSR world has frameworks: but as another commenter pointed out, React stopped at being merely a library. And so it's been anarchy, deciding how to SPA, with many folks not realizing how many needs/libraries they really needed to have.
I'm hugely in favor of SPAs, but there's been a lack of well-integrated sensible approaches. The attempt to identify & only solve a narrow window of concerns has hurt our ability to imagine what apps are, left huge voids all over.
The hate for single page apps is about bad ones. Which are unfortunate common
What happens if you press shift? or cmd? and in which browsers / OSes? What if you use enter to open links, will it have a tabstop? What about accessibility. You're in essence re-creating the many parts of the webbrowser.
> The hate for single page apps is about bad ones. Which are unfortunate common
That's the same reason people hate php and c++
You can make great things with both..
Things like React Router make it trivial to create real links that additionally can change the page without a page reload if they are clicked. But you can still middle click to open in new page, still hover to see link, still navigate history normally, etc.
Sure you can make this work, but people don’t put in the extra hours of education, research, implementation, and testing
Imo the main issue with spas is they can be very fragile and don’t handle errors because they were built lazy. And since it’s all async, the spinners keep spinning forever despite the request failing already.
I think that’s the key point: the more browser functionality you take over, the more of a resource commitment you’re making to support that extra code. If you’re Google or Spotify, you can easily afford that and in the latter case you have a strong argument for necessity because there’s no way to keep the music playing across page-loads.
The key part is making sure that you’re taking on an appropriate level of work for your team and site. A local restaurant website should probably prioritize loading quickly since most people are looking for fast answers and the owner doesn’t want to pay to maintain a heavy tool chain which requires frequent maintenance.