Live data from Hacker News

It's time for modern CSS to kill the SPA

jonoalderson.com

241–250 of 516 posts

Re: It's time for modern CSS to kill the SPA

#241

Earlier quoted context omitted.

Low-bandwidth/spotty connections (combined with aggressive caching) are one of the strongest cases in favor of SPAs (emphasis on the A for Application, not website). Visit (and cache) the entire frontend for the app when you have a good-enough connection, then further use of the app can proceed with minimal bandwidth usage.

This is not true. In practice SPAs break completely when some network request fails which happens a lot on bad connections.

Sadly the art of error handling is often neglected by some SPA developers. I suspect that failures on the client are also less tracked this is tolerated by businesses.

Re: It's time for modern CSS to kill the SPA

#242
Lots of pushback here in the comments. But I can't think of the last time I enjoyed using a SPA website over a multi-page one. The initial loading feels delayed, the page scrolling feels unnatural and jarring (completely opposite of how a native app feels).

Also, one of my banks recently changed their old website to a new SPA one. And it is now completely useless. It can't load information in time, so most of the forms are empty. You can't even go back because it is a SPA. So I can only log out, log in and try again. Kind of scary when you are handling a lot of money.

And it is not just one website. As I said I can't recall ever using a good SPA website. So yeah, I can't wait until they are all gone.

Re: It's time for modern CSS to kill the SPA

#243

Earlier quoted context omitted.

> ...if you shared that misunderstanding of SPAs and used them to solve the wrong problem, this article is 100% correct. Agreed. The article was a frustrating read. The author is an SEO consultant. SEO consultants likely have a heavy focus on marketing websites. Actual apps and not marketing websites do benefit significantly from SPA. Imagine building Google Maps without SPA. You can animate page transitions all you…

I 100% would like to see an MPA Google Maps. Being able to come back to a webpage with previous directions? I think it would be glorious.

the web app already supports history navigation.

Re: It's time for modern CSS to kill the SPA

#244

Earlier quoted context omitted.

Low-bandwidth/spotty connections (combined with aggressive caching) are one of the strongest cases in favor of SPAs (emphasis on the A for Application, not website). Visit (and cache) the entire frontend for the app when you have a good-enough connection, then further use of the app can proceed with minimal bandwidth usage.

Honest question: Where are the places with low-bandwidth internet? Are we talking about cruise ships and satellites internet use cases?

TBH even in the SF Bay Area "tech capital of the world" you'll find areas with spotty reception.

https://www.reddit.com/r/bayarea/comments/1cqhr4i/what_is_up...

Re: It's time for modern CSS to kill the SPA

#246

Earlier quoted context omitted.

Low-bandwidth/spotty connections (combined with aggressive caching) are one of the strongest cases in favor of SPAs (emphasis on the A for Application, not website). Visit (and cache) the entire frontend for the app when you have a good-enough connection, then further use of the app can proceed with minimal bandwidth usage.

Honest question: Where are the places with low-bandwidth internet? Are we talking about cruise ships and satellites internet use cases?

Everywhere, my provider limits me to 32 kbit/s

Re: It's time for modern CSS to kill the SPA

#247

This article would benefit from an example page to show how these "feel".

Run this snippet from TFA in the console on GitHub:

  document.startViewTransition(() => {
    document.documentElement.dataset.colorMode = 'dark' // 'light'
  });
Then try to update the attribute manually instead, and compare the butter-smooth transition with view transitions vs. without.

Re: It's time for modern CSS to kill the SPA

#248
I don’t want to write an article but I think when SPAs are called for they are the least worst option.

Usually I want to ship an app to customers, but for that I need an app the targets Apple platforms, hopefully I can built it to target iOS, iPadOS and MacOS but maybe those are three different apps. I need an app that targets Android. I also need an app that targets Windows, and I need a linux app.

Then I need to distribute all those apps, so I need to get onto the AppStore for MacOS, the play store for linux, and whatever Huawei/other Chinese manufacturers use, and whatever amazon uses, and probably have an “official” APK available for stuff like fdroid.

I need a windows installer, maybe a portable package for windows, and get onto MSStore (which will then cover winget).

I need to pick some collection of linux distros to target, usually targeting having a deb release and rpm can be good enough. And you can build an “installer” yourself if you are so inclined.

Or I could just ship an SPA, I had to build out the same servers if the data was not local anyway.

Re: It's time for modern CSS to kill the SPA

#249

Earlier quoted context omitted.

It really depends. There’s a lot of SPAs which are practically unusable on a bad connection simply because it’s a challenge to even get the whole thing loaded in the first place. There’s been several occasions where I’ve had poor cell connectivity and a huge chunk of the web was effectively off limits due to this. So in addition to aggressive caching, I’d say keeping the app’s file size down is also pretty important…

I work on an SPA with hundreds of screens. We package it using off the shelf tooling with barely any configuration. All of the code and styling is still far under a megabyte gzipped. So unless it is an all text app, the size of the code bundle is probably going to be quickly dwarfed by the size of media like images, animated images, or videos. If a site has an SPA with a, say, 3mb code bundle, I think in most cases,…

Check out how bloated is MS Teams web app, for instance.

Re: It's time for modern CSS to kill the SPA

#250
post #225

On one hand, SPAs took off and became massively popular. On the other, I’m still curious why PWAs—especially the kind with service-worker-powered offline access—never really did. I don't like SPAs only if I find them bloated and with a messed up browser history that back button moves you out of the website. Imagine an e-commerce site that lets you review your order history and product pages offline (even if a bit out…

Offline is good for things like your ball sort game or a calculator. But the developers of that sort of thing want to make money, so they sell apps in the app store.

Offline order history is only a marginal improvement on the e-commerce experience from a customer and business perspective, so it's more appealing to us engineers who appreciate it as a feat of engineering prowess.

In other words, offline isn't PWAs killer feature. Besides, native apps can do it too.

PWA's killer features are circumventing the app store and the app store tax and not maintaining two codebases for Android and iOS.

Another Hacker News client would be a good example of a good PWA that you might install to your phone. It could have niceties like "save for later" or special styles applied to your favorite commenters. Offline support would be useful too, of course but not the main reason to develop a PWA.

Uncensored, paid content is another significant use case.

Post reply on HN