yes, that's a good way to put it. i provided default dom representation for the most common data types, so i can just directly render them, but later customize arbitrary parts of the data by turning those parts into records and implement a render function them
I haven't actually designed it, I just built it as a need has arose for a feature.
You can see its evolution was just about 4 steps:
and then i came up with the
Elem protocol with the
render method idea to keep the data and its visualization connected but as loosely as i could possibly think of:
i had some mirthil experiments last year, but i dropped it after about 5-10 minutes because when i was editing text in an input field rendered by mirthil, the cursor was jumping to the end of the input text, but not in every browser as if the whole input element has been recreated. then i tried some hoplon and react examples and none of those had issues with the same browser... but their state management story is not the best either, so i moved on...
ah, sounds like its not fully baked
Another interesting thing I've been looking into a little bit: https://github.com/nyxtom/reconcile.js. Let's you diff/apply diffs of regular js elements
seems pretty performant and easy to use in my initial experiments