Root – recursive UI resolution

crosspost from r/clojure

I’m finally open sourcing my project root. It’s been in development since March 2019 with a few breaks to ponder its design. The goal of root was to make everything as stupid (read decomplected) as possible, e.g.:

  • root doesn’t know what state is
  • components don’t know where their data comes from
  • components also don’t know which children they’re rendering
  • root is renderer agnostic: using reagent instead of uix is a ~3 line code change (possibly here). Components are functions and can emit not just hiccup but anything.

It has a few more tricks up its sleeve such as automatic promise resolution (again components need not to know about “promises”), path annotations as root recurses through data which simplify state updates (used here to implement a generic AST editor) and more!

This is, of course, alpha software and, as such, subject to change.

Find docs and examples in the Github Repo.

Shout out to u/roman01la for being responsive and helpful and of course for making uix

2 Likes

This looks really cool. I wonder how it scales though

If you mean how it scales with bigger data, it should scale just as well or better than other apps.

in frontend apps that use technologies like graphql the data shape is determined by the UI component tree. In other words, data deps are conflated w/ rendering. In root you can create a data tree from queries separately from UI components, and let root traverse and dispatch from there.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.