I’m running into this issue when developing my structural editor in Nyxt. There are some attribute of the DOM that I would like to depend on some other attributes of some other DOM elements or Lisp objects in general, reactively.
I see that there are two way to achieve this. Either by coding some hooks manually (e.g.
change-children-hook), or through an existing dataflow extension like
cells which do all the things under the hood.
The latter approach looks much nicer, but it requires more changes to existing code (replace
defmodel). Also, one thing that strikes me is that inside
plump itself, the parent-child relation is maintained using the former approach. If we still reuse plump DOM then we will have to have an inconsistent mix of both approach.
Or we could write our own DOM classes similar to plump model but using cells (and using CLOS ofc). We will also have more control over it. I’m not a fan of plump’s hash-table per node and using string everywhere. It also won’t be terribly lots of effort – plump/dom’s CLOS hierarchy is like 50 lines of code. @aartaka what do you think?