Re:Show HN: Sapper.js – towards a better web app framework
by rich_harris on Tuesday January 02, 2018 @01:29PM
(#16054018)
What about when you start clicking the links in the nav, or opening other stories and profile pages? As far as I can see, the Sapper version blows the original out of the water.
Re:Show HN: Sapper.js – towards a better web app framework
by lassejansen on Tuesday January 02, 2018 @03:40PM
(#16055405)
The Sapper version is cheating a little. It is preloading the pages on mouseOver events of the links.
Re:Show HN: Sapper.js – towards a better web app framework
by DougWebb on Tuesday January 02, 2018 @06:32PM
(#16056936)
It's not just cheating a little. Just moving the mouse around the page causes lots of data to be downloaded behind the scenes; you could end up loading every story on HN without ever leaving the Top list. That's not friendly to user's data plans, and it's very far from expected browser behavior.
Re:Show HN: Sapper.js – towards a better web app framework
by rich_harris on Tuesday January 02, 2018 @07:25PM
(#16057253)
It's configurable. Add rel=prefetch to an <a> element and you'll get that behaviour; don't, and you won't. Since the links are small, mousing over them tends to suggest you intend to click them, but the exact behaviour is subject to refinement over time (this is pre-1.0 software, adjust your expectations accordingly).
Incidentally, 'cheating' is a bit of a silly word to use for a feature designed to improve UX that people spend a lot of time trying to implement (see e.g. http://instantclick.io/)
So basically the added complexity gives you the same load time when done extremely well (as Sapper is). In terms of bang for your buck, the service worker is biggest improvement. Which you can implement in your server-rendered app.