Analysis of Flux implementations

Ad

I'm studying the react ecosystem, I came from the AngularJS world and I have no idea which flux implementation should I use...

Can anyone explain what's the best, considering that I love the MV* structure of angularjs (1x)?

I'll appreciate focus on:

  1. Differences between them
  2. Goals
  3. Learning Curve
  4. Usage Sharing
  5. Testability
  6. Scalability
  7. adherence to new standards (both in terms of ES6 and WebDevelopment Trends)

I found many resources but I still have many doubts!

Thanks in advance

Ad

Answer

Ad

I've been using for new project AltJS and to be honest, I love it.

2, 4 - It is pretty fancy due to the "usage sharing" (if I understand what you meant by that correctly). You create "logic" and "pure (dumb)" components which later on can be used plenty of times (there is no point to create identical view but with a different logic, so you simply "pick other store" for the same "pure" component"). Also it can easly track other Stores states, use many Stores at once in one component thanks to AltContainer (you definetly should try AltJS with AltContainer) and use actions from one store, while the other store gets updated (bindListeners).

3 - About learning curve, well I would say it is pretty easy to understand whole concept. It would literally take you at most one day to understand whole idea. Ofcourse there are more complex stuff involved there as well, but there always are some more complex stuff in other libraries as well.

5 - You can easily test actions and stores (there is even an example of that on their page) using "AltTestingUtils". You can also mix with with Chai or any other assertion library you are using. So that's pretty good I would say

6 - well wasn't whole idea of Flux about "scalability" as well? If we consider that AltJS is probably one of "purest" implementation of that, then I would say it should be pretty well in that. So far I can say that it is working for me well (though it is hard to see the future, cause right now it ain't that big). Though there are some tools to improve performance if problems with scalability would appear (for example, AltContainer does have shouldComponentUpdate).

7 - Whole AltJS was done to work in ES6, at least they say so (and I use it like that as well)

While alt examples encourage ES6 and alt was built with ES6 in mind it is perfectly valid to use plain old JavaScript instead.

I made a post about AltJS some time ago in other topic, you might find it helpful

https://stackoverflow.com/a/34256824/5538090

Ad
source: stackoverflow.com
Ad