Live data from Hacker News

It's time for modern CSS to kill the SPA

jonoalderson.com

181–190 of 516 posts

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

#182
post #8
post #2

This reads more like "ditch Next.js" for traditional SSR. A good SPA has a lot of benefits. Because it can be interactive like a native app. It can only use those benefits, if it is interactive to some extent (like gmail or google docs). Smooth navigation is a very bad reason for picking a SPA.

What do you mean by 'interactive like a native app'? The article is focusing on two main parts of making things feel like an app: page view transitions and speed/preloading. To me, those seem like a big part of what makes a site/app feel interactive. And letting the browser do the work and having real URLs has other huge benefits I appreciate. But agree that for things like GMail, etc, a SPA approach definitely makes…

Those aren't the main parts of feeling like an app. Feeling like an app means taking an action doesn't load a new page. Feeling like an app means the concept of a page mostly goes away.

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

#183
post #54

I don't know what universe this SEO-consultant author lives in. The author gives Next & Nuxt as an example of the kind of frameworks going against his prescription, but that is so wrong. 1. Next won the war in the west, big time. Very very big time. Whenever people talk about new React apps they inadvertently mean Next. On the Vue side Nuxt is the default winner, and Nuxt is just the Next of Vue. That means that by d…

There was a war? News to me. Saying Next won is like saying React won. Nothing won, everyone just latched on to what they thought the crowd vetted. The blind can't lead each other. Most people that stuck to Angular or minimal or no-frameworks are truly wondering what the fuck are all these people talking about? . Even the Facebook docs point straight to Next Startups and SV jerk each other off by promoting each other…

Kinda is a war unless you're working solo, cause you're gonna get forced to use something or another. When I tried a few solo web projects instead of just being a backend guy, I picked up React on my own because it was the only thing that makes sense. The page does what the code says. And that was after trying other things.

Now I gotta occasionally use Angular, and it's boilerplate hell. Adding one button involves editing 30 classes and files even if you don't use templates. I took a course at work where even the instructor got confused adding a button. Why would anyone ever use this besides Google, or do they even use it?

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

#184

CSS is uderrated and almost never even discussed in front end interviews. Its all javascript javascript javascript. Javascript is over-rated. CSS > JS

I don't know if CSS is underrated, but it's definitely a speciality that a lot of software developers don't (want to) specialize in. It's like the front-end equivalent of SQL; so much is possible in SQL, but most logic is built in application code because SQL is scary.

Most logic is built in application code because it makes it easy to structure, reason about, and test. Developers should be scared of code that is hard to test and reason about.

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

#185

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…

> ...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 want, the experience will suck!

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

#186
post #57

The point of SPAs was never page transitions. I can’t name a single major SPA that does good page transitions, can you? They all just replace the content. And to take a popular SPA framework as an example, it’s almost impossible to do page transitions in Next.js because of the way routes are loaded. I know this because I added proper page transitions to Next.js and it has been an absolute nightmare. There are two goo…

3. APIs. If you already have a client facing API for your iOS and Android apps, and maybe one for developers, a SPA is just another app to plug into that backend.

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

#187
post #69

Earlier quoted context omitted.

> Startups and SV jerk each other off by promoting each other (think affiliates). None of it means shit. No, this is FB ceding the battle. They absolutely didn't want this. They dropped CRA because social media celebrities were shitting on CRA. Dan Abramov had to do a complete 180 in a single day, after writing a long thoughtful essay in defense of CRA.

You are in your own little universe. Social media celebrities shitting on React? I don't even want to enter your world. "Bro, you should see the celebrities shitting on React" Like WHO!? What developer celebrity, what universe have I been missing out on? Anyway, I do love me a good ol' fashioned "fuck SPAs, back to HTML" punching bag post on HN. It's always the same discussion over and over.

said celebrity is an AI-generated Peter Griffin

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

#188
post #151

Most of my personal app projects are SPAs, because it’s easy to just pop some static files in my static file server and serve a whole app with routing and functionality without having any server logic. Way simpler to maintain, since I can just sync my ‘apps’ dir and all my mini-projects are deployed.

Can do all that without a SPA.

Not really... like sure if you want a static site, but I'm talking about static apps. Like if you want to handle /id/$id routes with data based on user-generated content saved in localStorage... you'll have to handle routing somewhere. Basically, what I'm saying is that if you have an stateful app that doesn't require server state, I think SPA+PWA is pretty ideal.

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

#189
post #135

Earlier quoted context omitted.

> I very well remember heavy, slow-loading websites of, say, year 2000, without any SPA stuff, even though lightweight, quick-loading pages existed even then, in the epoch of dial-up internet. Sure, lightweight, quick-loading pages existed , but sometimes you want to see a picture.

Google appeared in 1998. It was very noticeable how fast it loaded compared to competitors like AltaVista and Yahoo. None of them featured large photos. This was visible not only on a 33600 phone connection at home, but also on a megabit connection at work, because, shockingly, how fast your backend is also plays a major role.

Speaking of speed, don't forget when gmail and google maps first came out: With the data copied locally they could separate the UI from server requests for a lot of interactions so a lot of the UI was actually instant and you could keep doing things while the requests were handled in the background. This seems to have been missed by a lot of modern stuff that doesn't bother figuring out if this is even possible and opts to show a loading spinner instead.

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

#190

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…

> ...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.

Post reply on HN