...
This is awesome! I've been working on a projectional lisp editor lately, and I've been thinking how the approach to visualising AST and then transforming it from the UI components could be generalised to handle any type of data/UI - like visual bi-directional lenses - it's great to see something like this alive - can't wait to dig in!
This looks interesting. What I understand so far is how root does does data-driven graphical display. But UIs also require interaction leading to state updates. There is such interaction e.g. in the Notion clone, but I don't see how it works.
Konrad Hinsen look at the top of the source for the notion-clone code. root wraps some data-declared events and dispatches them to a transaction function. You should be able to find it, the source is quite small: only two files, really. root.impl.core and root.impl.resolver contain most of the functionality.
one caveat, I’ve currently disabled the auto-wrapping of event-handlers because it led react to re-render on anonymous handler-fn-redefinitions (no function equality). However, I realized this is easy to fix with: https://github.com/reagent-project/reagent/blob/ea42671d832be77acabe012df6386cd5d34d5ac1/src/reagent/core.cljs#L348-L351