Re:Use ReactJS to Build Native Apps
by doublerebel on Wednesday January 28, 2015 @07:51PM
(#8963664)
Yes pleaseeeee tell me I can take advantage of just the View layer and use my own Model and Controller setup. With Titanium views are 'just' JS objects, so I can use Spine, Backbone, and other libraries for business and data logic.
Re:Use ReactJS to Build Native Apps
by danabramov on Friday January 30, 2015 @08:44AM
(#8971927)
Um, you can do that in React just fine.
It's just you don't really need Backbone with React because plain object/array models are more convenient, and controllers aren't needed because there's no need to “orchestrate changes” between view and model. Check out Flux as an example of architecture (not a framework) that works really well with React.
Exactly. I once started a project with backbone and used React for the view layer. I quickly realized I didn't need the Backbone models and collections, and ended up only using the router and a few small other things. Eventually i replaced these remaining parts with some 'micro-frameworks' like lo-dash, page.js, superagent, etc.
mercury was fully decoupled from virtual-dom [0] (such that you can use virtual canvas or virtual-gl). Would be really nice if this stuff can be used by other libraries easily.
[0] https://github.com/Matt-Esch/virtual-dom
[1] http://elm-lang.org/
[2] https://github.com/Raynos/mercury