Yup. A car analogy: "Instead of waiting for the driver to turn the steering wheel before causing the car to turn, we put the car on the back of a flatbed truck that tracks driver behaviour and tries to predict their intent. Then we can start turning the flatbed truck a little bit sooner to improve user experience."
This seems to me to be the key phrase.
I sympathize with all the "JS has gone too far" people in this thread. I also hate bloated JS apps. But, "almost all SPAs are bloated trash" is a distinct claim from "SPAs are intrinsically trash".
In my experience it is possible to have lean, high-performance, accessible SPAs without too much developer difficulty. Svelte (created by the author of this article) is one framework in this space, although I think there are better approaches.
The simple question as to where are all these inspiring SPAs that truly push the web to next levels...is completely unanswered.
We get docs sites, demos and blogs. Where when clicking on a link...wow!...it loads without a page refresh. Something possible using simple ajax some 15 years ago.
Do you investigate all the fast snappy sites you visit to confirm they aren't single page apps? What about the slow pages that aren't SPAs (most every news site)?
It seems like anyone who wants to dislike JS and/or SPAs can easily confirmation-bias their way into believing it.
Anyway, for fast SPAs, here is a useful comparison: the "RealWorld app" demo.
I would urge everyone to look at the Lighthouse audits for these three implementations:
React/Redux: https://react-redux.realworld.io/
Angular: https://angular.realworld.io/
Vue: https://vue-vuex-realworld.netlify.app/#/
Svelte/Sapper: https://realworld.svelte.dev/
Solid.js: https://ryansolid.github.io/solid-realworld/
This is just a demo, of course, but it is close enough to be representative. From just this simple demo we can already see significant differences: Svelte and Solid.js are much snappier. The author of the article, Rich, created Svelte.
Of course, this is just talking about performance, not yet getting accessibility, navigation, transitions, etc right.
How many sites actually do this? And how much additional bandwidth (and battery life for mobile devices) does doing this consume?
> We can provide better visual feedback that loading is taking place and a transition is about to occur. And we don't need to load the entire contents of the page — often, we can make do with a small bit of JSON because we already have the JavaScript for the page.
In my experience sites that do this are almost universally slower and less responsive than sites that just use normal links. Maybe that's just confirmation bias and I just don't notice it as much on sites that do it well, but a particularly egregious example of this is Reddit's current mobile site vs their old i.reddit.com mobile site (which I use exclusively (despite it missing a number of newer features and having a lot of minor bugs the newer site doesn't) because it's way way faster).