gitpoint / git-point

GitHub in your pocket :iphone:
https://gitpoint.co/
MIT License
4.72k stars 788 forks source link

Discussion - Move to Redux Actions + Reselect #520

Closed alejandronanez closed 6 years ago

alejandronanez commented 7 years ago

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!!!

machour commented 7 years ago

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.

alejandronanez commented 7 years ago

@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.

machour commented 7 years ago

@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 ;)

alejandronanez commented 7 years ago

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.

machour commented 7 years ago

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

alejandronanez commented 7 years ago

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 .

jglover commented 7 years ago

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/

machour commented 6 years ago

@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

jglover commented 6 years ago

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.

machour commented 6 years ago

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