re: Some questions about SPA UX VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hey, thanks for the reply! Here are my thoughts: The user experience doesn't have much to do with SPA/non-SPA in this regard. It's just up to you...
 

Well, if I show a loader on every page, the distinction between an SPA and a server-rendered app vanishes. The 'smooth' transitions are definitely the part of SPA UX (please see the new section I added to my post: 'The Back button').

I disagree with that. The only real required difference between a SPA and a traditional web app is that the SPA avoids page loads. Ideally, a regular user shouldn't notice nor care whether the app is single page or not.

You talk about the SPA UX, but I don't think there's anything particularly different in UX considerations between SPA and traditional web apps. Smooth transitions enhance any app's UX. SPA can be (but not necessarily are) a way to achieve smooth transitions.

Usually, smooth transitions mean fast transitions. The promise of SPAs is that by only loading data, you avoid the extra time that it would take for the browser to parse the html, css and scripts for the new page and therefore the transition is faster. That is entirely different to no loaders should be shown ever. Ideally you want the transition to be so fast that the loader is never shown, but if the request takes a noticeable time (there could be a hundred reasons, slow connection for instance), you definitely want to show a loading state to the user instead of just leaving the app unresponsive.

Thank you, thank you for your thoughts. This is really reassuring:

The promise of SPAs is that by only loading data, you avoid the extra time that it would take for the browser to parse the html, css and scripts for the new page and therefore the transition is faster.

But then again, could you please address how to handle the Back button. Dev.to doesn't reload the content when I hit back, so what if there's an update on the page?

That's just the way dev.to is built. Nothing would prevent a SPA from requesting the data again when going back to the previous page.

In fact, requesting the data again would be the default behaviour, if you want to cache your pages like dev.to does, you need to specifically build it. Otherwise, the app doesn't care how it got to the current page, whether the user loaded the page there through a bookmark, a link within the app, the back button... It just requests the relevant data and renders the page.

Also, I think that the dev.to behaviour is not specific to the back button, I've noticed that articles and pages I've visited recently aren't updated when I visit them again, so I doubt that the caching is specific to the back button.

In fact, requesting the data again would be the default behaviour, if you want to cache your pages like dev.to does, you need to specifically build it.

Honestly, what a relief. I avoided building SPAs for the last few months because I thought something was wrong with my approach. 😅 Thanks a lot, good (sir? madam?)!

code of conduct - report abuse