-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Managing state on our React Apps #18
Comments
I think redux for small projects is not cool, just as context for large projects is not cool either. I have enjoyed using state machine in personal projects, would be happy to see a greater adoption within the company. |
For large apps that aren't in our current stack:
For apps using graphQL:
|
Apollo Client, since 2.5, has been focusing on client state support. I was pretty up-to-date on their efforts when I presented one DemoFriday (starts at 11:50) about client state, but right know I've been only reading their blog announcements. But, even then, I thought that their solution was pretty complete, specially if your state need match in some way your server data |
I think it's really hard to define the right solution for an app. Also I'm afraid doing this will hinder developers from exploring new solutions. Maybe we should focus on what people should avoid, based on what we learned. |
@klzns I don't know, then why we force React as an UI library if exploring new solutions is the goal? We have patterns on VTEX, we should at least have a guide with recommendations on each case. We still have to choose a way to make reusable components where the state manager doesn't matter if we are going this way of choose the best depending on each case. On our Redux approach every component don't depend on Redux, only on it's props to do logic (or depending on the context is ok also), we should enforce this to always be true |
What do you think we get more practical like the example you said? Example:
Rational: do this because of that, etc. Something on this line. What do you think? |
@klzns Yes, we should add TODOs to create this kind of stuff |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
What is to be discussed?
When the app is little to medium size:
Should we use hooks with useReducer or even only a state being passed from a root component by props to the children or even by context?
For large apps:
Should we use redux and it's middlewares?
For apps using graphql:
Should we only use apollo with it apollo-link-state
Describe the solution you'd like
I think the solution depends on the app. I personally like redux a lot and would still use it for medium and large apps (didn't mixed it up with apollo client to really understand the problems with that).
But for small apps would only use hooks but again:
Should we:
The text was updated successfully, but these errors were encountered: