I was anti-SPAs until I started living permanently on a 2G connection. Now I love the few that I use.
They cache a lot of data, lazy load almost everything, and renders are much faster. Also, best of all, the experience when my internet goes down—which is often—is at least a partially functional page, instead of a total blank screen which is what HN and other sites that deliver full HTML or nothing gives me.
I cannot count the number of times I have lost a long well-typed comment on HN, because my internet went down while sending it and my browser apparently considers that to not be situation that it can reload the page on using the data it was going to send.
I think SPA's work better on low-data lines because they are apps and work just like other phone apps.
I used to live on a flaky EDGE connection and had quite a different experience: I rarely, if ever, got a SPA to load fully. Most of the time, the inital payload was too large to ever get downloaded successfully.
I often travel through rural areas in the UK where it's hard to get anything more than an EDGE (occasionally 3G) signal, and I concur with this massively.
What’s really hilarious is how long it took imgur to render that screenshot (took about 10s for me on my mobile connection), because apparently a website that hosts images needs to be a stuffed-to-the-gills-with-JavaScript SPA too nowadays.
My favorite thing about Imgur is that it doesn't degrade gracefully. If something in its weird dependency graph doesn't load on a mobile connection, or because of an ad blocker, sometimes you can't even see the hosted images at all.
Still... you don't need to be an SPA for that kind of problem. Half the static sites I see hit that number with just trackers from various ad networks.
Agreed 100% - SPAs vs server-side rendering are about the use case. If you are producing a site of mostly static content where the end users mainly read new content page-by-page, SSR makes sense. But if your userbase is actively using an app to create content, the server is the receiver of info, not the producer. In such cases, an SPA gives all the tools to the end user and allows them to keep working without page reloads. As mentioned, this is particularly important on slower networks.
I'm sure we could lay out more scenarios where one approach is better than the other, and we should - this is the same story as always: Choose the right tool for the job. (And use that tool well - as other comments have mentioned, writing a bad SPA doesn't help anyone.)
The problem with SPAs is that you're very rarely able to reap those benefits in practice. Yes, the first visit is slow. But most of the time, the first visit is the only visit. By the time you visit this website again, it'll either be out of your cache, or it'll get updated and your cache will be invalid anyway.
> I was anti-SPAs until I started living permanently on a 2G connection. Now I love the few that I use.
I broadly agree; my problem with them is that a lot of the time I want to load the content into a new tab.
Look at Jira, middle-clicking any link to a ticket on any page opens that ticket in a new tab. That's exactly what I want - middle-click 5 times in 10s and have the five tickets open and ready for me.
What I get from (most) SPAs is the opposite - new content is loaded into the existing DOM, so I am unable to quickly middle-click all the entries I want to see and expect them to open in a new tab, fully functional.
Exactly, they're like phone apps. Except they're truly cross platform and tech giants have no rights to control the development and installation of the app.
They cache a lot of data, lazy load almost everything, and renders are much faster. Also, best of all, the experience when my internet goes down—which is often—is at least a partially functional page, instead of a total blank screen which is what HN and other sites that deliver full HTML or nothing gives me.
I cannot count the number of times I have lost a long well-typed comment on HN, because my internet went down while sending it and my browser apparently considers that to not be situation that it can reload the page on using the data it was going to send.
I think SPA's work better on low-data lines because they are apps and work just like other phone apps.