Open ankushdharkar opened 2 years ago
I am half way done with the RFC. Do we have a wiki page or notion where I can put it?
I am half way done with the RFC. Do we have a wiki page or notion where I can put it?
put here itself
About managing all state effectively in the React Native app, in such a manner that performance and DX are good without it needing to be over-engineered. What is state? Data that can mutate over time and needs to be stored in app. There are two kinds of state, server cache (data being stored in DB but also being stored in UI for better UX) and UI state (data which is stored and used only in the UI, theme, isLoading, isConfirmModalOpen, etc.).
Options:
Problems to solve:
React Query v SWR:
There won't be any changes in the UI. UX however, will be consistently good due to lower chance of performance issues.
Whatever option is selected must be enforced by maintainers and reviewers in order to maintain consistency and sanity. Also, new developers must be introduced to the particular pattern we decide to follow.
none
@ankushdharkar @shreya-mishra, did you have a chance to look at the RFC? If you find it to be exhaustive pertaining to the issue, then might we go ahead and have a discussion with some other members and start executing?
@sakshambhatt let's discuss it at @10pm today if you are available.
@ankushdharkar , what will be the next steps for this issue? Creation of data model, data flow is separate issue than state management, right? Will we be asking people for their comments on the above doc?
make our own external store and link it using useSyncExternalStore
?
Instead of using a library like zustand/Redux.
Use Jotai as the state management library to handle UI state. It can be a good solution when we start integrating different functionalities (modules) like goals, members site, status site as it allows us to create atoms that can be specific to each module & if we want to keep our state within our component tree.
Sharing a link from Jotai's official site comparing Jotai and Zustand as they can be very similar when compared from the outside. https://jotai.org/docs/basics/comparison
Approach 5
Let's start with the Redux saga or Justand and implement the other management library and just compare which one is better, as RDS is all about learning, implementing, breaking, and rebuilding things.
How would we measure and compare the performances of these different approaches?
How would we measure and compare the performances of these different approaches?
how about testing the following metrics?
Ankush has suggested to search for all the references related to state management in React Native app on the internet. Post that, we would ideally pick the strategy that is standard across the industry. If we are not able to find good resources, that is an opportunity to write blogs on it.
@ankushdharkar , found one good blog https://tech.groww.in/simplifying-state-management-with-zustand-redux-saga-vs-zustand-12006a9f55de
Redux team has been advising against Sagas generally... https://twitter.com/acemarke/status/1618630292520177668
@sakshambhatt assigned to you!