5 ms·
Yes, this. I about fell out of my chair reading this paragraph. In these discussions, I find defendants of these SPA designs to almost always point to vague po
by the_gastropod 6y ago
Yes, this. I about fell out of my chair reading this paragraph.
In these discussions, I find defendants of these SPA designs to almost always point to vague points about "rich UI" or "highly interactive", or make up complete hypotheticals like this example of pre-loading likely-to-be-clicked links. Show me the code. Show me the crazy-fast link-click-predicting website that does this and loads faster than, say, HackerNews.
It's good to see the pendulum swinging back to some semblance of sanity on this topic. The past ~5-10 years of the SPA being the default choice has been a wild time. I couldn't be happier that it's starting to receive some widespread criticism.
- rich_harris 6y ago> Show me the crazy-fast link-click-predicting website that does this and loads faster than, say, HackerNews. https://hn.svelte.dev/ https://hn.svelte.dev/ is a Sapper implementation of Hacker News. It uses the preload-on-hover/touch technique described in the article. In my experience it does indeed feel faster than Hacker News, despite basically being something I threw together one weekend
- krapp 6y agoWow. It loaded the 1000+ comment Ask HN thread "What's your quarantine side project?" in less than a second for me. I've seen HN itself choke on smaller threads.
- rich_harris 6y agoUpdate: since posting this it looks like the site is being hugged to death — might need to upgrade something in GCP :) Either that or it's a coincidental problem with https://api.hnpwa.com/v0/ https://api.hnpwa.com/v0/
- robertoandred 6y agoNooo!! You're going against the JS BAD narrative! Stop that right now!
- the_gastropod 6y agoCredit where credit is due: this is excellent work! Very impressed.
- fleddr 6y agoThe funny thing is that a single module inclusion in a traditional link based website will deliver all of this predictive preloading for you. One line of code. Which debunks one of the critical advantages of an SPA. The other is transitions. Which are never implemented because it's just too damn hard. Instead you get a spinner, 17 API requests (instead of 1 Ajax request), and a giant fragment of the DOM replaced whilst you lose your scroll position.