4 ms·
> 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, boo
by ordinaryperson 9y ago
> 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 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 new tab, just like any other website.
I think the criticism here is misguided. The problem is not with SPA as an architecture, it's with SPA devs not implementing features that end users are accustomed to on a website. They can all be added, it just takes effort.
The biggest valid criticism to SPAs IMHO is the initial site load. There are ways to mitigate (CDNs, progressive loading, compression, etc) but pound-for-pound SPAs probably have longer initial load times on average for the first page than a vanilla HTML site does.
Once it's loaded there's no faster way to traverse a website, IMHO.
- strken 9y ago> My SPA is different - https://www.seasonalfoodguide.org https://www.seasonalfoodguide.org. This app is a good example of one of my pet peeves: ctrl-click doesn't reliably open links in a new tab.
- com2kid 9y agoMiddle 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!
- mnarayan01 9y agoMiddle-click is not working for me either in Firefox.
- com2kid 9y agoWorks fine in both Edge and Opera (Hah!) on Windows 10. :) It doesn't work in Internet Explorer though. No FF on this machine to test out unfortunately.
- Sohcahtoa82 9y agoWorks fine for me in Chrome on Windows 10.
- flukus 9y agoMiddle click works for me but there is a noticable delay after the page loads until the content loads. That wouldn't be there with plain html.
- Nagyman 9y agoDitto, CMD+Click is borked (OSX, Firefox nightly) While the rest functions very well, this is case-in-point ... it's difficult to re-invent app use cases that browser vendors generally take care of. Edit: Printing is also borked it seems, whether or not that's a use case for your audience is another question.
- com2kid 9y ago> My SPA is different - https://www.seasonalfoodguide.org https://www.seasonalfoodguide.org. That is an incredible website. It is amazingly responsive and fast, I couldn't tell it was an SPA because of how well it behaves in every possible way, yet it is far too responsive to be anything but an SPA. Even as someone who cooks a lot, using the site doesn't come naturally to me, my typical shopping method is to go to the store and think up of what I want to cook as I stroll around the outside picking up fresh food. Or I put recipes from blogs into a shared family OneNote section and use that to do more directed shopping. That said, the links off of the food pages are high quality, with very good info on what to do with each item, so I try and spend some time exploring the resources you've put together!
- Washuu 9y agoBroken for me. I am middle clicking to open in a new tab and Javascript is forcing it to open on the current page. Additionally, the page is blank except for a background image when Javascript is turned off.
- mnarayan01 9y ago> They can all be added, it just takes effort. This, in combination with the fact that developers don't take the extra effort, is exactly what the article is complaining about.
- virtualwhys 9y ago> My SPA is different Only one data point, but 15 seconds to load here. After that, yes, everything is, as advertised, snappy.
- deleted 9y ago[deleted]
- anamexis 9y agoThe problem arguably is with SPA as an architecture. The problem is not that SPA devs are not implementing these features, it's that the devs are responsible for implementing them in the first place. As other people have noted, even though you have gone through great lengths to make your site work as expected, "open in new tab" does not work. These are browser features, and devs shouldn't have to worry about implementing them.
- magice 9y agoIt's an incredible website! But it still does not work completely "right." For example, the back and forth buttons don't navigate to the correct scroll locations. 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.
- pseudalopex 9y agoYour pages load quickly in Chrome, but not in Safari or Firefox. 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.
- ino 9y agoThe prev page history shenanigans in safari happen often and they are very infuriating. It happens to me multiple times daily on HN alone!