Skip to content

Comment on I made a better DOM morphing algorithmparent

Comments

The server would keep a copy of the virtual dom during the session. Each change would be diffed and the diff sent to the client to apply. The client would only apply apply changes from the server, not change the dom on its own, so they wouldn’t get out of sync.

I can render to html, but then I’d need to parse the html back do diff it. Seems stupid.

I tried building a redux-style spa like that. Worked fine. https://github.com/geon/server-side-spa/tree/main/src/server

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.