Live data from Hacker News

Why I hate your Single Page App

medium.freecodecamp.org

111–120 of 128 posts

Re: Why I hate your Single Page App

#111

> 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…

Your 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 ca…

The prev page history shenanigans in safari happen often and they are very infuriating. It happens to me multiple times daily on HN alone!

Re: Why I hate your Single Page App

#112
post #42

Earlier quoted context omitted.

You probably have never tried a classic HTML "app": 1. Every click is fetched and rendered faster than your javascript code has had a chance to execute, let alone fetch or render. 2. True, minor headache though compared to the vast improvements in usability. 3. Nope. 4. Nope, this is a bug - something javascript pages most certainly are not immune against.

You're basing a lot of this viewpoint on fast internet connections. Javascript code rendering will be faster if you have a slow internet connection and are using an updated browser with a fast javascript engine

From time to time I have to use 64kbps on my cellphone. At that point the biggest pain in the ass becomes first loading and in that classic HTML app shines, it loads a LOT faster - if you have 1.5MB page or 600kB makes a huge difference. But once it's all static content is cached it pretty much doesn't matter if it's XHR or full page load since I'm loading only tens of kBs at max.

Also if I have to use 64kb I completly disable js in my browser and whitelist just a couple of websites - best adblock on mobile.

Re: Why I hate your Single Page App

#113
post #29

+1000 The biggest things for me are probably the excessive amount of resources used, the long load times, how hard it is to get things "right" (like not breaking the back button) and links taking awhile to load because we have to load your stupid SPA (if they work at all). SPAs did win out big in one area though. On mobile. Except on mobile they're called "apps". As much as many HNers like to chafe against native mob…

"SPA" and "native" are not even remotely the same thing.

Re: Why I hate your Single Page App

#114
post #52

Earlier 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…

I think the prime directive of all UI should be, "Ack UI inputs immediately, no matter what else is going on." Throw up a spinner, make something throb, change a status to "loading", anything. Don't just go off and attempt to do it and hope for timely response.

Why can't the browser do this? I mean, it's a universal function / feature, right? And ultimately, it's the browsers that's waiting, not to application per se. (Yeah, I okay. But you know what I mean).

I can't think of any good reason why the browsers can't help out with this UI / UX. Am I crazy?

Re: Why I hate your Single Page App

#115
post #95

Earlier quoted context omitted.

Sorry for the cookies I meant the storing of whatever you were writing into a form and accidentally hitting back or navigating away from the page. Like in mobile leaving the browser and returning to it, sometimes for me it starts it over haha no, just empty your soul into an essay response, all gone. Probably soared the recipient. Interesting about the separate window, thought cookies could be set to never expire.

Oh, I see. For saving the form state, localStorage would work better than cookies for saving and restoring because then the information is only kept on the client. That still doesn't solve the multiple window problem, but that's likely less of an issue for a filling out a form than for navigation. Cookies can certainly be set to never expire, but you don't know which window the cookie was intended for because the coo…

I wasn't aware. Are you talking like HTML5? Haven't used local storage before. Thanks for the info.

Re: Why I hate your Single Page App

#116

Earlier quoted context omitted.

You're basing a lot of this viewpoint on fast internet connections. Javascript code rendering will be faster if you have a slow internet connection and are using an updated browser with a fast javascript engine

I actually prefer HTML over SPA apps on slower Internet connections. I've found SPAs to be more infuriating to use when the connection is bad.

Designing with intermittent connections in mind is a lost art, even the windows 10 start menu won't work properly with one.

Unfortunately connection are more intermittent now than ever before.

Re: Why I hate your Single Page App

#117
post #62
post #58

Earlier quoted context omitted.

> My SPA is different - 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.

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 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.

Re: Why I hate your Single Page App

#119
post #115

Earlier quoted context omitted.

Oh, I see. For saving the form state, localStorage would work better than cookies for saving and restoring because then the information is only kept on the client. That still doesn't solve the multiple window problem, but that's likely less of an issue for a filling out a form than for navigation. Cookies can certainly be set to never expire, but you don't know which window the cookie was intended for because the coo…

I wasn't aware. Are you talking like HTML5? Haven't used local storage before. Thanks for the info.

Yes, see Window.localStorage [1] and this short guide [2].

[1]: https://developer.mozilla.org/en-US/docs/Web/API/Window/loca...

[2]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage...

Re: Why I hate your Single Page App

#120
post #48
post #37

Earlier quoted context omitted.

How hard it is to get things right? It's not hard at all. It's builtin with frameworks like Ember or Angular, and for React you got react-router which does things correctly by default. It's just bad programming. I don't even understand why people would make an SPA without a url-router. Doesn't that just make development harder/more anoying? Why would links take longer to load in a SPA? CSS, Javascript and the like sh…

> My SPA's come in at around 120-130kb minified (no gzip). react-dom is just a touch bigger than that alone, fwiw

I know, react is pretty big. Preact is great if using Javascript, otherwise Elm is pretty awesome as well.
Post reply on HN