News for hackers. Stuff that matters.
Re:Browsers, JSON, and FormData by brigandish on Saturday November 12, 2022 @06:03AM (#33571995)
I believe "swish transitions" refers to the lack of the page refresh flash, which really was one of the initial attractions to SPAs when they first came to prominence.
Re:Browsers, JSON, and FormData by eurasiantiger on Saturday November 12, 2022 @06:28AM (#33572114)
And now we have websites where clicking a link does nothing until a few seconds later the page content suddenly changes.

If you’re lucky, the page will scroll to the top as well!

Re:Browsers, JSON, and FormData by KronisLV on Saturday November 12, 2022 @06:53AM (#33572237)
> And now we have websites where clicking a link does nothing until a few seconds later the page content suddenly changes.

Worse yet, sometimes people do "page" transitions in JS event handlers, which means that all of the sudden you no longer can ctrl/shift + click these UI elements to open up the page in a new tab/window, or even copy the link.

Not that well made SPA solutions aren't pleasant to use, it's just that you can do all sorts of weird things that make using them miserable.

Re:Browsers, JSON, and FormData by capableweb on Saturday November 12, 2022 @08:06AM (#33572668)
I agree a lot of SPA implementations suck in the way you describe, just wanted to add that this was a issue before SPA navigation too.

Some websites used iframes to render the main content, and kept navigation controls outside the iframe. So if you open a link in a new tab (or window, before tabs existed), you ended up on a page with just the content without the navigation.

Some routers still use this way for page setup, for some reason.

Shitty implementations will be shitty, no matter how you do it.

Re:Browsers, JSON, and FormData by brigandish on Saturday November 12, 2022 @10:10AM (#33573762)
I'd forgotten about those horrible iframes! It makes me wonder what other horrors I've left behind.
Re:Browsers, JSON, and FormData by solarkraft on Saturday November 12, 2022 @08:20AM (#33572775)
My health insurance provider has a website (seems mostly server rendered but with dynamic elements) that links documents that you can only access once (it seems). They're real links that will open a new tab when middle-clicked.

... but not of the document since the document is opened through some JS crap.

Thank you, Techniker-Krankenkasse.

Re:Browsers, JSON, and FormData by mort96 on Saturday November 12, 2022 @07:26AM (#33572403)
Huh, I browse server rendered pages every day and rarely/never experience the page refresh flash.
Re:Browsers, JSON, and FormData by brigandish on Saturday November 12, 2022 @07:59AM (#33572610)
The internet was a lot slower 15/20 years ago.
Re:Browsers, JSON, and FormData by mort96 on Saturday November 12, 2022 @08:04AM (#33572652)
I'm not denying that it was accurate 15/20 years ago, I'm questioning whether it's accurate today.

Maybe there's an argument to be made for it in developing countries, but in my experience, SPAs are way, way worse to use than SSR pages on slow devices and unreliable connections. Buttons are unresponsive for a minute as JS is downloaded and parsed and executed, content can't render incrementally, and the UI softlocks waiting for a failed or timed out API request. People don't seem to be making SPAs to benefit slow and unreliable devices and connections.

Re:Browsers, JSON, and FormData by brigandish on Saturday November 12, 2022 @10:08AM (#33573736)
I'm not arguing with you, I think most SPAs are unjustified, it's just that 15/20 years ago people really wanted to get rid of whole page refresh and all the problems that brings, which is a laudable aim, but has morphed into "why don't we make our own back button" and nonsense like that.

The justification nowadays seems to be (in truth) "if you take away my tools I don't know how to build things so I'm going to run npm init and go from there".

Re:Browsers, JSON, and FormData by satyrnein on Saturday November 12, 2022 @10:14AM (#33573808)
And then pjax/Turbolinks attempted to address that more surgically, without giving up on server rendering.
Re:Browsers, JSON, and FormData by megaman821 on Saturday November 12, 2022 @01:00PM (#33575395)
All modern browsers hold the old page for a bit so there is no flash.
Re:Browsers, JSON, and FormData by franga2000 on Sunday November 13, 2022 @12:17PM (#33585053)
Yet many web developers still manage to screw this up and cause flashes by doing weird things with fonts, dynamic loading and other such nonsense.
Re:Browsers, JSON, and FormData by megaman821 on Sunday November 13, 2022 @12:25PM (#33585121)
Well Cumulative Layout Shift (CLS) is bad on the first page load. It is not surprising it manages to be bad on every subsequent page load.

It is not that hard to fix either. There are several appropriate font swapping strategies built into CSS, and just reserve space by specifying the dimensions for images and dynamically loaded content.