Re:Application Architecture with React: Rethinking Flux
by rymohr on Monday September 14, 2015 @05:38PM
(#10217678)
Your approach sounds interesting. Ever write about it?
The undo / redo gains of ImmutableJS quickly vanish when you're working with remote data and the leaked getters aren't fun. A little UUID juggling is worth it if it allows my components/reducers to work with plain old javascript objects and still get fast shouldComponentUpdates.
Re:Application Architecture with React: Rethinking Flux
by guscost on Tuesday September 15, 2015 @08:59AM
(#10220354)
It's one of the ideas for shouldComponentUpdate that I wrote about here, but it's not described in a lot of detail:
http://guscost.com/2015/05/27/react-js-and-flux-ideas-for-pr...
One of these days I'll put up another piece on Flux/React, and an example application to demonstrate an approach that doesn't have a lot of dependencies (not even ES6, for example).
Also I have not run into any pitfalls using ImmutableJS yet apart from the extra overhead, so thanks for the heads up.
For my purposes this optimizes at least as well as ImmutableJS, and there is no overhead from loading and using a dedicated library. However it does require extra boilerplate and manual updates to version tags each time something changes, and it can cause confusion if you forget to update a version tag or accidentally update the wrong one. Anyway, it is one alternative, but if you don't have a compelling reason not to use ImmutableJS for optimization I'd probably go with that. Of course it is perfect for undo/redo functionality too if that is a requirement.