Live data from Hacker News

It's time for modern CSS to kill the SPA

jonoalderson.com

281–290 of 516 posts

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

#281
post #224

Earlier quoted context omitted.

You are mixing up linkability/history and being an MPA/SPA. Many websites simply have some session/state dependent page.

Google Maps cant even preserve state in their iOS app. They are either the worst developers in the world or it is not simple. I don’t rule any of the two possibilities out. Some things you get for free with the correct architecture. For whatever reason, SPA does not have a great track record with their users.

> They are either the worst developers in the world or it is not simple.

Or they have a good reason to not do it (in some PMs mind).

At a guess, resetting the view, and displaying the nearest Domino's Pizza sponsored highlight pin on the map, could be one of them.

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

#282

It's worth noting that the Speculation Rules API and the View Transition API are not stable in Firefox and therefore aren't supported by all major browser.

yeah, if it's not in firefox it doesn't count. https://bugzilla.mozilla.org/show_bug.cgi?id=1823896 also mobile safari so basically all iphones.

Basically it is supported just in Chromium & derivates then. Hard pass.

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

#283

Earlier quoted context omitted.

I don't know, I think the most painful aspect of having to do a full reload is how I efficient the site is. The actual data is a few KB, but the page itself has to download 100 MB and the web browser is burning through a GB of RAM. Like I don't find Hacker News to be egregious to navigate, and nearly every nav is a reload. It runs fine on my 2008 laptop with 4 GB of RAM. But I go to DoorDash on the same device, and i…

Gmail takes 3s to load. And HN is a website, not an app.

How is HN not an app? All the content is user generated. Everything is interactive. What's the difference?

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

#284

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…

> When it is worth the pain to load a large bundle in exchange for having really small network requests after the load

...and yet, i keep running into web (and even mobile apps) that load the bundle, and subsequent navigation is just as slow, or _even slower_. Many banking websites, checking T-Mobile balance... you wait for the bundle to load on their super-slow website, ok, React, Angular, hundreds of megs, whatever. Click then to check the balance, just one number pulled in as tiny JSON, right? No, the website starts flashing another skeleton forever, why? You could say, no true SPA that is properly built would do that, but I run into this daily, many websites and apps made by companies with thousands of developers each.

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

#285

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…

to be fair to both points: he has a really warped view that SPAs are somehow purely about routing. he does correctly point out that a lot of sites could and should be treated as sites not apps.

I agree with you. The author's point is that browsers have finally understood why some traditional sites were created as SPAs, which involves recreating some of the functionality browsers already offer today. But that doesn’t mean all SPAs should turn into MPAs now.

IMO it will be hard for some traditional sites to adapt to the new browser capabilities, since we've built an entire ecosystem around SPAs. The author's advice should've been: use the browser's built-in capabilities instead of client-side libraries whenever possible.

Also, keep in mind he's sharing his own experience, which might be different from ours. I've used some great SPAs and some terrible ones. The bad ones usually come down to inexperience from developers and hiring managers who don't understand performance, don't measure it, don't handle errors properly, and ignore edge cases.

Some devs build traditional sites as SPAs and leave behind a horrible UX and tech debt the size of Mount Everest. If you don't know much about software architecture, you're more likely to make mistakes, no matter what language or framework you're using.

I realised years ago there's no "better" language, framework, platform, or architecture, just different sets of problems. That's why developers spend so much time debating implementation details instead of focusing on the actual problems or ideas. And that's fine, debates can be useful as long as we don't lose sight of what we're trying to solve and why.

For example: Amazon's developers went with an MPA. Airbnb started as an MPA but now uses a hybrid approach. Google Maps was built as an SPA, while the team behind Search went with an MPA.

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

#287

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 for…

You think bad programming is restricted to SPAs?

If they botch the back button in an SPA they will botch other things in an MPA

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

#288
I see some people claim that client-side routing isnt the strongest argument for SPA:s. And that is probably true from a technical point of view. However, lots of times users/clients want that even if they dont care about the rest (which is why I love how easy HTMX and Astro make it to add client side routing on top of a normal MPA).

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

#289
post #179

Earlier quoted context omitted.

So you describe the 1%? Is this to refute the person you’re replying to?

Where is 1% coming from? None of the software jobs I've worked at or even interviewed to work could have functioned as a website

Can you link those?

Because I mostly built backoffices, chats, forums, ecommerces, all things that would've worked better as websites.

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

#290
post #88

The View Transitions API is beautiful and I can't wait for it to become widely available. I've soured on SPAs in the past few years. So much more can be done with standards than people realize. SPAs were best for specific use cases but we made them the default for everything. Marketing pages are built in React! Basic pages with marketing copy have a build step and require hundreds of megabytes of dependencies. Like t…

"The View Transitions API is beautiful and I can't wait for it to become widely available." a few comments below "The view transitions API is a disaster." I love HN.

i hate it.
Post reply on HN