@ngrx/signals: Add support for Redux DevTools #4040
Replies: 4 comments 12 replies
-
I like the idea and it's possible to implement this plugin. However, we don't plan to have it in the core package. The main reason is that Angular Devtools will most likely provide support for signals, so we'll be able to track I'm going to convert this issue to a discussion. |
Beta Was this translation helpful? Give feedback.
-
love it. |
Beta Was this translation helpful? Give feedback.
-
I disagree with @markostanimirovic that a general overhaul of the Angular Devtools for signals would be as beneficial, as a direct integration into the Redux Devtools would be. There is also no easy way to add the functionality from outside. There is a withDevtools from the ngrx-toolkit, but it fails miserably to track method changes. However it does show the slice/store in the state tracking, which is already a huge help. I took a crack at improving withMethods tracking, and made some success ( will edit this answer and post my hacky solution for anyone interested tomorrow), but tracking which method caused a state change is incredibly hard for rxMethods:
The best approach, in my opinion, would be to fully integrate the devtools tracking into the main signal store. With 100% precision on which method caused the patchStates. It would require a context to be tracked for each rxMethod, and will probably take some time to implement. One of the 3 main reasons that I advise collegues to use ngRx is the good DevTools integration, as it literally cuts the time to track down inconsistencies in half in larger projects. |
Beta Was this translation helpful? Give feedback.
-
For the ngrx-toolkit, we would require direct access to The toolkit has an |
Beta Was this translation helpful? Give feedback.
-
Which @ngrx/* package(s) are relevant/related to the feature request?
store
Information
One of the most requested features that was missing in the Component Store was its integration into DevTools. The SignalStore, unlike the global store, doesn't have a single state either.
To address this, I propose introducing an option called withDevTools(name: string). This option would define the "feature key" of the Store and determine how it appears in the DevTools.
If the name is used multiple times, it should be automatically indexed. For example, withDevTools('user') would result in entries like user(1), user(2), and so on.
Furthermore, I suggest adding an optional parameter to the $update function that allows developers to set the name of the action. If this parameter is omitted, the SignalStore should use the function's name as the action name. For instance, in the example below, the action name would be “addUser”.
Example:
If accepted, I would be happy to provide an initial PR.
Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
Beta Was this translation helpful? Give feedback.
All reactions