Another Redux DevTools Monitor

Overview

redux-devtools-inspector

npm version

This package was merged into redux-devtools monorepo. Please refer to that repository for the latest updates, issues and pull requests.

A state monitor for Redux DevTools that provides a convenient way to inspect "real world" app states that could be complicated and deeply nested.

Installation

npm install --save-dev redux-devtools-inspector

Usage

You can use Inspector as the only monitor in your app:

containers/DevTools.js
import React from 'react';
import { createDevTools } from 'redux-devtools';
import Inspector from 'redux-devtools-inspector';

export default createDevTools(
  <Inspector />
);

Then you can render <DevTools> to any place inside app or even into a separate popup window.

Alternative, you can use it together with DockMonitor to make it dockable.
Consult the DockMonitor README for details of this approach.

Read how to start using Redux DevTools.

Features

The inspector displays a list of actions and a preview panel which shows the state after the selected action and a diff with the previous state. If no actions are selected, the last state is shown.

You may pin a certain part of the state to only track its changes.

Props

Name Type Description
theme Object or string Contains either base16 theme name or object, that can be base16 colors map or object containing classnames or styles.
invertTheme Boolean Inverts theme color luminance, making light theme out of dark theme and vice versa.
supportImmutable Boolean Better Immutable rendering in Diff (can affect performance if state has huge objects/arrays). false by default.
tabs Array or function Overrides list of tabs (see below)
diffObjectHash Function Optional callback for better array handling in diffs (see jsondiffpatch docs)
diffPropertyFilter Function Optional callback for ignoring particular props in diff (see jsondiffpatch docs)

If tabs is a function, it receives a list of default tabs and should return updated list, for example:

defaultTabs => [...defaultTabs, { name: 'My Tab', component: MyTab }]

If tabs is an array, only provided tabs are rendered.

component is provided with action and other props, see ActionPreview.jsx for reference.

Usage example: redux-devtools-test-generator.

License

MIT

Comments
  • occasional Uncaught Invariant Violation error (possibly on page transition?)

    occasional Uncaught Invariant Violation error (possibly on page transition?)

    I've noticed when experimenting with this monitor, I get errors like the following:

    Uncaught Invariant Violation: findComponentRoot(..., .0.1.1.1.$/=10.1.1.0.$router.0): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID``.

    The monitor's behavior doesn't appear to be affected. The DOM node corresponds to an item in the monitor's diff tree (in the above example, state.router, though I've also seen it for other top-level parts of the state, so it may not be related to react-router. It does appear to happen often on page transitions.

    I'm sorry that I don't have a more reproducible example at the moment. I'll try to dig in and find a more specific cause when I have time. Perhaps you have some idea of what might be causing this?

    bug 
    opened by billyjanitsch 15
  • Fixes #10 (Now compatible with immutable library)

    Fixes #10 (Now compatible with immutable library)

    Okay, so this is a bit of a bold move, but as I have mentioned here, I don't really see why there is a separate node for Iterable objects. Yes, this monitor does show the type of the object in the state, but I think that has limited value. I also think the amount of effort to get this to work with immutable properly would be mammoth (I got some way towards making the JSONDiff module work, when I realised that the whole "pin" feature is incompatible as well.

    I think this solution (converting to pure JS) is the cleanest, and provides immediate support for the immutable library without a huge undertaking. If you want to go back and do it properly another time, fair enough, but for now I think this is the right way to go.

    opened by leonaves 12
  • Sort JSON tree keys alphabetically

    Sort JSON tree keys alphabetically

    This will sort the JSON tree keys in alphabetical order, rather than with the implementation-dependent ordering determined by the browser engine's getOwnPropertyNames function. In large JSON structures, it can be challenging to locate a particular nested node of interest among the multitude of other keys. Adding this sorting will dramatically simplify locating specific state attributes. The request comes from zalmoxisus/redux-devtools-extension#416.

    Note that the localeCompare function is supported in all major browsers per MDN. It is case-sensitive, so abc will come before Abc.

    If it's preferable that this be opt-in so as not to upset existing applications, I'm more than happy to make changes as advised. Thanks!

    opened by milotoor 9
  • Implement support for custom tabs

    Implement support for custom tabs

    As per https://github.com/alexkuz/redux-devtools-inspector/pull/31#issuecomment-226203139, it will be possible to specify add tabs for custom React components to inspect selected actions as bellow:

    <InspectorMonitor 
       customTabs = {{
          'MyInspect': <MyInspectComponent />
       }}
    />
    

    Use with redux-devtools-test-generator to generate tests for specific actions.

    opened by zalmoxisus 7
  • Support Chrome Extension

    Support Chrome Extension

    Starting from 0.4 the inspector monitor stores monitor state in devtools, which is a great feature, but not for the extension. Imagine that every 150 ms the extension will dispatch a monitor action to the injected script, will serialize the liftedStore and parse it in the backgrond. It will crash the browser for sure. We can do some optimizations, but anyway it will slow the extension down.

    What do you think of having an alternative of the monitor reducers?

    enhancement 
    opened by zalmoxisus 7
  • Color coded actions

    Color coded actions

    How do people feel about being able to color code actions?

    My first thought was when { error: true } using some kind of red so that errors stand out in the error timeline. But then I got to thinking why not others why not let the application style its actions, so that a developer can more easily pick out actions from the timeline. Something like:

    {
      type: MY_ACTION,
      payload: { .... }
      _inspector: {
        color: '#0f0',
        background: '#00f'
      }
    }
    

    I'm sure people will protest adding this configuration to application code bases in this way, I'm not mad about it. But I can't think of an alternative that isn't horribly complex.

    opened by msaspence 6
  • Feature request: Commit

    Feature request: Commit

    I've gotten used to the Commit feature of the LogMonitor, but the ability to diff state in Inspector is awesome. Right now I am switching between LogMonitor to commit the state and back to Inspector to continue work.

    I would like to see the commit feature in this monitor too!

    enhancement 
    opened by noseglid 6
  • Bump jss version

    Bump jss version

    Trying to install this with yarn fails on node > 6 because jss has version required of node < 6.0.0. The latest version of jss does not have this issue so would be good to upgrade (if possible!).

    Thanks for a great tool!

    opened by kbrownlees 5
  • Does not handle states based on immutable library.

    Does not handle states based on immutable library.

    As mentioned here: https://github.com/chibicode/react-json-tree/pull/32 immutable does not work correctly with this monitor due to a.) a bug in react-json-tree and b.) the fact that the jsondiff view does not consider immutable when generating deltas.

    opened by leonaves 5
  • Custom subtabs

    Custom subtabs

    In addition to custom tabs, now it's possible to specify custom subtabs with selectors as following:

    <DevtoolsInspector
                             tabs={defaultTabs => [{
                               name: 'Custom Tab',
                               components: [
                                 {
                                   name: 'Action as JSON',
                                   component: CustomComponent,
                                   selector: ({ action }) => ({ data: action })
                                 },
                                 {
                                   name: 'State as JSON',
                                   component: CustomComponent,
                                   selector: ({ nextState }) => ({ data: nextState })
                                 }
                               ]
                             }, ...defaultTabs]} />
    

    Which gives: screen shot 2016-11-19 at 2 07 21 pm

    opened by zalmoxisus 4
  • Feature request: action cancellation

    Feature request: action cancellation

    It would be great if the monitor included redux-devtools-log-monitor's action disabling feature:

    Clicking some part of an action disables it from the history, causing subsequent states to be recomputed.

    It looks like it wouldn't require much code -- I can work on a PR if you're interested in the feature.

    enhancement 
    opened by billyjanitsch 4
  • Override default 'getItemText' behavior with 'formatItem' prop

    Override default 'getItemText' behavior with 'formatItem' prop

    NOTE: test fails because of noflow in types.js. Not my fault :)

    This overrides getText from src/tabs/getItemString.js with user-defined formatItem. Example use case: generate appropriate labels for custom datatypes. See other details in README.

    opened by dolsem 0
  • [Bug] getShortTypeString type checking

    [Bug] getShortTypeString type checking

    If type is checked before val is modified, new val may have invalid type.

    In my case

    val = [ 1234, 5678]
    

    and type is 'Array' but then val gets assigned 5678

    https://github.com/alexkuz/redux-devtools-inspector/commit/9dfaaabcfba7913fd15ee6ee43627e0ceb1d5c7b#diff-d6461f2218156760b2d63ced35272d86R8

    PR: https://github.com/alexkuz/redux-devtools-inspector/pull/72

    opened by Arturszott 1
  • Please publish fix for undefined nodes

    Please publish fix for undefined nodes

    I created a PR https://github.com/alexkuz/redux-devtools-inspector/pull/70 to bump the version and fix some eslint errors. I need this commit to be published: https://github.com/alexkuz/redux-devtools-inspector/commit/5202f01f15779a7a01e6679272a6d5f4566d646f In my case blobs in the store (introduced by https://github.com/agrasley/react-recorder-redux) are throwing errors without it.

    opened by alex-vg 2
  • Critical dependency: the request of a dependency is an expression

    Critical dependency: the request of a dependency is an expression

    getting these 2 warnings in webpack bundle:

    WARNING in ../~/jsondiffpatch/src/main.js
    56:20-50 Critical dependency: the request of a dependency is an expression
    
    WARNING in ../~/jsondiffpatch/src/main.js
    61:19-47 Critical dependency: the request of a dependency is an expression
    
    opened by mkg0 4
  • Give access to `monitorState` for custom tabs components

    Give access to `monitorState` for custom tabs components

    opened by zalmoxisus 0
Filterable tree view monitor for Redux DevTools

========================= Filterable tree view monitor for Redux DevTools. Actions are collapsed by default but they can be expanded by clicking on th

Brian Vaughn 154 Jun 6, 2022
The default monitor for Redux DevTools with a tree view

Redux DevTools Log Monitor The default monitor for Redux DevTools with a tree view. It shows a log of states and actions, and lets you change their hi

Dan Abramov 312 Jun 25, 2022
DevTools for Redux with hot reloading, action replay, and customizable UI

Redux DevTools Developer Tools to power-up Redux development workflow or any other architecture which handles the state change (see integrations). It

Redux 13.3k Jan 2, 2023
A resizable and movable dock for Redux DevTools monitors

Redux DevTools Dock Monitor A resizable and movable dock for Redux DevTools. Powered by React Dock. Installation npm install --save-dev redux-devtools

Dan Abramov 402 Nov 10, 2022
DevTools for Redux with hot reloading, action replay, and customizable UI

Redux DevTools Developer Tools to power-up Redux development workflow or any other architecture which handles the state change (see integrations). It

Redux 13.3k Jan 1, 2023
Redux DevTools remotely.

Remote Redux DevTools Use Redux DevTools remotely for React Native, hybrid, desktop and server side Redux apps. Installation npm install --save-dev re

Mihail Diordiev 1.8k Dec 31, 2022
React-query Devtools for swr

react-query devtools for swr under development Live Demo Installation yarn add @rendinjast/swr-devtools # or npm i @rendinjast/swr-devtools Usage impo

Erfan Khadivar 12 Aug 14, 2022
Redux Tutorial - share my experience regarding redux, react-redux and redux-toolkit

Redux Tutorial 1. Introduction to Redux 1.1 What is Redux & why Redux? A small JS Library for managing medium/large amount of states globally in your

Anisul Islam 36 Dec 29, 2022
Skeleton React App configured with Redux store along with redux-thunk, redux persist and form validation using formik and yup

Getting Started with React-Redux App Some Configrations Needed You guys need to modify the baseUrl (path to your server) in the server.js file that is

Usama Sarfraz 11 Jul 10, 2022
A Higher Order Component using react-redux to keep form state in a Redux store

redux-form You build great forms, but do you know HOW users use your forms? Find out with Form Nerd! Professional analytics from the creator of Redux

Redux Form 12.6k Jan 3, 2023
redux-immutable is used to create an equivalent function of Redux combineReducers that works with Immutable.js state.

redux-immutable redux-immutable is used to create an equivalent function of Redux combineReducers that works with Immutable.js state. When Redux creat

Gajus Kuizinas 1.9k Dec 30, 2022
A simple app for study react with redux, redux saga and typescript.

React com Redux, Redux-Saga e TypeScript. ?? Uma aplicação simple para entender o funcionamento do Redux e a melhor maneira de utiliza-lo junto com o

João Marcos Belanga 1 May 24, 2022
Redux - Create forms using Redux And React

Exercício de fixação Vamos criar formulários utilizando Redux! \o/ Antes de inic

Márcio Júnior 2 Jul 21, 2022
A lightweight state management library for react inspired by redux and react-redux

A lightweight state management library for react inspired by redux and react-redux

null 2 Sep 9, 2022
Official React bindings for Redux

React Redux Official React bindings for Redux. Performant and flexible. Installation Using Create React App The recommended way to start new apps with

Redux 22.5k Jan 1, 2023
Ruthlessly simple bindings to keep react-router and redux in sync

Project Deprecated This project is no longer maintained. For your Redux <-> Router syncing needs with React Router 4+, please see one of these librari

React Community 7.9k Dec 30, 2022
The official, opinionated, batteries-included toolset for efficient Redux development

Redux Toolkit The official, opinionated, batteries-included toolset for efficient Redux development (Formerly known as "Redux Starter Kit") Installati

Redux 8.9k Dec 31, 2022
Thunk middleware for Redux

Redux Thunk Thunk middleware for Redux. npm install redux-thunk yarn add redux-thunk Note on 2.x Update Most tutorials today assume that you're using

Redux 17.5k Dec 31, 2022
Logger for Redux

Logger for Redux Now maintained by LogRocket! LogRocket is a production Redux logging tool that lets you replay problems as if they happened in your o

null 5.7k Jan 1, 2023