Git-point: PoC for Immutable - Reselect

Created on 30 Jul 2017  路  10Comments  路  Source: gitpoint/git-point

I'm creating this issue to keep track of the PoC with Immutable + Reselect, will add those to a small part of the app to see what everybody thinks.

assigned backlog enhancement has pr

Most helpful comment

We have a PR for this in #269

All 10 comments

Looking forward to it matey, any help please don't hesitate to ask :raised_hands:

Out of interest: what do you mean with "Immutable"? Immutable.js?

Wondering whether that's really necessary when already utilizing redux, which embraces immutable data structures, but with the plain vanilla js data types.

馃憤 for reselect

@zcei Yes I meant Immutable.js, with it we can have some nice _models_ + will be forced to manage immutability (no risk of mutating the state at all)
Redux needs immutability but there's nothing stopping you from mutating the state.

Mhm I like the idea of clearly defined models, just never saw the purpose of putting more overhead on top of the plain types. But yeah, it puts more responsibility on the contributors.
(Otherwise one would likely put its own layers on top, like joi schema validation.)

Thank you for the clarification!

You're welcome @zcei, we'll see how it goes.
Does Joi enforce Immutability? I have no experience with it.

The joi objects and methods themselves are immutable, but I don't think they enforce it on the objects that are checked. That was more for the "clearly defined model" part.

If you're really scared people would mutate the state, in development one could freeze the state tree (which for performance reason should never be a production middleware 馃檪 ).

I'm just afraid that Immutable.js actually makes it harder for people to contribute and feels like an "eternal lock in" as now each and every piece of the app (except for the presentational components) needs to be aware it is not receiving a plain object, but a special wrapper.

I also feel the same with introducing a library like Immutable.js hence why I was hesitant at first as well. However definitely open to giving it a shot if everyone feels like the benefits of including it outweigh any potential concerns.

I'm sure we at least use something of my work on this haha ;)

We have a PR for this in #269

I definitely think Immutable.js adds a layer of safety in a project of this size. I think the benefits (Immutability + clearly defined records) we gain from this outweighs the slightly increased complexity for new devs. For the most part React handles Immutable objects pretty well, without conversion to plain JS.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Antoine38660 picture Antoine38660  路  3Comments

cheshire137 picture cheshire137  路  3Comments

randy3k picture randy3k  路  5Comments

housseindjirdeh picture housseindjirdeh  路  5Comments

gulien picture gulien  路  5Comments