Open SujayDas1999 opened 8 months ago
Yes @SujayDas1999, Thank you for opening this issue, we can aim for RTK query, and we can aim for the latest and minimalistic state management, because using redux will be an overhead for application of this small scale, Interested to know your thoughts if you are open to working on this.
I would suggest to use Zustand/Recoil since the code effort will be way less than using RTK query. It is simple & and minimalistic.
Zustand :- https://zustand-demo.pmnd.rs/ Recoil :- https://recoiljs.org/
Please let me know your thoughts on this.
[Edit] Apologies for the confusion. But I believe that RTK Query is used for querying the API. In this enhancement I am talking about plain state management like having a centralized state which will be accessible to all components irrespective of their relation for which we have to use Redux Took-Kit (since you are looking for a minimalistic approach). Should we be using both RTK Query + Redux Toolkit combined ? Or just RTK Query ?
Okay sounds interesting, Can we discuss about this in the discord... Once we agree to an approach we'll go with that
Hi @krishnaacharyaa please let me know when we can connect on discord
Hi @SujayDas1999 , I have messaged in the discord kindly look into..
Hi @krishnaacharyaa, I would like to add Redux Toolkit.
Hi @theEdgeBreaker Actually after multiple iterations we wanted to go with zustand, can you please let us know what is the adv and dis of redux toolkit and zustand from there we can pick this
Hi @krishnaacharyaa, Reason for Redux is that it has larger and robust community and we can get more people contributing later if needed in Redux as compared to Zustand. If someone is working in this project for learning then they'll be more demanding in Industry as Redux is used in Large scale projects which hires people. Ultimately some day this project might also grow. I can pick any of them but in case of Redux Toolkit, I can finish the setup in few days time.
@theEdgeBreaker Thank you for the detailed opinion and thinking about the future contributors... Yeah all the points you said are really vaild, but here, why we were thinking of zustand is ... The project in the future scope even won't scale to the extent that we have to use redux and it creates too much boilerplate for a simple blog application and might make people anxious by seeing it as it's aimed for new people to dive in and learn MERN and to understand the not soo complex project....
So for the present scenario and even for the foreseeable future we wouldn't want to use redux as the project won't go that crazy complex... So we can go with the trending zustand, which is robust as redux but reduces the very much boilerplate of redux and can handle even if the project scales ...
So we came to this discussion of using zustand.... This would be a rather decent change aimed to simplify the things than complicating it ....
You might ask,Why do we need state management afterall? It a simple app working just fine without it, it is simple the way it is... Answer is because of the bug https://github.com/krishnaacharyaa/wanderlust/issues/98 Which can be handled by state management... Aggreed we can also solve it using localstorage.... But thought it would be nice to have decent state management to handle this ...
Hi @theEdgeBreaker May I know if you wanna take this up? I'll assign it to you....
Hello @krishnaacharyaa, Yes you can assign me this, I want to work on it.
Sure @theEdgeBreaker, let us work on the MVP and as mentioned let's try to resolve the bug which I mentioned in the previous comment....first and then let's see if there is any further scope....
Hi @theEdgeBreaker , may i know the update on this, and how much further time it would roughly take ?
Hi @krishnaacharyaa, I used Zustand but the bug wasn't resolved, so I'm trying another approach. I'll give you updates today
@theEdgeBreaker raise PR, let's see... I guess we can solve that without state management, one guy is working on it,
Hi @theEdgeBreaker, the issue is solved here https://github.com/krishnaacharyaa/wanderlust/pull/116#pullrequestreview-1968755303, Pardon me, I haven't actually went through that, Now I am just wondering what will be the scope of using State management as Zustand now karke... Do you have any take on this?
Hi @krishnaacharyaa, I don't think Zustand played any role in this, so I'll look into another one to address.
Yeah exactly @theEdgeBreaker .
"so I'll look into another one to address."
Didn't get you
I'm just wondering now, why we need zustand as simple as the question gets !
@krishnaacharyaa, I'll take another issue to solve, Probably issue #70.
@theEdgeBreaker Sure, Just let us know the appraoch before implementing
@theEdgeBreaker Were you able to find some issue worth contributing?
Description
I have been going through the react code and I have an enhancement suggestion. Instead of using use state, can we migrate the application to use a centralized state such as Redux/MobX/Recoil ?
Current Behavior
The jsx files uses use state hook. There is no centralized state.
Proposed Enhancement
To implement Redux like centralized state management system.
Use Case
To implement Redux like centralized state management system by which a state can be used my multiple components without using props or drilling down props (if props are required).
Blockers
No response
Additional Information/ Attachments
No response