The CSS problem

"Are you keeping a graph of the widgets? " Yes. My Web/MX library, like all Matrix (my state manager) libraries keeps a tree of objects, each a proxy for, in this case, a DOM node.

DOM events act on the proxy tree, which then writes back to the DOM.

" what does the cF macro do?" It defines a “formulaic Cell” that manages whatever property it is associated with. Where the formula (standard CLJS code) reads another Cell, a dependency is established so changes to one Cell know what other Cells to notify.

“If you are using react, doesn’t it do that already?” Web/MX wraps HTML/CSS directly, so it knows in this case it just needs to update the class and style attributes. React regenerates and diffs VDOM, sees what turns out differently, then makes those updates. Less efficient, but ironically the React team now explicitly rejects the reactive paradigm, because they see advantages to controlling updates themselves, and reactive libs update eagerly.

1 Like