Hacker News new | past | comments | ask | show | jobs | submit login

Let me add a different point of view. The adoption of React in the world of ClojureScript was pretty much instantaneous and total. I don't think anybody writes ClojureScript webapps in any other way these days. But the way React is used is different: it's used as a smarter mapping from application state to DOM. Clojure and ClojureScript programmers already know how to manage state and limit its spread, React (plus the usually tiny adapter libs) was just a way to efficiently produce DOM renderings of that state.

It fits like a glove. And while it's not all roses, there are fewer friction points it seems than in JavaScript (but then I think JavaScript programmers don't have it easy anyway). Plus, because of the nature of ClojureScript, most articles I read about optimizing React performance do not apply to me, because all the hard work has already been done for me (for example, immutable data structures mean that you can efficiently prevent re-rendering if data hasn't changed).

Anyway, to sum this up with an example that I'm basing my opinion on: PartsBox (https://partsbox.io/) is something I wrote, using React.




Do you have any links/resources for using React with ClojureScript?


There are a couple Clojurescript interfaces to React: Om (https://github.com/omcljs/om) and Reagent (https://reagent-project.github.io/) are two I'm familiar with.

For an example of how a Clojurescript project would be built using these libraries, I'd recommend checking out re-frame: https://github.com/Day8/re-frame


Easy 3 step process:

1. Assuming you have leiningen installed, run `lein new figwheel hello-world -- --reagent` and follow the instructions in the output

2. Follow along with https://reagent-project.github.io/

3. Enjoy a nice, refreshing beverage.


One point about libraries: I would recommend starting up with Reagent, as it has a simple and fairly intuitive model, and then moving on to Rum, which allows you to do anything, while being small and elegant.

I do not recommend Om for starting.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: