mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 23:53:10 +08:00
Update dependency @reduxjs/toolkit to v1.8.0 (#45950)
* Update dependency @reduxjs/toolkit to v1.8.0 * Fix type errors * simplified code Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: kay delaney <kay@grafana.com> Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com> Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
This commit is contained in:
@ -276,7 +276,7 @@
|
||||
"@react-stately/collections": "3.3.7",
|
||||
"@react-stately/menu": "3.2.6",
|
||||
"@react-stately/tree": "3.2.3",
|
||||
"@reduxjs/toolkit": "1.7.2",
|
||||
"@reduxjs/toolkit": "1.8.0",
|
||||
"@sentry/browser": "6.19.1",
|
||||
"@sentry/types": "6.19.1",
|
||||
"@sentry/utils": "6.19.1",
|
||||
|
@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { within } from '@testing-library/dom';
|
||||
import { EnhancedStore } from '@reduxjs/toolkit';
|
||||
import { Provider } from 'react-redux';
|
||||
import { Route, Router } from 'react-router-dom';
|
||||
import { fromPairs } from 'lodash';
|
||||
@ -31,7 +30,7 @@ type SetupOptions = {
|
||||
|
||||
export function setupExplore(options?: SetupOptions): {
|
||||
datasources: { [name: string]: DataSourceApi };
|
||||
store: EnhancedStore;
|
||||
store: ReturnType<typeof configureStore>;
|
||||
unmount: () => void;
|
||||
container: HTMLElement;
|
||||
} {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { configureStore as reduxConfigureStore } from '@reduxjs/toolkit';
|
||||
import { configureStore as reduxConfigureStore, MiddlewareArray } from '@reduxjs/toolkit';
|
||||
import { setStore } from './store';
|
||||
import { StoreState } from 'app/types/store';
|
||||
import { addReducer, createRootReducer } from '../core/reducers/root';
|
||||
import { buildInitialState } from '../core/reducers/navModel';
|
||||
import { ThunkMiddlewareFor } from '@reduxjs/toolkit/src/getDefaultMiddleware';
|
||||
import { AnyAction } from 'redux';
|
||||
import { ThunkMiddleware } from 'redux-thunk';
|
||||
|
||||
export function addRootReducer(reducers: any) {
|
||||
// this is ok now because we add reducers before configureStore is called
|
||||
@ -14,11 +14,7 @@ export function addRootReducer(reducers: any) {
|
||||
}
|
||||
|
||||
export function configureStore(initialState?: Partial<StoreState>) {
|
||||
const store = reduxConfigureStore<
|
||||
StoreState,
|
||||
AnyAction,
|
||||
ReadonlyArray<ThunkMiddlewareFor<StoreState, { thunk: true }>>
|
||||
>({
|
||||
const store = reduxConfigureStore<StoreState, AnyAction, MiddlewareArray<[ThunkMiddleware<StoreState, AnyAction>]>>({
|
||||
reducer: createRootReducer(),
|
||||
middleware: (getDefaultMiddleware) =>
|
||||
getDefaultMiddleware({ thunk: true, serializableCheck: false, immutableCheck: false }),
|
||||
|
@ -56,7 +56,7 @@ export const reduxTester = <State>(args?: ReduxTesterArguments<State>): ReduxTes
|
||||
|
||||
const preloadedState = args?.preloadedState ?? ({} as unknown as PreloadedState<CombinedState<NoInfer<State>>>);
|
||||
const debug = args?.debug ?? false;
|
||||
let store: EnhancedStore<State> | null = null;
|
||||
let store: EnhancedStore<State, AnyAction, []> | null = null;
|
||||
|
||||
const defaultMiddleware = getDefaultMiddleware<State>({
|
||||
thunk: false,
|
||||
|
10
yarn.lock
10
yarn.lock
@ -7219,9 +7219,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@reduxjs/toolkit@npm:1.7.2":
|
||||
version: 1.7.2
|
||||
resolution: "@reduxjs/toolkit@npm:1.7.2"
|
||||
"@reduxjs/toolkit@npm:1.8.0":
|
||||
version: 1.8.0
|
||||
resolution: "@reduxjs/toolkit@npm:1.8.0"
|
||||
dependencies:
|
||||
immer: ^9.0.7
|
||||
redux: ^4.1.2
|
||||
@ -7235,7 +7235,7 @@ __metadata:
|
||||
optional: true
|
||||
react-redux:
|
||||
optional: true
|
||||
checksum: 41c17c660f7c95d776658b9a101f9803c37589b2c08861e90283abe5fab70f99c37af064fae0c5b7501f67308946fa072504f6a801e272f157b9f7427a5e571e
|
||||
checksum: e229571b80d7f5c4407af2050ac2a26a22472541fef1705d5e8b73b93bfb2884072d79e1cea2cd81d89939cc6b6073ef3ddf1680950aac66ba34cd202a6cf371
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -20454,7 +20454,7 @@ __metadata:
|
||||
"@react-types/menu": 3.5.2
|
||||
"@react-types/overlays": 3.5.4
|
||||
"@react-types/shared": 3.11.2
|
||||
"@reduxjs/toolkit": 1.7.2
|
||||
"@reduxjs/toolkit": 1.8.0
|
||||
"@rtsao/plugin-proposal-class-properties": 7.0.1-patch.1
|
||||
"@sentry/browser": 6.19.1
|
||||
"@sentry/types": 6.19.1
|
||||
|
Reference in New Issue
Block a user