Gathering detailed insights and metrics for remote-redux-devtools
Gathering detailed insights and metrics for remote-redux-devtools
Gathering detailed insights and metrics for remote-redux-devtools
Gathering detailed insights and metrics for remote-redux-devtools
npm install remote-redux-devtools
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,805 Stars
268 Commits
139 Forks
26 Watching
3 Branches
20 Contributors
Updated on 23 Sept 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
3.6%
4,598
Compared to previous day
Last week
-7.5%
25,667
Compared to previous week
Last month
18.6%
111,168
Compared to previous month
Last year
-26.2%
1,219,099
Compared to previous year
6
This package was renamed to
@redux-devtools/remote
and merged intoredux-devtools
monorepo. Please refer to that repository for the latest updates, issues and pull requests.
Use Redux DevTools remotely for React Native, hybrid, desktop and server side Redux apps.
npm install --save-dev remote-redux-devtools
Note: for Windows use
remote-redux-devtools@0.5.0
(newer versions will not work due to a Windows issue fixed inreact-native
).
There are 2 ways of usage depending if you're using other store enhancers (middlewares) or not.
If you have a basic store as described in the official redux-docs, simply replace:
1import { createStore } from 'redux'; 2const store = createStore(reducer);
with
1import { createStore } from 'redux'; 2import devToolsEnhancer from 'remote-redux-devtools'; 3const store = createStore(reducer, devToolsEnhancer()); 4// or const store = createStore(reducer, preloadedState, devToolsEnhancer());
Note: passing enhancer as last argument requires redux@>=3.1.0
If you setup your store with middlewares and enhancers like redux-saga and similar, it is crucial to use composeWithDevTools
export. Otherwise, actions dispatched from Redux DevTools will not flow to your middlewares.
In that case change this:
1import { createStore, applyMiddleware, compose } from 'redux'; 2 3const store = createStore(reducer, preloadedState, compose( 4 applyMiddleware(...middleware), 5 // other store enhancers if any 6));
to:
1import { createStore, applyMiddleware } from 'redux'; 2import { composeWithDevTools } from 'remote-redux-devtools'; 3 4const store = createStore(reducer, /* preloadedState, */ composeWithDevTools( 5 applyMiddleware(...middleware), 6 // other store enhancers if any 7));
or with devTools' options:
1import { createStore, applyMiddleware } from 'redux'; 2import { composeWithDevTools } from 'remote-redux-devtools'; 3 4const composeEnhancers = composeWithDevTools({ realtime: true, port: 8000 }); 5const store = createStore(reducer, /* preloadedState, */ composeEnhancers( 6 applyMiddleware(...middleware), 7 // other store enhancers if any 8));
In order not to allow it in production by default, the enhancer will have effect only when process.env.NODE_ENV === 'development'
.
For Webpack you should add it as following (webpack.config.dev.js
):
1// ... 2plugins: [ 3 new webpack.DefinePlugin({ 4 'process.env.NODE_ENV': JSON.stringify('development') 5 }) 6], 7// ...
In case you don't set NODE_ENV
, you can set realtime
parameter to true
or to other global variable to turn it off in production:
1const store = createStore(reducer, devToolsEnhancer({ realtime: true }));
Use one of our monitor apps to inspect and dispatch actions:
Cmd+Ctrl+Arrow up
) to open remote monitoring.Use remotedev-app to create your own monitor app.
Use remotedev-server cli to run it locally in order to make the connection faster and not to require an internet connection.
You can import it in your server.js
script and start remotedev server together with your development server:
1var remotedev = require('remotedev-server'); 2remotedev({ hostname: 'localhost', port: 8000 });
See remotedev-server repository for more details.
For React Native you can use remotedev-rn-debugger, which already include remotedev-server
.
Name | Description |
---|---|
name | String representing the instance name to be shown on the remote monitor. |
realtime | Boolean specifies whether to allow remote monitoring. By default is process.env.NODE_ENV === 'development' . |
hostname | String used to specify host for remotedev-server . If port is specified, default value is localhost . |
port | Number used to specify host's port for remotedev-server . |
secure | Boolean specifies whether to use https protocol for remotedev-server . |
maxAge | Number of maximum allowed actions to be stored on the history tree, the oldest actions are removed once maxAge is reached. Default is 30 . |
actionsBlacklist | array of actions to be hidden in DevTools. Overwrites corresponding global setting in the options page. See the example bellow. |
actionsWhitelist | array of actions to be shown. All other actions will be hidden in DevTools. |
actionSanitizer | Function which takes action object and id number as arguments, and should return action object back. See the example bellow. |
stateSanitizer | Function which takes state object and index as arguments, and should return state object back. See the example bellow. |
startOn | String or Array of strings indicating an action or a list of actions, which should start remote monitoring (when realtime is false ). |
stopOn | String or Array of strings indicating an action or a list of actions, which should stop remote monitoring. |
sendOn | String or Array of strings indicating an action or a list of actions, which should trigger sending the history to the monitor (without starting it). Note: when using it, add a fetch polyfill if needed. |
sendOnError | Numeric code: 0 - disabled (default), 1 - send all uncaught exception messages, 2 - send only reducers error messages. |
sendTo | String url of the monitor to send the history when sendOn is triggered. By default is ${secure ? 'https' : 'http'}://${hostname}:${port} . |
actionCreators | Array or Object of action creators to dispatch remotely. See the example. |
shouldHotReload | Boolean - if set to false , will not recompute the states on hot reloading (or on replacing the reducers). Default to true . |
shouldRecordChanges | Boolean - if specified as false , it will not record the changes till clicked on "Start recording" button on the monitor app. Default is true . |
shouldStartLocked | Boolean - if specified as true , it will not allow any non-monitor actions to be dispatched till lockChanges(false) is dispatched. Default is false . |
id | String to identify the instance when sending the history triggered by sendOn . You can use, for example, user id here, to know who sent the data. |
suppressConnectErrors | Boolean - if set to false , all socket errors thrown while trying to connect will be printed to the console, regardless of if they've been thrown before. This is primarily for suppressing SocketProtocolError errors, which get repeatedly thrown when trying to make a connection. Default is true . |
All parameters are optional. You have to provide at least port
property to use localhost
.
Example:
1export default function configureStore(preloadedState) { 2 const store = createStore( 3 reducer, 4 preloadedState, 5 devToolsEnhancer({ 6 name: 'Android app', realtime: true, 7 hostname: 'localhost', port: 8000, 8 maxAge: 30, actionsBlacklist: ['EFFECT_RESOLVED'], 9 actionSanitizer: (action) => ( 10 action.type === 'FILE_DOWNLOAD_SUCCESS' && action.data ? 11 { ...action, data: '<<LONG_BLOB>>' } : action 12 ), 13 stateSanitizer: (state) => state.data ? { ...state, data: '<<LONG_BLOB>>' } : state 14 }) 15 ); 16 return store; 17}
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 9/25 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More