question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecating `window.devToolsExtension`

See original GitHub issue

window.devToolsExtension is being deprecated in favour of window.__REDUX_DEVTOOLS_EXTENSION__ and window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__. See the README on how to use them and the post about why we added the second function.

Also there’s redux-devtools-extension npm package to make things easier.

Now we don’t have the order’s and noop functions’ confusion, also the shared window namespace isn’t too vague anymore. The deprecation warnings will come in the next versions and there will be also more sugar for the npm package.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
zalmoxisuscommented, Nov 8, 2016

@oyeanuj, yes you shouldn’t use both. Best way would be:

let enhancer;
if (window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) {
  enhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__(
    applyMiddleware(...middleware)
  );
} else {
  enhancer = compose(
    applyMiddleware(...middleware),
    DevTools.instrument(),
    persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
  );
}
store = createStore(
  reducer,
  initialState,
  enhancer
);

New method, window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__, offers the ability to lock enhancers/middlewares (when the corresponding button is clicked) and to dispatch remote actions through other enhancers. See the blog post for more details. If you don’t need those features, you can just replace window.devToolsExtension with window.__REDUX_DEVTOOLS_EXTENSION__.

Also note that the extension already includes persistState.

3reactions
zalmoxisuscommented, Nov 17, 2018

I think 2 years is enough for everybody to rename window.devToolsExtension to window.__REDUX_DEVTOOLS_EXTENSION__ in their apps. We’ll add a deprecation warning in 2.15.5 and remove the variable in 3.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redux Devtool (chrome extension) not displaying state
window.devToolsExtension is deprecated in favor of window.REDUX_DEVTOOLS_EXTENSION`, and will be removed in next version of Redux DevTools: ...
Read more >
redux-devtools-extension - npm
Start using redux-devtools-extension in your project by running `npm i redux-devtools-extension`. ... This package has been deprecated.
Read more >
Improve your development workflow with Redux DevTools ...
As a consequence, extension's store enhancer is being deprecated. Hot Reloading with Time Travel helps to boost the developer's productivity ...
Read more >
chrome.windows - Chrome Developers
Specifies what type of browser window to create. 'panel' is deprecated and is available only to existing allowlisted extensions on Chrome OS. Type....
Read more >
How to use the redux-devtools-extension/logOnlyInProduction ...
scss'); /* eslint-disable no-underscore-dangle */ // const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; const store = createStore( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found