Post

Out-of-order HTML patching, another proposal from TPAC, lets HTML be presented non-linearly, and a single file can update multiple parts of the page. Would this feature be useful to you?

29 reposts143 likes

Yes. Please!! I tried to (ab)use custom elements and shadow dom to do this but it doesn’t actually work properly.

I’m happy to have it look like a hack if it works but it simply doesn’t work except for the most basic use-cases.

Yea we looked at the existing slot based solution for this and it seemed like putting cross-shadow concerns into the mix is too disruptive to most use cases. That's why we went with something stateless like a "patch" rather than an import/slot.

this is *very* close to a SSR hydration concept and while I welcome this feature as I think it's awesome for HN or X like streams (or chats or list-items, or ...) I wonder what happens if the page had an input in that <nav>, somebody started typing in it (a11y tools too) and that gets replaced ... 🤔

Of course. It's a low level tool that works in a certain way. I would expect that the library/framework/vanilla web app that uses this would only replace certain parts and retain those interactive stable parts.