On 22/12/2014 00:34, Mike Haney wrote:
Personally, I would have a hard time justifying Angular for new work, 
especially if it's a commercial project.  Given recent announcements from the 
devs, you are left with a choice of using the 1.x versions, which will not be 
compatible going forward, or planning around the 2.x release which won't be 
released until next fall.  Neither of those are acceptable for commercial 
projects, which makes Angular dead in the water at the moment.  For personal 
projects, sure, but then you have to consider if that's really where you want 
to invest your time?

I'm not sure exactly why you require some comprehensive framework, so I'll give 
a few options based on different requirements.  First, if you're looking for 
something with 2 way data binding, so you can slap components together and call 
it a day - well, React isn't really designed for that anyway.  There are of 
course many frameworks out there that do that kind of thing, with Ember 
probably being the leader now that Angular has committed project suicide.  I'm 
not really sure how much Clojurescript brings to the table in that case - it's 
going to depend on your project.  If you need complex coordination with 
back-end systems, then core.async brings a lot to the table, but you will be 
doing a lot of interop with a framework like Ember that wants to be in charge 
of everything.

You stated a preference for React, so you probably see the benefit of a 
reactive/functional UI model, so you're probably more interested in native 
integration or look and feel.  For integration, Cordova has you covered in most 
cases with their plugins.  For look and feel, there are lots of libraries out 
there with mobile widgets - jQuery mobile, Kendo, ChocolateChip, Clank to name 
a few.  Just use Clojurescript and React for the bulk of your app and integrate 
widgets from other libraries as needed.  This is no different than say, 
dropping a D3 chart into your app.

What I have found is that often I can just use the HTML/CSS for a widget and 
easily replace their JavaScript with my own React component.  Bootstrap is a 
good example - I never include the bootstrap.js file because most of the 
components I need can be easily replicated, often times as simply as toggling 
various css attributes on various nodes.  Scanning through the source code or 
even just observing the DOM as you interact with the component will usually 
tell you all you need.

For more complex components, just integrate them.  There have been several blog 
posts on integrating things like D3 charts with Om, just google it.  If you 
prefer Reagent (as do I) there are several examples of integrating third party 
components in the reagent-cookbook project (although they use jQuery to select 
the DOM node in all the examples, which I don't like, but they're useful as a 
starting point).  Reagent also makes it pretty easy to integrate regular React 
components now (not sure about how to do this in Om, or if it's even possible). 
 The community of React components is starting to grow, either as native 
replacements or convenient wrappers around existing libraries, and even though 
those don't use Clojurescript, at least they follow the React model and are 
suitable to drop into your app without worrying about an impedance mismatch.


I've chosen to go with Om or Reagent not as simply another tool alongside Angular, jQuery, Ember etc. but as a fundamentally different approach to mobile app development so I don't see how it's possible to just "drop in" Angular, jQuery, Kendo or whatever non-React-ive toolkit as required. My head is hurting enough already getting to grips with Om so the thought of mixing it up with a mutable state toolkit isn't an option.

The reason I need a comprehensive framework is because rewriting Backbone, jQuery Mobile, Ionic or Foundation-App is not an option for me. I want to make my life easier, standing on the shoulders of giants, not bake everything myself. For mobile development a smart looking widget toolkit is essential but the best ones at the moment are tied to Angular and jQuery I think. I may be wrong but I don't think mixing and matching Angular and Om is as easy as you suggest. Additionally, adding Angular to Om + ReactJS + app code + widget toolkit is going to be too heavy for decent mobile performance.

I'm not sure how Cordova solves anything as it's function is only to give web apps access to some native features and add a bit of performance. It doesn't address the problem of using non-React-ive widget toolkits with Om/React. I guess it's just a bit early in the day for all this and I'm sure a ReactJS-compatible toolkit will emerge soon.

gvim






--
Note that posts from new members are moderated - please be patient with your 
first post.
--- You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to