Comment by ptx
1 day ago
The example repo is a little confusing to me, since it seems to use client-side JS to demonstrate that it doesn't need client-side JS: "It bootstraps a service worker and [...] No client-side JavaScript!"
But I guess the point is that the code in the service worker could have been on the server instead?
The trick seems to be using a template element with a slot and then slotting in the streamed content at the end. But you could probably also do it using just CSS to reposition the content from the bottom to the top, similarly to how many websites handle navigation menus, assuming that the client supports CSS.
Doing it with css would only be visual positioning, so would have accessibility issues. Slotted content can have accessibility issues as well, but it is probably more solvable because screen readers will see it “slot in” at the right point in the document.