Sam Gentle.com

Prototype wrapup #16

Last week I made 1 prototype, and this week I made 1 again.

Sunday

Operation record-and-playback continues. With the diffing out of the way I just had the simple task of just recording the changes to the document structure as produced by MutationObserver. This was not, as it turns out, simple. The API is clearly not designed to give you all the information you need to recreate an element. I had to do a bunch of extra things like recursively adding sub-elements because they weren't getting tracked sometimes. I still don't know how you're meant to record what order the elements were in. Copy and paste still breaks sometimes, but it's mostly working enough to make a demo where edits you make in one div are mirrored in another. I can see why the React philosophy is to just treat the DOM as a rendering target. Talk about nightmare fuel.