All Projects → zalmoxisus → Remote Redux Devtools

zalmoxisus / Remote Redux Devtools

Licence: mit
Redux DevTools remotely.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Remote Redux Devtools

React Performance Observer
Get performance measurements from React Fiber
Stars: ✭ 207 (-88.33%)
Mutual labels:  debug, devtools
Lightproxy
💎 Cross platform Web debugging proxy
Stars: ✭ 2,347 (+32.3%)
Mutual labels:  debug, devtools
Redux Devtools Extension
Redux DevTools extension.
Stars: ✭ 13,236 (+646.11%)
Mutual labels:  debug, devtools
debug.js
Debugger of JavaScript, by JavaScript, for JavaScript
Stars: ✭ 19 (-98.93%)
Mutual labels:  devtools, debug
Redux Remotedev
Redux DevTools for production (web and React Native) with a highly flexible API.
Stars: ✭ 265 (-85.06%)
Mutual labels:  debug, devtools
San Devtools
Browser developer tools extension for debugging San.
Stars: ✭ 51 (-97.13%)
Mutual labels:  debug, devtools
Redux Bug Reporter
🐛 A bug reporter and bug playback tool for redux. 🐛
Stars: ✭ 683 (-61.5%)
Mutual labels:  debug, devtools
Devtools
Tools for developing Elm programs! 🔧
Stars: ✭ 77 (-95.66%)
Mutual labels:  debug, devtools
Works For Me
Collection of developer toolkits
Stars: ✭ 131 (-92.62%)
Mutual labels:  devtools
Laravel Artisan Dd
Quickly run some code via Artisan
Stars: ✭ 136 (-92.33%)
Mutual labels:  debug
Python Var Dump
PHP's var_dump equivalent function for Python
Stars: ✭ 130 (-92.67%)
Mutual labels:  debug
Minimongoexplorer
Handy Google Chrome extension for reviewing MiniMongo.
Stars: ✭ 131 (-92.62%)
Mutual labels:  devtools
Devtron
[LOOKING FOR MAINTAINERS] An Electron DevTools Extension
Stars: ✭ 1,726 (-2.71%)
Mutual labels:  devtools
Twili
Homebrew debug monitor for the Nintendo Switch.
Stars: ✭ 131 (-92.62%)
Mutual labels:  debug
Ololog
A better console.log for the log-driven debugging junkies
Stars: ✭ 141 (-92.05%)
Mutual labels:  debug
Devtools Core
🚀 Packages for Firefox DevTools
Stars: ✭ 129 (-92.73%)
Mutual labels:  devtools
Check It Out
A command line interface for Git Checkout. See branches available for checkout.
Stars: ✭ 127 (-92.84%)
Mutual labels:  devtools
Laravel Mailable Test
An artisan command to easily test mailables
Stars: ✭ 143 (-91.94%)
Mutual labels:  debug
Ide Stubs
Phalcon IDE Stubs
Stars: ✭ 137 (-92.28%)
Mutual labels:  devtools
Laravel Tinker Tools
Use short class names in an Artisan tinker session
Stars: ✭ 134 (-92.45%)
Mutual labels:  devtools

Remote Redux DevTools

Demo

Use Redux DevTools remotely for React Native, hybrid, desktop and server side Redux apps.

Installation

npm install --save-dev remote-redux-devtools

Note: for Windows use [email protected] (newer versions will not work due to a Windows issue fixed in react-native).

Usage

There are 2 ways of usage depending if you're using other store enhancers (middlewares) or not.

Add DevTools enhancer to your store

If you have a basic store as described in the official redux-docs, simply replace:

import { createStore } from 'redux';
const store = createStore(reducer);

with

import { createStore } from 'redux';
import devToolsEnhancer from 'remote-redux-devtools';
const store = createStore(reducer, devToolsEnhancer());
// or const store = createStore(reducer, preloadedState, devToolsEnhancer());

Note: passing enhancer as last argument requires redux@>=3.1.0

When to use DevTools compose helper

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:

import { createStore, applyMiddleware, compose } from 'redux';

const store = createStore(reducer, preloadedState, compose(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

to:

import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'remote-redux-devtools';

const store = createStore(reducer, /* preloadedState, */ composeWithDevTools(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

or with devTools' options:

import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'remote-redux-devtools';

const composeEnhancers = composeWithDevTools({ realtime: true, port: 8000 });
const store = createStore(reducer, /* preloadedState, */ composeEnhancers(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

Enabling

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):

// ...
plugins: [
  new webpack.DefinePlugin({
    'process.env.NODE_ENV': JSON.stringify('development')
  })
],
// ...

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:

const store = createStore(reducer, devToolsEnhancer({ realtime: true }));

Monitoring

Use one of our monitor apps to inspect and dispatch actions:

Use remotedev-app to create your own monitor app.

Communicate via local server

In order to make it simple to use, by default, the module and the monitor app communicate via remotedev.io server. 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:

var remotedev = require('remotedev-server');
remotedev({ 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.

Parameters

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 instead of remotedev.io server.

Example:

export default function configureStore(preloadedState) {
  const store = createStore(
    reducer,
    preloadedState,
    devToolsEnhancer({
      name: 'Android app', realtime: true,
      hostname: 'localhost', port: 8000,
      maxAge: 30, actionsBlacklist: ['EFFECT_RESOLVED'],
      actionSanitizer: (action) => (
       action.type === 'FILE_DOWNLOAD_SUCCESS' && action.data ?
       { ...action, data: '<<LONG_BLOB>>' } : action
      ),
      stateSanitizer: (state) => state.data ? { ...state, data: '<<LONG_BLOB>>' } : state
    })
  );
  return store;
}

Demo

Examples

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].