4 ms·
>Sudenly everything needs to be SPA, every site needs to load hundreds KBs of scripts just to "be current". Not everything has to be an SPA, but React is 30kb
by scottmf 9y ago
>Sudenly everything needs to be SPA, every site needs to load hundreds KBs of scripts just to "be current".
Not everything has to be an SPA, but React is 30kb gzipped and Preact et al are in the single digits.
>What's the value of being modern if it makes user experience objectively worse?
The point is they don’t inherently make user experience objectively worse.
>Sure client side render may prevent you from reloading the entire page. And who cares that this rerender actually takes longer than reload?
This isn’t how it works. Rerenders can be incredibly fast.
>Did I really need to waste 200KB of my mobile data to load scripts all I wanted to see were 5 pages each weigthing 5KB? What did I gain from trading full reload for the a-la-SPA kind of deal?
What did you lose? You lost nothing because SSR provided the initial page load as quickly as any other HTML.
It sounds like you’ve generalized the entirety of modern SPA development from your experience of a few terribly developed sites with poor user experience.
You probably only notice the poorly-built SPAs because the UX gets in the way. i.e., confirmation bias.
- RobertRoberts 9y ago>You probably only notice the poorly-built SPAs because the UX gets in the way. i.e., confirmation bias. Maybe you are too young to remember Youtube before it was turned into a webapp. It was _considerably_ faster. Todays version requires all sorts of odd refreshing bits and pieces. The old one just loaded right away and showed the video. If I was paranoid, I'd think that Google did it on purpose to push Youtube Red ads at us.
- boubiyeah 9y agoAgreed youtube as a webapp brings no value whatsoever. Someone at google wanted to rewrite it with newer techs to update its CV? :) PS: It downloads that crappy polymer that weights more than 1.5MB... ffs
- Nemi 9y ago> The point is they don’t inherently make user experience objectively worse. Ah, but they do. Browsers are very mature and predictable in their management of html pages and SPA's break that behavior in subtle, uncanny-valley ways. For instance, click into the Sapper HN page https://hn.svelte.technology/item/16052558 https://hn.svelte.technology/item/16052558, scroll down to a post with a random link and click into it. Click on another page in that link. Now click the back button in your browser to get back to the sapper page. You find that you will be at the top of the page as it re-renders. You lose the place you were scrolled to. This does not happen with standard cached html pages in the browser. One of the worst offenders is google's home page. When clicking into the links looking for something, clicking back will take you to top, again and again, losing your place. This is a big step back in usability that people are not even aware is happening. It is a small thing individually, but in aggregate it adds up to a large thing.
- rich_harris 9y ago> You find that you will be at the top of the page as it re-renders. You lose the place you were scrolled to. What browser is that happening in? In Chrome it works correctly — Sapper uses `history.scrollRestoration = 'manual'` for this exact reason, but maybe it fails elsewhere? It's a bug, and we should fix it. (This is pre-1.0 software, your forbearance is appreciated.)
- Nemi 9y agoWay late on this reply, but it was in chrome. I found that an immediate back button would often work, but if the page you were navigating to was overly large or you clicked into another link or two and then went all the way back it would lose place.