I happen to be working on a standardized protocol (braid-http) for sending diffs over HTTP, and have been thinking about applying it to hyperdiv. I'd love to understand your use-case and what about plain HTML you like here.
Answering your question: it’s mostly the curmudgeonly tendency to avoid custom protocols that are harder to introspect and debug. It’s possible that the hyperdiv sync protocol is super intuitive and simple, but whenever possible I’d like to use boring web standards to reduce the surface area that I’ll feel the need to learn.
It also allows standard tools and front-ends to work with any back-end. We could have CDNs that can cache and sync dynamic HTML for a set of users without touching the server.
The dom sent over the wire is very similar to html but it’s json.
Then the diff is a json that indicates whether to add children and at which index, whether to remove children and at which index and how many, and attributes to update. This is the part I’m unsure of there being an analogue in protocols like htmx.
Easiest way to see it in action currently is to run a Hyperdiv app, open chrome dev tools and watch the websocket traffic on /ws