Live data from Hacker News

It's time for modern CSS to kill the SPA

jonoalderson.com

141–150 of 516 posts

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

#141
I swear if I see another "SEO" guy or some rando web dev who joined the workforce after Covid complaining about SPAs by misrepresenting it, I'm gonna explode.

As someone who's been developing web apps since the 2000s, let me tell you the origin of SPA has few things to do with the "false promise of SPAs" he listed, but largely due to companies in the late 2000/early 2010s wanting to go "mobile first". This usually meant they still had a desktop second somewhere, which implied they were architecting the entire system to completely separate the frontends and the backend.

Before, what web devs meant by frontend was essentially server-side rendered HTML templates with perhaps a little bit of jQuery running on the client-side. Now, since mobile and desktop web apps are to share some business logic and the database somehow, people had to rediscover REST by reading Roy Fielding's Phd dissertation that inspired the original HTTP. This meant now every company was moving to service-oriented architecture and started exposing their backend APIs onto the open internet so their mobile apps and SPAs running in the browser can share the same APIs. This was a cost saving measure.

This period also coincided with the steady decline of full-stack webapp frameworks like Ruby on Rails and Django because for a couple of years, these frameworks had no good ways to support an API only applications. Django hadn't even reached 1.0 back then. This was a time when NodeJS was really starting to pick up momentum. Once people had started being more comfortable with JS on the server-side, lots of people suddenly realized they could push a lot of business logic to increasing powerful desktop browsers and phones, application hosts people now call "edge devices".

This is the true impetus of SPA. How is CSS going to kill this need?

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

#142
post #99

"... someone says the words. A CMO. A digital lead. A brand manager. ... it’ll be an SPA." Why not spell out CMO and SPA and a civilian such as myself will not have to toddle off and dig out a search engine? If you are going to get all assertive and pissed off, please be inclusive too.

The problem is he's confidently wrong in believing Single Page Applications are about page transitions. Not at all. It's more about keeping state and an application-like experience. Like playing a song on spotify and changing to the search page and the song keeps playing... that type of thing.

Thank you for giving me a starting point to work with.

FFS, I have a degree in Civ Eng but if I start wittering on about bridges and roads I will define abbreviations. Its common courtesy.

With regards your analogy involving Spotify: I ripped all my CDs to FLAAC some years ago. The tapes and records took a little longer. No idea what a Spotify is. Well I do, I'm an IT consultant, but I don't actually care, I'm a 50 something IT consultant! I bought my music years ago and listen to it on my gear and from my gear alone.

This SPA thing sounds like it is getting out of hand and it also sounds like there are tribal divisions being drawn up. IT does love a tribe! We even have multiple internal tribes: devops, webdev and so on.

I'm nominally a PHB ...

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

#143
post #10

SPA is not only about seamless transitions but also being able to encapsulate a lot of user journey on the client side, without the need of bothering server too much. Let me give you an example - one of my biggest gripes about web ux is the fact that in 2025 most shops still requires you to fully reload (and refetch) content when you change filters or drill down a category. A common use case is when you come to a sho…

In almost all cases the back swipe in the spa resets you to the top of the page, navigating out of the app and back in doesn’t work, etc. It’s really hard to build a multi page spa that feels good.

It's funny you've mentioned that.

It reminded me of the time when I joined Wikia (now Fandom) back in, I think it was 2006. One of the first things that landed on my desk was (I can't recall the context) deeplinking.

And I remember being completely flabergasted, as I came Flash/games background, and for us that problem was completely solved for at least 4 years at the time (asual swfaddress package). I felt kind of stupid having to introduce that concept to much more senior engineers that I was at the time.

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

#144

SPAs make sense when your users have long sessions in your app. When it is worth the pain to load a large bundle in exchange for having really small network requests after the load. Smooth transitions are a nice side effect, but not the reason for an SPA. The core argument of the article, that client-side routing is a solution for page transitions, is a complete misunderstanding of what problems SPAs solve. So absolu…

> in exchange for having really small network requests after the load. I'd love to see examples of where this is actually the case and it's drastically different from just sending HTML on the wire. Most SPAs I've worked on/with end up making dozens of large calls after loading and are far far slower than just sending the equivalent final HTML across from the start. And you can't say that JSON magically compresses som…

> I'd love to see examples of where this is actually the case and it's drastically different from just sending HTML on the wire.

There are complete CAD applications running in browsers for PCB and mechanical design with many layers, 3D view, thousands of components, etc.

For example: https://easyeda.com/ https://www.onshape.com

> because HTML compresses incredibly well

Haven't compression under TLS have been mostly disabled after CRIME and BREACH attack?

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

#145

Earlier quoted context omitted.

The real reason SPAs are popular is because JavaScript is the new Visual Basic and there are millions of developers that know nothing else. Workforce market forces like that have a vastly greater effect than “bandwidth optimisation”. My evidence for this is simple: every SPA app I’ve ever seen is two orders of magnitude slower than ordinary HTML would have been. There is almost never a bandwidth benefit in practice.…

> every SPA app I’ve ever seen is two orders of magnitude slower than ordinary HTML would have been. I'd argue then you don't have an SPA. However I don't see how you could have a application like Figma or Discord and say "ordinary HTML is faster" (or even possible).

You mean a chat cliënt? That seems a good worse case scenario.

If you limit history to the most recent message (and have an link to the archive at the top) you could simply reload the entire page on some interval that declines with message frequency (and when you submit the form)

Since the html document is pretty much empty the reload happens so fast you won't see the flashing. With transitions it would be perfectly smooth.

With modern css you can put the elements out of order. You can simply append the new line to the end of the html document that represents the channel. (And to the archive) Purging a few old lines can be done less frequently.

I haven't tried it but it should work just fine. I will have to build it.

Initial load will be 100x faster. The page reloads will be larger but also insanely robust.

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

#147
post #145

Earlier quoted context omitted.

> every SPA app I’ve ever seen is two orders of magnitude slower than ordinary HTML would have been. I'd argue then you don't have an SPA. However I don't see how you could have a application like Figma or Discord and say "ordinary HTML is faster" (or even possible).

You mean a chat cliënt? That seems a good worse case scenario. If you limit history to the most recent message (and have an link to the archive at the top) you could simply reload the entire page on some interval that declines with message frequency (and when you submit the form) Since the html document is pretty much empty the reload happens so fast you won't see the flashing. With transitions it would be perfectly…

>You mean a chat cliënt? That seems a good worse case scenario.

No, I mean discord. An application where you can chat, recieve phone calls and watch a live stream all at the same time.

A pure html chat client is uninteresting - there have been realtime html chat clients since I was teenager, even before the release of jquery.

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

#148
post #10

SPA is not only about seamless transitions but also being able to encapsulate a lot of user journey on the client side, without the need of bothering server too much. Let me give you an example - one of my biggest gripes about web ux is the fact that in 2025 most shops still requires you to fully reload (and refetch) content when you change filters or drill down a category. A common use case is when you come to a sho…

Generally speaking, companies don't want you to download their entire catalog. They don't want competitors to be able to analyze it easily like that. And if a store is selling books, it might have hundreds of thousands of them. No, it's not a good experience to transfer all that to the client, with all the bandwidth and memory usage that entails.

That's really weak argument.

If it's one their website the competitors can write a simple crawler and create that catalog.

And you don't have to send every single field you have in your database. Once the user selects a category you can send a metadata that enable the client to scaffold the UI. Then you cache the rest while user interacts with the site.

Barnes and Nobles - according to their FAQ - has 1 million unique items in their catalog. But they also have tons of different categories. A single book cover weights around 30kb.

I'll leave it as an excercise to figure out how much data you can fit into 30kb to make usable filtering system.

btw: opening their front page downloads 12.1MB already.

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

#149

Earlier quoted context omitted.

> every SPA app I’ve ever seen is two orders of magnitude slower than ordinary HTML would have been. I'd argue then you don't have an SPA. However I don't see how you could have a application like Figma or Discord and say "ordinary HTML is faster" (or even possible).

For ever one real "app" like Figma there are hundreds of web pages with some forms and light interactivity. Numerically there are far more enterprise LoB apps than there are true web applications that SPAs are well suited for.

You claimed "every SPA" app, now its down to "most". I'm not going to argue against the fact that some people have hammers and only see nails.

Every popular technology has been over implemented - these same enterprises probably have a 100-node Spark cluster to process 1GiB of data.

Post reply on HN