remote-redux-devtools
remote-redux-devtools copied to clipboard
Logging server-side actions
Hi @zalmoxisus! I am building a universal app that needs to support SSR. I wasn't sure from the documentation if this library would be appropriate for that?
Ideally, I am looking to get the actions logged on the terminal on the server to show up on the extension. So far in setting it up, it seems that the actions that execute on the server still get logged there and subsequent actions get logged on the extension.
Is that a problem with my setup?
Here is what my code looks like right now:
const composeEnhancers = composeWithDevTools({ realtime: true, port: 8000 });
//const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
store = createStore(
reducer,
initialState,
composeEnhancers(
applyMiddleware(...middleware),
persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
)
);
Thank for you all your work on all the extension tools!
Yes, the configuration is ok. Just make sure to open Remote DevTools in the extension:
![redux_devtools](https://cloud.githubusercontent.com/assets/7957859/20093189/67353da8-a5a4-11e6-82e0-de89bfd51d8d.png)
Strange that persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
doesn't through on server side.
Hm.. I removed persistState
to see if that helped, but still no luck. It seems that the actions that execute on the server still get logged there and subsequent actions (which occur on the client side) get logged on the extension.
FWIW, the remotedev looks like this -
→ npm run remotedev
> [email protected] remotedev /Users/anuj/Github/shuffle-web
> remotedev --hostname=localhost --port=8000
[RemoteDev] Start server...
--------------------------------------------------------------------------------
[Busy] Launching SocketCluster
[Active] SocketCluster started
Version: 5.0.18
WebSocket engine: uws
Port: 8000
Master PID: 62891
Worker count: 1
Broker count: 1
Is there a particular piece that I start by debugging? Any guesses on what might be going on?
Is there a particular piece that I start by debugging? Any guesses on what might be going on?
You can start with our simple node example to see how it works. Add your port here. Also note that the example uses an old version of remote-redux-devtools
. If you update it, and still use CommonJS, make sure to add .default
here.
You can start with our simple node example to see how it works.
@zalmoxisus that example works just as fine. Is it possible that SSR doesn't work in my case since the request is client-initiated? Or do you suspect some other problem?
@oyeanuj, if you could provide an example repo, I'd look into it. Maybe you just didn't set the port on Remote Devtools windows's settings? You could try without adding port parameter so it will communicate via our remote server (as in the example).
Maybe you just didn't set the port on Remote Devtools windows's settings? You could try without adding port parameter so it will communicate via our remote server (as in the example).
Tried both methods but same result :(
It is a little hard to replicate the repo I am working on, but I will try to provide some example repo where this can be reproduced.
(If not, maybe a screenshare or something could also work if you have the bandwidth? No worries if that is asking for too much time!)