zustand
zustand copied to clipboard
Support all devtools features
Redux devtools has many more features that we have not implemented yet. For example this tracing feature. The full list of features is here. This will require looking into the (actual) redux's middleware/enhancer's source to see what needs to be done to have these features (and if we can even have them in zustand or not).
Putting it out there in case someone's interested, I might look into it when I have time.
- [ ] #926
It feels like we should focus on v4 and work on this after that, unless this introduces any breaking changes. That said, in the meantime, I'm more interested in this for valtio's devtools and jotai's useAtomDevtools.
The trace property seems to be mostly working already, just that Zustand isn't typed to accept it. I've put up a PR to allow the trace option to be passed.
I have noticed one problem with this, where a callback passed in for trace will not receive the action as an argument. I'll look into that and address it in a future PR. But for now, just allowing the option to be passed gets us much of the value.
We tried supporting the trace feature in https://github.com/pmndrs/valtio/issues/331 (PR: https://github.com/pmndrs/valtio/pull/380) but as mentioned, there's an issue in redux devtools trace API (https://github.com/reduxjs/redux-devtools/issues/1100), so I guess we can ignore the trace feature for now if possible, and work again on it in case the trace API works again.
#926 is related, right?
The trace feature is really great for debugging, I would to see it available 🙂
Closing this as not actionable. #1200 covers all configs (and #1991 is a better fix). The trace feature would be nice, but it's blocking. Let's create a new issue once https://github.com/reduxjs/redux-devtools/pull/1369 is published.
If there are other features to support, please open a new discussion.