Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save myguidingstar-zz/cd03194d6ddbb04ab69a to your computer and use it in GitHub Desktop.
Save myguidingstar-zz/cd03194d6ddbb04ab69a to your computer and use it in GitHub Desktop.

Labeling React-based libraries

Facebook's React javascript library has recently got a lot of interest from Clojure community. Everyone is talking about it. There are many Clojurescript wrapper implementation out there, one by one even confuse newbies more about which library should they choose.

Looking at Reactjs directly doesn't help. Facebook brings PHP's scary "model, view and controller - all in a single line of code" with their JSX syntax. And the style adopted by the major of Javascript community is floating around with boilerplate code. Effort on Reactjs itself returns to "simple-minded" FP developers more frustration than insight.

Well, so why many Clojurescript implementations? It's the paradigms taken by authors that makes them different:

  • Reagent is more Functional Reactive Programming

  • Om is more Object-oriented

  • Quiescent is more functional

I recommend learning Om first. Best documented of the three and it forces you to understand React's component life cycle from the very first step (Headache ahead!)

My concerns

Reagent has a beautiful API but I think it's hard to maintain many (r)atom instance in large apps. Real apps also require implementing more cycles than just render. In such case, Reagent looks worse than Om. Also, as Reagent abstract you away from the underlying behaviors, once update events are too noisy (it's quite popular) they'll cause performance hit.

Om is the most stable. The design of its 'cursor' helps focus on each component's data and behaviors. I think Om is more a framework than a library. For instance, Om plays all roles in a Flux application. Though David had a gist1 for Om + Datascript, I don't find such combination make sense.

Quiescent is the least opinionated. You just give it updated version of your data and it will render all for you in a 'top-down' way. You control your data - you can use core.async and datascript for example.

I have a good experience with Om (not so good with learning it ^^ A long list of mistakes like this2) but still feel missing something from the two others. Or I want some more freedom...

Enters Rum

Then Rum appeared. Still not popular (less than 200 starred on Github

  • compared to 3500+ that of Om) but the experience is great. I can construct my app whatever I like. Use all Clojurescript features and tools to express your mental model of the problem. Write exactly how you want your components behave (mixins).

Rum is definitely my new love <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment