Git-point: Discussion - Move to Redux Actions + Reselect

Created on 20 Oct 2017  ·  10Comments  ·  Source: gitpoint/git-point

Hey all!
I'd like to get your feedback about start migrating our actions/reducers to redux-actions and reselect. Here's a PR I created a while back to the organizations actions/reducers.
I think this is a good move, we will reduce our boilerplate greatly and will let us organize our application in a more elegant and legible way.

If we decide that this is a good move, I can update the docs and will create a list similar to what @andrewda did for the unit tests in #518

https://github.com/gitpoint/git-point/pull/269

Thanks!!!

discussion question refactor tech debt

Most helpful comment

Normalizr and reselect can massively reduce the amount of transformation and prop manipulation, and thus re-rendering done. But nicer still, Github released v4 of their API with GraphQL support, so you can retrieve a normalised well-shaped response right out of the gate, may be worth looking at: https://developer.github.com/v4/

All 10 comments

I don't think it makes sense to change the way we access the store, while the store itself is broken by design. We'll be just changing the paint on a cracked wall.

I've been pulling a lot of thinking into this ( #457 ) and would appreciate to have the chance to continue in this direction, as it would lead us to no boilerplate at all, while fixing the store design and enabling us to add new API requests in an easy manner.

@machour will your PR touch every piece of the store? I remember talking about it and I think it will touch some parts but not everything.

@alejandronanez it would completely modify all the store architecture.

Whenever you have 30mn~1hour, I'll be glad to do a 1 on 1 with you to walk you through the changes, I'm sure you'll like what you see ;)

Oh I'm glad you decided to close that huge PR and split it into small pieces, that will make things easier 👍 !
FWIW I think redux-actions can integrate with what you have in mind and the same goes for reselect.

  • redux-actions will reduce the boilerplate when you want to dispatch something and will help us reduce some code from the reducers.
  • reselect is a better way to query the store.

I'll try reselect and see how to ease objects retrieval with it, looks nice!

redux-actions on the other hand isn't really needed as reducers are already really simple and all the dispatching is done in a single point for all actions (the proxy).

I'll open the new simplified PR shortly to move forward with this

Sounds good! Thanks!
On Fri, Oct 20, 2017 at 10:31 AM Mehdi Achour notifications@github.com
wrote:

I'll try reselect and see how to ease objects retrieval with it, looks
nice!

redux-actions on the other hand isn't really needed as reducers are
already really simple and all the dispatching is done in a single point for
all actions (the proxy).

I'll open the new simplified PR shortly to move forward with this


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/gitpoint/git-point/issues/520#issuecomment-338240790,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAcYUrrJFrY4mebcjetw_bg0HkKmciQcks5suLzrgaJpZM4QAISi
.

Normalizr and reselect can massively reduce the amount of transformation and prop manipulation, and thus re-rendering done. But nicer still, Github released v4 of their API with GraphQL support, so you can retrieve a normalised well-shaped response right out of the gate, may be worth looking at: https://developer.github.com/v4/

@jglover we have some on-going discussions/PRs about GraphQL: #141 #455 #347
The idea for now is to mix both GraphQL & Rest in the future

That's great, in which case I definitely support reselect and normalizr for REST based work. Much less transformation then, schemas are also loosely akin to interfaces in Typescript and I think that kind of transparency into the request/response models is a great help.

Closing this issue as we started a massive refactoring of our Redux store.
More details in #761

Was this page helpful?
0 / 5 - 0 ratings

Related issues

housseindjirdeh picture housseindjirdeh  ·  5Comments

Antoine38660 picture Antoine38660  ·  3Comments

jouderianjr picture jouderianjr  ·  5Comments

housseindjirdeh picture housseindjirdeh  ·  5Comments

alejandronanez picture alejandronanez  ·  5Comments