-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecating window.devToolsExtension
#220
Comments
I had a really frustrating morning today wondering why |
@vdh, Chrome should update the extension 2 days ago. Maybe you disabled autoupdating extensions somewhere in Chrome settings? Though I didn't know it's possible to disable it. |
Sadly, for some reason Chrome's extension auto-updating isn't so auto, I had to manually force an update. It might be nice to have an "in 2.7.0" or "as of 2.7.0" note on the deprecated part in the instructions as a hint to check one's plugin version? |
@vdh, I added a note in the README. Anyway, we need autoupdating, as we're moving really fast here and still want to change / improve a lot of things. Hope it was just a temporally problem of Chrome as I didn't experience it before. If the problem with autoupdating will still persist, please open an issue, so we'll add a button to check if the extension is up to date and update it manually. |
The old format will be depracated soon: zalmoxisus/redux-devtools-extension#220
@zalmoxisus I was a little confused while upgrading to the latest, around the usage of const { persistState } = require('redux-devtools');
const DevTools = require('../containers/DevTools/DevTools');
store = createStore(
reducer,
initialState,
compose(
applyMiddleware(...middleware),
window.devToolsExtension ? window.devToolsExtension() : DevTools.instrument(),
persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
)
); Now with the new changes that you announced and deprecation of const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
store = createStore(
reducer,
initialState,
composeEnhancers(
applyMiddleware(...middleware),
window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : DevTools.instrument(),
persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
)
); but get the following error:
I assume this error is because I can't use Many thanks on your work on this! |
@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, Also note that the extension already includes |
@zalmoxisus great, thank you for the detailed answer! |
Redux dev tools is an awesome tool - Thanks for the great work on it! |
For any one who is looking for exactly what to write to make redux dev tools work - import thunk from "redux-thunk"; const middleware = [thunk]; const store = createStore(rootReducer, initialState, enhancer); export default store; You need to install redux-devtools package with |
This is how I use it (working fine):
|
@yairEO I am using it the same way, however I am not sure if its correct? |
I think 2 years is enough for everybody to rename |
You could try like this `const middlewares = [thunk]; export default function configureStore(initialState) { |
Removed in 3.0. |
* Add `LaTeX Quality Control` to the readme * Update dependencies * Match `web` version * Update to modern packages * Update to modern versions * Import `Link` from `react-router-dom` * Import Helmet correctly * Remove `react-router-redux` It seems that we're not actually getting anything from it (?) * Update component containers/App * Revert unecessary changes to containers/App * Update component containers/Upload * Revert unnecessary changes to container/Upload * Fix links * Add `withNavigation` HOC * Fix link to `/upload` * Remove unneeded `navigate` props * SSR: Use `StaticRouterProvider` * CSR: Use `createBrowserRouter` * SSR: Simplify since we don't need to perform queries * Add `data-testid`s to components * Update tests (`enzyme` -> `@testing-library`) * Remove unneeded "before" in tests * Revert "Remove unneeded "before" in tests" (actually necessary) * Rename `devToolsExtension` to `__REDUX_DEVTOOLS_EXTENSION__` Per zalmoxisus/redux-devtools-extension#220 * Return 404 on invalid paths * Remove unuseds dependencies * Re-implement react-router `onUpdate` with `RouteChangedHandler` It appears that `onUpdate` was removed from react-router remix-run/react-router#4278 * Update package-lock * Remove debug log GitOrigin-RevId: 3244b4266b53ac57a92ed4adc7c0e00b93a6b361
window.devToolsExtension
is being deprecated in favour ofwindow.__REDUX_DEVTOOLS_EXTENSION__
andwindow.__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.
The text was updated successfully, but these errors were encountered: