6 ms·
Do you use Om with React? If so, do you have an opinon on it vs. Backbone, Angular, etc.?
by thomasvarney723 12y ago
Do you use Om with React? If so, do you have an opinon on it vs. Backbone, Angular, etc.?
- grayrest 12y agoI've used Om and it works but the cljs ecosystem only really started up in December when Om came out and everybody discovered React. I don't use/recommend Clojurescript outside a Clojure shop because frontend skillset+clojure is extremely rare and you do have to do everything yourself. If you have a Backbone app, replacing your Backbone views with React is a pretty substantial win. The Backbone app structure works best if you can just listen for a change event and run your model through template code and slap it into the DOM but that gets complicated if you want to nest views, the DOM you're replacing has state, or you have something like jQuery UI widgets. All these issues simply go away if your view code is React and everything just works. I don't find the Backbone abstractions too useful so I've only done this personally when consulting and wanting to make the minimal set of changes to the codebase. I was using Angular for two years before I switched over to React. React basically replaces directives and for that use it's simpler, composes just as well, and scales better for both data size and dom node count. Replace the Angular DI stuff with browserify/webpack and Jest and there's not that much left. The main reason to use Angular would be if you want to take advantage of the Angular ecosystem or if you plan on focusing mainly on directives to support a bunch of designers since non-directive Angular is super simple. For other stuff, the main benefit in a two way databinding framework (or virtual DOM diffing) is that you can isolate your business logic from the DOM. That's the major win and everything else is pretty much taste. The React approach results in the least amount of state in my code by a fairly significant margin so I consider it the best but having different preferences is completely reasonable.