One of the things I didn't realize at first was the degree to which Relay/GraphQL appear to effectively replace a lot of Flux: <a href="http://facebook.github.io/react/blog/2015/02/20/introducing-relay-and-graphql.html" rel="nofollow">http://facebook.github.io/react/blog/2015/02/20/introducing-...</a><p>Learning Flux sort of seems like learning how to drive stick shift on an '97 Civic while we wait for the new Tesla to arrive - useful, also a bit annoying. A central store architecture does seem a better match to what Relay will look like though.
Let's be real. It's 2015 and we need quite some hoops to get, in most cases, some very simple data rendered on the screen. And even with all those hoops, we are still not sure that it works in all cases. Isn't it time for better tools than react? Like functional languages that support incremental computation?
Great article. One thing I would like to mention is that using component state (this.setState) is <i>okay</i>! Central stores, and the flux architecture, are very helpful but if your state shouldn't persist after an unmount, there's no point in extracting to a central store and passing it through your entire app as props. (i.e. Whether or not a certain dropdown is expanded). Just keep that state local.
Has anybody in the client side community ever made the connection to rules engines?
This flow of logic is awfully close to how a rule engine works. I wonder if people will at some point arrive at it.<p>There isn't a whole lot of rules engine in JS. Just nools [1] which is huge. I'd love to see a very simple forward chaining rule engine + Immutable + React and see how that would work out.<p>My guess is that they aren't popular at all because they have the notion of being enterprisey (Drools/Jboss). I'm a big fan of them. They /can/ make life & code very nice and elegant. Maybe somebody writes an JS adapter to clara rules [2].<p>[1] <a href="https://github.com/C2FO/nools" rel="nofollow">https://github.com/C2FO/nools</a><p>[2] <a href="https://github.com/rbrush/clara-rules" rel="nofollow">https://github.com/rbrush/clara-rules</a>
Alternatively, there is a very similar example, including a talk, right from the source:
<a href="https://github.com/facebook/flux/tree/master/examples/flux-chat" rel="nofollow">https://github.com/facebook/flux/tree/master/examples/flux-c...</a>
<a href="https://facebook.github.io/flux/docs/chat.html#content" rel="nofollow">https://facebook.github.io/flux/docs/chat.html#content</a>
With PureRenderMixin, doesn't that also prevent child components from updating in response to state changes? For example if a child component must update due to some event, but none of its parents care about that event, doesn't that cause the child not to update?<p>Edit: Turns out my render methods aren't pure. I query stores right render, which causes problems when using this mixin.