News for hackers. Stuff that matters.
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by int_19h on Saturday May 03, 2025 @06:02PM (#43882731)
My biggest annoyance with SPAs is that they usually break forward/back/history in various subtle (or not so subtle) ways.

Yes, I know that this can be made to work properly, in principle. The problem is that it requires effort that most web devs are apparently unwilling to spend. So in practice things are just broken.

Re:We Fell Out of Love with Next.js and Back in Love with Ru... by jefozabuss on Saturday May 03, 2025 @06:54PM (#43883028)
I still have some ptsd from payment gateway integrations via iframes about 6-7 years ago. If you thought SPAs are bad by themselves for history tracking imagine those banking iframes randomly adding more entries via inside navigation/redirection that you have to track manually.
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by hirvi74 on Saturday May 03, 2025 @09:38PM (#43883794)
A lot can be said for just putting a "back" button a page. I still do it occasionally for this very reason. Then again, my user base for the apps I write are the most non-technical folks imaginable, so many of them have no concept of a browser back button to begin with. I am not being hyperbolic either.
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by int_19h on Saturday May 03, 2025 @10:09PM (#43883934)
Thing is, the browser back button is still there, though. So now you have two identical buttons that do different things. And that's really bad UX.
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by creakingstairs on Saturday May 03, 2025 @10:51PM (#43884096)
I’m split on this. I used to agree with you but when I talked to internal users and customers, they really liked having a back button in the app. I would tell them the browser back button is there and we haven’t broken history so it should work to which they just often shrug and say they “just” prefer it.

My hypothesis is that they’ve had to deal with so many random web apps breaking the back button so that behaviour is no longer intuitive for them. So I don’t push back against in-app back buttons any more.

Re:We Fell Out of Love with Next.js and Back in Love with Ru... by int_19h on Sunday May 04, 2025 @04:27AM (#43885381)
It's okay if both buttons do the same thing. But OP (if I understood them correctly) proposed the in-app Back button as a hacky solution to the problem of browser one being broken, which kinda implies that they don't behave the same.
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by syndeo on Monday May 05, 2025 @09:21AM (#43894846)
I think you're right on the money—those bad web apps that told people emphatically "do NOT use your browser's back button!" did the rest of us a lot of damage, as I really do agree that it trained many people to never press it unless they actually want to leave the app they're using.

I myself am guilty of (about 14 years ago now) giving an SPA a "reload" button, which had it go and fetch clean copies of the current view from the server. It was a social app; new comments and likes would automatically load in for the posts already visible, but NEW posts would NOT be loaded in, as they would cause too much content shift if they were to load in automatically.

Admittedly this is not a great solution, and looking back on it now, I can think of like 10 different better ways to solve that issue… but perhaps some users of that site are seeing my comment here, so yeah, guilt admitted haha.

/)

Re:We Fell Out of Love with Next.js and Back in Love with Ru... by michaelcampbell on Monday May 05, 2025 @11:36AM (#43896226)
Bad UX that provides a functionality that otherwise isn't there at all is still better.
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by skydhash on Saturday May 03, 2025 @07:19PM (#43883138)
An additional one for me is stale state. I can leave most webpages open for days, except SPAs. Especially on mobile.
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by whatarethembits on Saturday May 03, 2025 @10:33PM (#43884030)
This issue doesn't get enough attention; apart from the obvious implications on bad UX, I find myself losing interest in a project after realising its broken in so many subtle and non-subtle ways due to the underlying tech. I, like many others, got into programming due to the joy of creating something beautiful and attempting to follow (influencer led) JS trends nearly killed my interest in this field at a time.
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by molochai on Saturday May 03, 2025 @11:37PM (#43884290)
A small but silly one: breaking middle and right click functionality for links.

An auction site I use loads in the list of auctions after the rest of the page loads in, and also doesn't let you open links with middle click or right click>new tab, because the anchor elements don't have href attributes. So that site is a double-dose of having to open auctions in the same tab, then going back to the list page and losing my place in the list of auctions due to the late load-in and failure to save my scroll location.

Re:We Fell Out of Love with Next.js and Back in Love with Ru... by pc86 on Sunday May 04, 2025 @09:21AM (#43886551)
I would submit this as product feedback if you haven't. One of my favorite things as a dev working on client-facing things is when I get negative feedback that presumably has a pretty easy fix to at least part of it ("add 'href' to these links") where I can pretty quickly make someone's life a little easier.
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by yawaramin on Friday May 09, 2025 @10:56AM (#43937490)
Unless it's not a link but a <div onClick={loadItem}>...
Re:We Fell Out of Love with Next.js and Back in Love with Ru... by HJain13 on Monday May 05, 2025 @03:41AM (#43892717)
This is not exclusive with an SPA. Even MPAs/SSR apps can have this issue. But I guess MPAs are probably not built with post load interactivity in mind and maybe that's why its less prevalent there.