All Projects → zalmoxisus → Redux Devtools Extension

zalmoxisus / Redux Devtools Extension

Licence: mit
Redux DevTools extension.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to Redux Devtools Extension

San Devtools
Browser developer tools extension for debugging San.
Stars: ✭ 51 (-99.61%)
Mutual labels:  extension, debug, devtools
debug.js
Debugger of JavaScript, by JavaScript, for JavaScript
Stars: ✭ 19 (-99.86%)
Mutual labels:  devtools, debug
urql-devtools-exchange
The exchange for usage with Urql Devtools
Stars: ✭ 35 (-99.74%)
Mutual labels:  extension, devtools
Lightproxy
💎 Cross platform Web debugging proxy
Stars: ✭ 2,347 (-82.27%)
Mutual labels:  debug, devtools
React Performance Observer
Get performance measurements from React Fiber
Stars: ✭ 207 (-98.44%)
Mutual labels:  debug, devtools
Vue Perf Devtool
Vue Performance Devtool is a browser extension for inspecting the performance of Vue Components.
Stars: ✭ 510 (-96.15%)
Mutual labels:  extension, devtools
Redux Remotedev
Redux DevTools for production (web and React Native) with a highly flexible API.
Stars: ✭ 265 (-98%)
Mutual labels:  debug, devtools
Service Worker Detector
This extension detects if a website registers a Service Worker.
Stars: ✭ 124 (-99.06%)
Mutual labels:  extension, devtools
Devtools
Tools for developing Elm programs! 🔧
Stars: ✭ 77 (-99.42%)
Mutual labels:  debug, devtools
Redux Bug Reporter
🐛 A bug reporter and bug playback tool for redux. 🐛
Stars: ✭ 683 (-94.84%)
Mutual labels:  debug, devtools
Virtual Authenticators Tab
Debug webauthn with a chrome extension that adds a virtual authenticators tab to devtools
Stars: ✭ 95 (-99.28%)
Mutual labels:  extension, devtools
Remote Redux Devtools
Redux DevTools remotely.
Stars: ✭ 1,774 (-86.6%)
Mutual labels:  debug, devtools
Spring Boot Examples
个人学习 SpringBoot2.x 写的一些示例程序,目前正在持续更新中.....
Stars: ✭ 159 (-98.8%)
Mutual labels:  devtools
Hitchcock
The Master of Suspense 🍿
Stars: ✭ 167 (-98.74%)
Mutual labels:  debug
React Rewind
Time Travel Debugger for React useReducer
Stars: ✭ 159 (-98.8%)
Mutual labels:  devtools
Aura Theme
💅 A beautiful dark theme for your favorite apps.
Stars: ✭ 159 (-98.8%)
Mutual labels:  extension
Vscode Twitch Highlighter
This is a VS Code extension that will allow your Twitch chat to highlight a line of code via a command message. Example: `!line 8 server.js`. See master branch README.md for more details
Stars: ✭ 169 (-98.72%)
Mutual labels:  extension
Ssh2 Python
Bindings for libssh2 C library.
Stars: ✭ 166 (-98.75%)
Mutual labels:  extension
Hyperion Ios
In-app design review tool to inspect measurements, attributes, and animations.
Stars: ✭ 1,964 (-85.16%)
Mutual labels:  debug
Smartdebug.js
Next-generation debugging for javascript!
Stars: ✭ 157 (-98.81%)
Mutual labels:  debug

Redux DevTools Extension

Join the chat at https://gitter.im/zalmoxisus/redux-devtools-extension PRs Welcome OpenCollective OpenCollective

Demo

Installation

1. For Chrome

2. For Firefox

3. For Electron

4. For other browsers and non-browser environment

Usage

Note that starting from v2.7, window.devToolsExtension was renamed to window.__REDUX_DEVTOOLS_EXTENSION__ / window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__.

1. With Redux

1.1 Basic store

For a basic Redux store simply add:

 const store = createStore(
   reducer, /* preloadedState, */
+  window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
 );

Note that preloadedState argument is optional in Redux's createStore.

For universal ("isomorphic") apps, prefix it with typeof window !== 'undefined' &&.

const composeEnhancers = (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose;

For TypeScript use redux-devtools-extension npm package, which contains all the definitions, or just use (window as any) (see Recipes for an example).

const composeEnhancers = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

In case ESLint is configured to not allow using the underscore dangle, wrap it like so:

+ /* eslint-disable no-underscore-dangle */
  const store = createStore(
   reducer, /* preloadedState, */
   window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
  );
+ /* eslint-enable */

Note: Passing enhancer as last argument requires redux@>=3.1.0. For older versions apply it like here or here. Don't mix the old Redux API with the new one.

You don't need to npm install redux-devtools when using the extension (that's a different lib).

1.2 Advanced store setup

If you setup your store with middleware and enhancers, change:

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

+ const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
+ const store = createStore(reducer, /* preloadedState, */ composeEnhancers(
- const store = createStore(reducer, /* preloadedState, */ compose(
    applyMiddleware(...middleware)
  ));

Note that when the extension is not installed, we’re using Redux compose here.

To specify extension’s options, use it like so:

const composeEnhancers =
  typeof window === 'object' &&
  window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?   
    window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
      // Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...
    }) : compose;

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

See the post for more details.

1.3 Use redux-devtools-extension package from npm

To make things easier, there's an npm package to install:

npm install --save redux-devtools-extension

and to use like so:

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

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

To specify extension’s options:

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

const composeEnhancers = composeWithDevTools({
  // Specify name here, actionsBlacklist, actionsCreators and other options if needed
});
const store = createStore(reducer, /* preloadedState, */ composeEnhancers(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

There’re just few lines of code added to your bundle.

In case you don't include other enhancers and middlewares, just use devToolsEnhancer:

import { createStore } from 'redux';
import { devToolsEnhancer } from 'redux-devtools-extension';

const store = createStore(reducer, /* preloadedState, */ devToolsEnhancer(
  // Specify name here, actionsBlacklist, actionsCreators and other options if needed
));

1.4 Using in production

It's useful to include the extension in production as well. Usually you can use it for development.

If you want to restrict it there, use redux-devtools-extension/logOnlyInProduction:

import { createStore } from 'redux';
import { devToolsEnhancer } from 'redux-devtools-extension/logOnlyInProduction';

const store = createStore(reducer, /* preloadedState, */ devToolsEnhancer(
  // options like actionSanitizer, stateSanitizer
));

or with middlewares and enhancers:

import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction';

const composeEnhancers = composeWithDevTools({
  // options like actionSanitizer, stateSanitizer
});
const store = createStore(reducer, /* preloadedState, */ composeEnhancers(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

You'll have to add 'process.env.NODE_ENV': JSON.stringify('production') in your Webpack config for the production bundle (to envify). If you use create-react-app, it already does it for you.

If you're already checking process.env.NODE_ENV when creating the store, include redux-devtools-extension/logOnly for production environment.

If you don’t want to allow the extension in production, just use redux-devtools-extension/developmentOnly.

See the article for more details.

1.5 For React Native, hybrid, desktop and server side Redux apps

For React Native we can use react-native-debugger, which already included the same API with Redux DevTools Extension.

For most platforms, include Remote Redux DevTools's store enhancer, and from the extension's context menu choose 'Open Remote DevTools' for remote monitoring.

2. Without Redux

See integrations and the blog post for more details on how to use the extension with any architecture.

Docs

Demo

Live demos to use the extension with:

Also see ./examples folder.

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

License

MIT

Created By

If you like this, follow @mdiordiev on twitter.

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].