OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

ui: alternative for global state management for app wide data

Open Sachin-chaurasiya opened this issue 1 year ago • 3 comments

NOTE: THIS IS NOT A BLOCKER FOR ANY RELEASE

At present, React Context is employed to manage globally utilized data in our application. However, this method presents challenges as we need to maintain separate contexts for different data, which becomes increasingly unmanageable as the application expands. To address this, we will adopt Zustand for handling global state.

Zustand is a lightweight, swift, and scalable state management solution. Its straightforward API, built on hooks, provides ease of use. While it maintains clarity and flux-like behavior, it avoids excessive boilerplate or imposing specific opinions.

image

Majorly we have to replace these contexts with zustand

  • [x] AuthContext https://github.com/open-metadata/OpenMetadata/pull/15082
  • [x] ApplicationConfig Context https://github.com/open-metadata/OpenMetadata/pull/15082
  • [x] GlobalSearchProvider https://github.com/open-metadata/OpenMetadata/pull/15804
  • [x] DomainProvider https://github.com/open-metadata/OpenMetadata/pull/15804
  • [ ] ApplicationsProvider @karanh37

Sachin-chaurasiya avatar Feb 05 '24 05:02 Sachin-chaurasiya

Let's start using Zustand for globally stored data for the application

chirag-madlani avatar Feb 07 '24 08:02 chirag-madlani

Can you list down the places where we need to implement this? I will review it so that we can plan it better

chirag-madlani avatar Feb 07 '24 08:02 chirag-madlani

Can you list down the places where we need to implement this? I will review it so that we can plan it better

Yes @chirag-madlani , I have updated the description, thanks

Sachin-chaurasiya avatar Feb 07 '24 10:02 Sachin-chaurasiya