Abstract out the socket connection of @redux-devtools/app to allow other communication methods #1653
Closed
matt-oakes
started this conversation in
Ideas
Replies: 3 comments 4 replies
-
I'm not the primary maintainer here, but that does sound like a reasonable suggestion, yeah! |
Beta Was this translation helpful? Give feedback.
4 replies
-
I have opened a PR with the changes discussed #1655 I will close this discussion now as any comments can be left on the PR itself. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Firstly, thank you for your work on the debugger. It's an invaluable tool for working with Redux.
Problem
I mainly use Redux in non-web scenarios, such as in React Native (through Expo) or Electron apps. Currently it is a bit complicated to use the Redux Devtools as you can't just use the extension. The main way to do it currently is using the "remote" option. This works fine, but it's a bit complicated to set up and brittle if you need to also run a local server through the CLI.
Possible usecases
My ideal solution would be to use
@redux-devtools/app
with a different way to connect it to the store instead of the socket cluster library.In the case of Expo, this could be using their Dev Tools Plugin infrastructure which is essentially a web socket connection that Expo manages to make the connection between the Expo app (which could be running on a simulator or physical device) and the dev tools web page (which would be some sort of customised
@redux-devtools/app
). There's an open discussion about adding support for this.For Electron this could be using IPC to communicate between the main process (in my case this is where my Redux store lives) and a renderer (which could be displaying the Redux Devtools app).
Possible solution
This would be possible now using the lower level packages, but I beleive that you would end up duplicating a lot of the code in
@redux-devtools/app
.It would be great if there was a way to swap out just the
socketcluster
part of@redux-devtools/app
and replace it with something specific to each environment. I beleive this would be main replacing the API middleware as that seems to be the only part that directly deals with the socket connection.Potentially this could be the creation of a
@redux-devtools/app-core
package which allows you to pass in the API middleware you want to use and@redux-devtools/app
would be changed to just use this core with the middleware forsocketcluster
, as it does now.My question is, does something like this make sense? I would be happy to look at the implementation of this, but as it's a fairly big change I wanted to start a discussion before starting to work on it. I don't really want to maintain a fork of the devtools so having something you would be happy to merge in would be best.
Thanks again!
Beta Was this translation helpful? Give feedback.
All reactions