DevTools for Redux with hot reloading, action replay, and customizable UI
Go to file
2015-08-10 20:37:11 +03:00
examples Port to React Redux 0.5.0 2015-08-07 19:49:40 +03:00
src Increase z-index. 2015-08-10 17:49:53 +02:00
test Add project skeleton (no DevTools yet) 2015-07-14 22:46:44 +03:00
.babelrc Add project skeleton (no DevTools yet) 2015-07-14 22:46:44 +03:00
.eslintignore Add project skeleton (no DevTools yet) 2015-07-14 22:46:44 +03:00
.eslintrc Import the initial devTools implementation 2015-07-15 00:09:54 +03:00
.gitignore We don't need an UMD build here 2015-07-15 00:09:20 +03:00
.npmignore Add project skeleton (no DevTools yet) 2015-07-14 22:46:44 +03:00
.travis.yml Add project skeleton (no DevTools yet) 2015-07-14 22:46:44 +03:00
CHANGELOG.md Add project skeleton (no DevTools yet) 2015-07-14 22:46:44 +03:00
CODE_OF_CONDUCT.md Add project skeleton (no DevTools yet) 2015-07-14 22:46:44 +03:00
LICENSE.md Add project skeleton (no DevTools yet) 2015-07-14 22:46:44 +03:00
package.json 0.2.0 2015-08-07 19:49:53 +03:00
README.md Update installation instructions. 2015-08-10 17:54:25 +02:00

Redux DevTools

A better README is coming. But if you insist...

Installation

npm install --save-dev redux-devtools

This commit should give you an idea about how to add Redux DevTools for your app but make sure to only apply devTools() in development! In production, this will be terribly slow because actions just accumulate forever. (We'll need to implement a rolling window for dev too.)

For example, in Webpack, you can use ProvidePlugin to turn magic constants like __DEV__ into true or false depending on the environment, and import and render redux-devtools conditionally behind if (__DEV__). Then, if you have an Uglify step before production, Uglify will eliminate dead if (false) branches with redux-devtools imports. Here is an example of adding React DevTools to a project handling the production case correctly.

Running Examples

You can do this:

git clone https://github.com/gaearon/redux-devtools.git
cd redux-devtools
npm install

cd examples/counter
npm install
npm start
open http://localhost:3000

Try clicking on actions in the log, or changing some code inside examples/counter/reducers/counter.
For fun, you can also open http://localhost:3000/?debug_session=123, click around, and then refresh.

Oh, and you can do the same with the TodoMVC example as well.

If you only would like to monitor a part of the state, you can set a select-prop on the DevTools component. ex. <DevTools select={state => state.todos} store={store} monitor={LogMonitor} />

It's Ugly!

The design or usability is not the point. (Although we'll have better design in the future :-)

You can build a completely custom UI for it because <DevTools> accepts a monitor React component prop. The included LogMonitor is just an example.

In fact I challenge you to build a custom monitor for Redux DevTools!

Some crazy ideas for custom monitors:

  • A slider that lets you jump between computed states just by dragging it
  • An in-app layer that shows the last N states right in the app (e.g. for animation)
  • A time machine like interface where the last N states of your app reside on different Z layers
  • Feel free to come up with and implement your own! Check LogMonitor propTypes to see what you can do.

License

MIT