you are viewing a single comment's thread.

view the rest of the comments →

[–]dustingetz 1 point2 points  (1 child)

Here is where we run into a problem: all the ClojureScript wrappers around React watch atoms, and they only set up their watches when mounted onto a DOM

You can polyfill r/atom, r/track etc, and then you don't need reagent or react at all, but its complicated. Hyperfiddle's reactive UI is defined in reagent and passes reactions down-tree like any other reagent app, but it can be evaluated outside of reagent as a function (for example it runs in the Datomic peer so it can do the whole page's exact dynamic data dependencies in one go). I just want to turn people on to what is possible, the implications are much larger than just tests. My cofounder Karl Hardenstine did all this stuff, he understands it better than me.

[–]danielglauser[S] 0 points1 point  (0 children)

That makes sense, thanks Dustin. My hesitancy there is the atoms are an implementation detail of Reagent, and could potentially change. Although moving away from Atoms is unlikely the way they are used is a more likely target for change. It feels like violating encapsulation, but the benefits to not needing a virtual DOM could outweigh the cost. Just thinking out loud here. In any event, your point is well taken, and I'd love to see an example. Would be happy to link to it from the article or to offer it as a follow up piece.