All these concerns assume HTML 5 history api doesn't exist. It does and SPAs can do all that.
Why I hate your Single Page App
101–110 of 128 posts
Re: Why I hate your Single Page App
#102> Maybe your single page app is different, but the ones that I know break most of my browser’s features, such as the back and forward buttons, page refresh, bookmarking, sending a link, or opening a link in a new window or tab. My SPA is different - https://www.seasonalfoodguide.org . Browser back button works like normal. Each screen has its own discrete URL, so you can share links, refresh, bookmark or open in a ne…
This actually illustrates his points. Which is this: the browser(s) ALREADY implement all of those features. It already knows forward and backward and new tabs and link and etc. etc. etc. SPA's completely ignore these and must re-implement everything. This means: * choppy differences between different SPA * when new browsers come out with new navigation features, guess what, you have to reimplement them! * Extra javascript code * Extra bug opportunities * What if a user keeps your page open so long that you change JSON? I have seen my wife keep a tab opened for weeks....
I guess this is just my DRY training kicks into overdrive, but reimplementation of well-tested, well-proven patterns really doesn't smell right. Which was his point.
Re: Why I hate your Single Page App
#103Earlier quoted context omitted.
When you click a link or button on a normal website, the browser doesn't give indication on the ongoing state of your http request either. Only a javascript-enhanced experience can do that. Clicking on a save button and seeing the page hang is the normal way browsers handle http requests. But a javascript-enhanced experience can tell users about the local perception of the http request (ongoing, timeout, retry, error…
Most browsers at least show a spinner somewhere, do they not?
Re: Why I hate your Single Page App
#104Earlier quoted context omitted.
Since we're talking about poorly implemented features. Why I hate your SPA: - If I click on a link, I receive no indication that I actually clicked a link, then 2-10 seconds later the page abruptly loads. Sometimes the page doesn't load at all. - I cannot tap and hold a link, wait a second for the pop-up menu, and open the link in a new tab because the link isn't actually a link. It's implemented in JavaScript. - The…
Just to be clear, that is a poorly designed SPA, none of that should be happening and is easy to avoid.
Re: Why I hate your Single Page App
#105Earlier quoted context omitted.
Middle clicking works great, so I am happy! Mice need at least 5 buttons anyway. Right click and open in new tab also works. I always forget about ctrl-click since I never use it, odd that it doesn't work given how well everything else does!
Middle-click is not working for me either in Firefox.
Re: Why I hate your Single Page App
#106Earlier quoted context omitted.
- If I mis-enter information into a form, your error handling forgets all my information and I have to re-enter it. Even when I was coding web pages in Perl in the 90's I wouldn't do that to a user, that's just mean. You don't need a SPA to provide proper error handling that also rebuilds previous state.
Sadly there is a major e-commerce provider in my niche which does exactly that - routinely forgets all my information. In fact sometimes their web form just forgets things for no reason. There is no competitor in sight because of the huge huge SEO juice they have built over 15 years.
But it's not THAT inconvenient!
Re: Why I hate your Single Page App
#107> Maybe your single page app is different, but the ones that I know break most of my browser’s features, such as the back and forward buttons, page refresh, bookmarking, sending a link, or opening a link in a new window or tab. That reminds me: if anyone out there has any advice how to make AppCache play nice with JavaScript-based routing solutions (say, react-router), please let me know.
Re: Why I hate your Single Page App
#108> Maybe your single page app is different, but the ones that I know break most of my browser’s features, such as the back and forward buttons, page refresh, bookmarking, sending a link, or opening a link in a new window or tab. That reminds me: if anyone out there has any advice how to make AppCache play nice with JavaScript-based routing solutions (say, react-router), please let me know.
Are you using AppCache for compatibility reasons? If yes, my condolences. If no, just use Service Worker. If you don't want to write it yourself, use sw-precache.
Re: Why I hate your Single Page App
#109> Maybe your single page app is different, but the ones that I know break most of my browser’s features, such as the back and forward buttons, page refresh, bookmarking, sending a link, or opening a link in a new window or tab. My SPA is different - https://www.seasonalfoodguide.org . Browser back button works like normal. Each screen has its own discrete URL, so you can share links, refresh, bookmark or open in a ne…
The back button normally preserves scroll position. Your site takes me back to the top of the list.
History transitions are especially jarring in Safari. It optimistically restores the viewport state, so at first the page appears to be loaded but doesn't respond to clicking or scrolling. Click events register before the page is repainted, so the user can end up on the wrong page. After that, the list appears to jump to the top.
As other people have mentioned, some ways of opening a new tab work, and others don't.
> Once it's loaded there's no faster way to traverse a website, IMHO.
In my experience, this is almost never true. SPAs are good for some kinds of interaction, but traversing collections of resources is what web browsers are designed to do, and they do it pretty well.
The author's criticism is that people often build SPAs based on theoretical benefits and don't recognize or don't put in the effort to fix the practical shortcomings.
Re: Why I hate your Single Page App
#110Earlier quoted context omitted.
Are you using AppCache for compatibility reasons? If yes, my condolences. If no, just use Service Worker. If you don't want to write it yourself, use sw-precache.
I was trying to support Safari, yes. But maybe I should just give up on that.