enable redux-devtools in all environments (#23867)
* enable redux-devools in all environments [Redux DevTools](https://github.com/reduxjs/redux-devtools) gives developers and users insight into the client-side state of the Mattermost application. Instead of restricting this to developer builds, allow it for production builds too, simplifyin debugging when an issue reproduces in production but not in a development environment. There is no performance overhead unless the devtools are installed and opened by the enduser. There is should be no security impact, since all this information is already client-side. Furthermore, major websites expose Redux in production: e.g. https://cbc.ca and https://medium.com/. * preserve window.store for all environments, not as a supported API
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
dcb9fb9f29
Коммит
9588e08a00
@@ -8,7 +8,7 @@ import {
|
||||
Store,
|
||||
} from 'redux';
|
||||
import thunk from 'redux-thunk';
|
||||
import {composeWithDevToolsDevelopmentOnly} from '@redux-devtools/extension';
|
||||
import {composeWithDevTools} from '@redux-devtools/extension';
|
||||
|
||||
import {GlobalState} from '@mattermost/types/store';
|
||||
|
||||
@@ -39,7 +39,7 @@ export default function configureStore<S extends GlobalState>({
|
||||
...preloadedState,
|
||||
};
|
||||
|
||||
const composeEnhancers = composeWithDevToolsDevelopmentOnly({
|
||||
const composeEnhancers = composeWithDevTools({
|
||||
shouldHotReload: false,
|
||||
trace: true,
|
||||
traceLimit: 25,
|
||||
|
||||
@@ -8,9 +8,8 @@ import configureStore from 'store';
|
||||
|
||||
const store = configureStore();
|
||||
|
||||
// eslint-disable-next-line no-process-env
|
||||
if (process.env.NODE_ENV !== 'production' || window.location.origin === 'https://community.mattermost.com') {
|
||||
window.store = store;
|
||||
}
|
||||
// Export the store to simplify debugging in production environments. This is not a supported API,
|
||||
// and should not be relied upon by plugins.
|
||||
window.store = store;
|
||||
|
||||
export default store;
|
||||
|
||||
Ссылка в новой задаче
Block a user