Skip to content
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

Remove deprecated code of zustand #144

Closed
rtritto opened this issue Jan 10, 2023 · 4 comments · Fixed by #250
Closed

Remove deprecated code of zustand #144

rtritto opened this issue Jan 10, 2023 · 4 comments · Fixed by #250
Labels
bug Something isn't working

Comments

@rtritto
Copy link
Contributor

rtritto commented Jan 10, 2023

Console output:

[DEPRECATED] zustand/context will be removed in the future version. Please use `import { createStore, useStore } from "zustand"` for context usage. See: https://github.com/pmndrs/zustand/discussions/1180
[DEPRECATED] default export is deprecated, instead import { create } from'zustand'

Related migration guide:

@pionxzh pionxzh added the bug Something isn't working label Jan 11, 2023
@mashirozx
Copy link

I wonder, this lib is expected to be a simple component plugin to display JSON view, so there is no need of global state management lib. In my use case, I didn't use zustand lib in my project (I use others instead), and the import of json-viewer result in the useless zustand lib in my project build bundle. Can we consider remove the zustand lib and use react's original methods like context provider to replace that?

@pionxzh
Copy link
Collaborator

pionxzh commented Feb 3, 2023

I will look into it. I agree that we might not need a state management tool here.
I just checked the size of zustand is 1.1kb. And jotai is 2.3kB.

@rtritto Are you still working on #167?
I will also need some of your input and comments on this 🙏

@rtritto
Copy link
Contributor Author

rtritto commented Feb 3, 2023

@rtritto Are you still working on #167?

No, I'm still locked.

We can try to remove the store manager in favor of native React functions. Maybe there are some reasons to introduce the store manager in json-viewer v1.

First we need to analyze current use cases (related to behaviors of hooks, states, render, re-render etc) with jotai ones.

@pionxzh
Copy link
Collaborator

pionxzh commented Mar 7, 2023

We got rid of the annoying deprecation message in v2.14.1. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants