4 ms·
This is an excellent list, thank you. To answer some of the points: Sapper supports partial streaming of server-rendered HTML (typically you'll get most of the
by rich_harris 9y ago
This is an excellent list, thank you. To answer some of the points:
Sapper supports partial streaming of server-rendered HTML (typically you'll get most of the <head> while it's fetching data for your page, unless there's no dynamic data in which case you get the whole lot instantly).
I'm not convinced there's actually a benefit to 'server' rendering in a service worker as opposed to serving a shell page. We have an issue for it though! (https://github.com/sveltejs/sapper/issues/22 https://github.com/sveltejs/sapper/issues/22)
Sapper supports prefetching (including of dynamic data) of subsequent pages — just add rel=prefetch to <a> elements (we'll add a programmatic way to do this in future as well).
As for the rest, some of it is app-specific, some of it is stuff the framework could help with. We're not at version 1 yet, so bear with us :)
- deno 9y agoIt should be “free” with the right architecture, and it should be faster, that’s why I included it for the “perfect” framework list. However, it’s only a win on first page load on a subsequent visit. So definitely not a priority for an actual implementation. BTW one easy way to implement this would be to flip the usual model: 1) Have service worker/server as main renderers 2) On navigation do a fetch to service worker and patch the page So you’re on /main, do fetch to /page2?from=state and get patching instructions. If you could give the service worker readonly access to DOM without copying this wouldn’t actually be that stupid. It might be possible some day: https://github.com/whatwg/dom/issues/270 https://github.com/whatwg/dom/issues/270