As a developer with good hands-on AngularJS experience, how do I adjust my mental model of writing web apps in Flux using React?
I'm not looking for a Flux+React vs Angular answer (already plenty of that online), but I would like to know what are the biggest differences in the two "mindsets": beforehand, I was introduced into The Angular Way; comparatively, what is The React Way ?
As I leave the Angular universe and transition to Flux, what are the key things I need to start paying attention to?
Differences first, and now similarities: AngularJS is very opinionated and had some very big no-no's, like - don't put UI/DOM code in controllers. What are the big no-no's and opinions of React?
Last but not least, Facebook refers to Flux as an alternative to MVC, but as I am looking at it - React is the view engine, stores are model containers focused on a single domain, and the dispatcher and actions form a controller. So isn't this actually MVC with a different name?
I'll let others do the compare/contrast with Angular, but here are some answers to two of your questions.
So isn't this actually MVC with a different name?
The presence in Flux of a separation of concerns between the data/logic layer and the view layer does not make it MVC. Many other patterns have a similar split, most notably CQRS, arguably Flux's closest cousin. There is no controller in Flux, in the MVC sense. The Actions and Dispatcher do not amount to a controller. The Controller-views are close, but are actually quite limited in their controller-like aspect. A key difference is that MVC controllers contain application logic and act upon models. Flux stores, by contrast, contain all the application logic and have no setters.
As I leave the Angular universe and transition to Flux, what are the key things I need to start paying attention to?
Key values of Flux:
Key concepts in Flux:
waitFor()
method. This allows one store to wait for another store's response to an action before moving forward with its own response.Primary parts of a Flux application:
Overview, in depth: http://facebook.github.io/flux/docs/overview.html
Tutorial: http://facebook.github.io/flux/docs/todo-list.html
Examples: https://github.com/facebook/flux/tree/master/examples
Actions and the Dispatcher: http://facebook.github.io/react/blog/2014/07/30/flux-actions-and-the-dispatcher.html
Testing: http://facebook.github.io/react/blog/2014/09/24/testing-flux-applications.html
More out in the wild: http://facebook.github.io/react/blog/2014/10/17/community-roundup-23.html