3 ms·
Hi Marius. This looks neat, the only big worry I have is about the custom protocol and virtual DOM patching. Do you have thoughts on what it’d take to use plain
by jhardy54 3y ago
Hi Marius. This looks neat, the only big worry I have is about the custom protocol and virtual DOM patching. Do you have thoughts on what it’d take to use plain HTML over the wire instead?
- toomim 3y agoCan you explain why you'd want plain HTML over the wire? 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.
- jhardy54 3y agoOh neat! I worked on Secure Scuttlebutt, so this is right up my alley. I’ll check out your RFC drafts, thanks for the tip! 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.
- toomim 3y agoVery cool! I resonate with those values! 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.
- mondrian 3y agoThanks! I need to do more research on the available HTML over the wire protocols. In principle Hyperdiv can easily send HTML strings instead of its custom JSON format.
- jhardy54 3y agoCool! Is there somewhere I can learn about the custom JSON format? Its possible that I’m just wary because I’m unfamiliar.
- mondrian 3y agoIt’s not explicitly documented yet. I should do that. 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