Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flux+React vs Backbone+React [closed]

What are the advantages of Flux+React over Backbone+React. Are there any performance differences in addition to the code development ease for a huge complex code base.

What if we have a 1:1 relation between the model and a react view in a application that uses Backbone+React ?

like image 684
Student Avatar asked Mar 02 '15 16:03

Student


People also ask

Do people still use Backbone JS?

Backbone. Backbone has been around for a long time, but it's still under steady and regular development. It's a good choice if you want a flexible JavaScript framework with a simple model for representing data and getting it into views.

What is flux React?

What is flux. Flux is a pattern for managing how data flows through a React application. As we've seen, the preferred method of working with React components is through passing data from one parent component to it's children components. The Flux pattern makes this model the default method for handling data.

Is Backbone JS frontend or backend?

Front-End MVC frameworks (Backbone, Angular, etc) all rely on a backend service to provide the data that, say Backbone, would then use as its model. You could have an entire MVC pattern on the backend that accepts requests and spits out some JSON for a frontend MVC framework to use.

Which building block of flux is used to grab the updated state from the store?

Node's event emitter is used to update the store and broadcast the update to view. The view never directly updates the application state. It is updated because of the changes to the store. This is only part of Flux that can update the data.


1 Answers

Flux is an architect pattern to build React application. So you can use Backbone models and collections inside your stores to fetch and store data.

And if want to use just React's Virtual DOM feature, there is no need to use react.js. There are a lot of libraries, adding Virtual DOM feature to your application (https://github.com/Matt-Esch/virtual-dom).

My recommendation: if you will use Flux pattern I strongly recommend you to use http://facebook.github.io/immutable-js/ (may be coupled with http://ampersandjs.com/; don't forget to define your custom sync function if you are building isomorphic application). Basically there are no any advantages using backbone models with React (backbone is heavy, it needs underscore, which is slow; I use https://lodash.com/ instead ).

like image 200
Vetrenko Maxim Avatar answered Sep 23 '22 13:09

Vetrenko Maxim