Skip to content

Commit fbeb82b

Browse files
committed
Merge branch 'master' of https://github.com/reduxjs/react-redux into add-size-limit
2 parents 4bac4b5 + 416114f commit fbeb82b

File tree

8 files changed

+2243
-3336
lines changed

8 files changed

+2243
-3336
lines changed

.eslintrc.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
},
2424
"settings": {
2525
"import/ignore": ["react-native"],
26-
"import/resolver": { "node": { "extensions": [".js", ".ts", ".tsx"] } },
26+
"import/resolver": {
27+
"typescript": { "extensions": [".js", ".ts", ".tsx"] }
28+
},
2729
"react": { "version": "detect" }
2830
},
2931
"overrides": [

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
- name: Install dependencies
2121
run: yarn install
2222

23+
- name: Lint
24+
run: yarn lint
25+
2326
- name: Run test suite
2427
run: yarn test
2528

package.json

+35-35
Original file line numberDiff line numberDiff line change
@@ -64,51 +64,51 @@
6464
}
6565
},
6666
"dependencies": {
67-
"@types/use-sync-external-store": "^0.0.3",
68-
"use-sync-external-store": "^1.0.0"
67+
"@types/use-sync-external-store": "^0.0.6",
68+
"use-sync-external-store": "^1.2.2"
6969
},
7070
"devDependencies": {
71-
"@babel/cli": "^7.12.1",
72-
"@babel/core": "^7.12.3",
73-
"@babel/plugin-proposal-decorators": "^7.12.1",
74-
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
75-
"@babel/plugin-transform-flow-strip-types": "^7.22.5",
76-
"@babel/plugin-transform-react-display-name": "^7.12.1",
77-
"@babel/plugin-transform-react-jsx": "^7.12.1",
78-
"@babel/plugin-transform-runtime": "^7.12.1",
79-
"@babel/preset-env": "^7.12.1",
80-
"@babel/preset-typescript": "^7.14.5",
81-
"@microsoft/api-extractor": "^7.18.1",
82-
"@reduxjs/toolkit": "^2.0.0-beta.4",
71+
"@babel/cli": "^7.24.7",
72+
"@babel/core": "^7.24.7",
73+
"@babel/plugin-proposal-decorators": "^7.24.7",
74+
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
75+
"@babel/plugin-transform-flow-strip-types": "^7.24.7",
76+
"@babel/plugin-transform-react-display-name": "^7.24.7",
77+
"@babel/plugin-transform-react-jsx": "^7.24.7",
78+
"@babel/plugin-transform-runtime": "^7.24.7",
79+
"@babel/preset-env": "^7.24.7",
80+
"@babel/preset-typescript": "^7.24.7",
81+
"@microsoft/api-extractor": "^7.47.0",
82+
"@reduxjs/toolkit": "^2.2.5",
8383
"@size-limit/file": "^11.1.4",
8484
"@size-limit/webpack": "^11.1.4",
85-
"@testing-library/jest-dom": "^6.3.0",
86-
"@testing-library/react": "^14.1.2",
87-
"@testing-library/react-hooks": "^8.0.1",
88-
"@types/node": "^20.11.6",
85+
"@testing-library/dom": "^10.1.0",
86+
"@testing-library/jest-dom": "^6.4.5",
87+
"@testing-library/react": "^16.0.0",
88+
"@types/node": "^20.14.2",
8989
"@types/prop-types": "^15.7.12",
90-
"@types/react": "18.2.25",
91-
"@typescript-eslint/eslint-plugin": "^6.17.0",
92-
"@typescript-eslint/parser": "^6.17.0",
90+
"@types/react": "18.3.3",
91+
"@types/react-dom": "^18.3.0",
9392
"babel-eslint": "^10.1.0",
94-
"codecov": "^3.8.0",
95-
"cross-env": "^7.0.2",
96-
"eslint": "^8.56.0",
93+
"codecov": "^3.8.3",
94+
"cross-env": "^7.0.3",
95+
"eslint": "^8.57.0",
9796
"eslint-config-prettier": "^9.1.0",
97+
"eslint-import-resolver-typescript": "^3.6.1",
9898
"eslint-plugin-import": "^2.29.1",
99-
"eslint-plugin-prettier": "^5.1.2",
100-
"eslint-plugin-react": "^7.33.2",
101-
"glob": "^7.1.6",
102-
"jsdom": "^24.0.0",
103-
"prettier": "^3.1.1",
104-
"react": "18.2.0",
105-
"react-dom": "18.2.0",
106-
"react-test-renderer": "18.0.0",
107-
"redux": "^5.0.0",
108-
"rimraf": "^3.0.2",
99+
"eslint-plugin-prettier": "^5.1.3",
100+
"eslint-plugin-react": "^7.34.2",
101+
"jsdom": "^24.1.0",
102+
"prettier": "^3.3.1",
103+
"react": "18.3.1",
104+
"react-dom": "18.3.1",
105+
"react-test-renderer": "18.3.1",
106+
"redux": "^5.0.1",
107+
"rimraf": "^5.0.7",
109108
"size-limit": "^11.1.4",
110-
"tsup": "^7.0.0",
109+
"tsup": "7.0.0",
111110
"typescript": "^5.4.5",
111+
"typescript-eslint": "^7.12.0",
112112
"vitest": "^1.6.0"
113113
},
114114
"packageManager": "[email protected]"

test/hooks/useDispatch.spec.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook } from '@testing-library/react-hooks'
1+
import { renderHook } from '@testing-library/react'
22
import React from 'react'
33
import type { ProviderProps, ReactReduxContextValue } from 'react-redux'
44
import {
@@ -32,7 +32,7 @@ describe('React', () => {
3232
const useCustomDispatch = createDispatchHook(nestedContext)
3333
const { result } = renderHook(() => useDispatch(), {
3434
// eslint-disable-next-line react/prop-types
35-
wrapper: ({ children, ...props }: ProviderProps) => (
35+
wrapper: ({ children, ...props }) => (
3636
<ProviderMock {...props} store={store}>
3737
<ProviderMock context={nestedContext} store={store2}>
3838
{children}
@@ -45,7 +45,7 @@ describe('React', () => {
4545

4646
const { result: result2 } = renderHook(() => useCustomDispatch(), {
4747
// eslint-disable-next-line react/prop-types
48-
wrapper: ({ children, ...props }: ProviderProps) => (
48+
wrapper: ({ children, ...props }) => (
4949
<ProviderMock {...props} store={store}>
5050
<ProviderMock context={nestedContext} store={store2}>
5151
{children}

test/hooks/useReduxContext.spec.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
createReduxContextHook,
33
useReduxContext,
44
} from '@internal/hooks/useReduxContext'
5-
import { renderHook } from '@testing-library/react-hooks'
5+
import { renderHook } from '@testing-library/react'
66
import { createContext } from 'react'
77
import type { ReactReduxContextValue } from 'react-redux'
88

@@ -12,12 +12,9 @@ describe('React', () => {
1212
it('throws if component is not wrapped in provider', () => {
1313
const spy = vi.spyOn(console, 'error').mockImplementation(() => {})
1414

15-
const { result } = renderHook(() => useReduxContext())
16-
17-
expect(result.error?.message).toMatch(
15+
expect(() => renderHook(() => useReduxContext())).toThrow(
1816
/could not find react-redux context value/,
1917
)
20-
2118
spy.mockRestore()
2219
})
2320
})
@@ -27,9 +24,7 @@ describe('React', () => {
2724
const useCustomReduxContext = createReduxContextHook(customContext)
2825
const spy = vi.spyOn(console, 'error').mockImplementation(() => {})
2926

30-
const { result } = renderHook(() => useCustomReduxContext())
31-
32-
expect(result.error?.message).toMatch(
27+
expect(() => renderHook(() => useCustomReduxContext())).toThrow(
3328
/could not find react-redux context value/,
3429
)
3530

test/typetests/connect-options-and-issues.test-d.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -786,11 +786,8 @@ describe('type tests', () => {
786786
// Should be able to pass modern refs to a ForwardRefExoticComponent
787787
const modernRef: React.Ref<string> | undefined = undefined
788788
;<ConnectedForwardedFunctionalComponent ref={modernRef} />
789-
// Should not be able to use legacy string refs
790-
;<ConnectedForwardedFunctionalComponent
791-
// @ts-expect-error
792-
ref={''}
793-
/>
789+
// Should be able to use legacy string refs
790+
;<ConnectedForwardedFunctionalComponent ref={''} />
794791
// ref type should agree with type of the forwarded ref
795792
;<ConnectedForwardedFunctionalComponent
796793
// @ts-expect-error

test/typetests/hooks.test-d.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ describe('type tests', () => {
224224

225225
const state = untypedStore.getState()
226226

227-
expectTypeOf(state).toBeObject()
227+
expectTypeOf(state).toBeUnknown()
228228

229229
const typedStore = useStore<TypedState, TypedAction>()
230230

0 commit comments

Comments
 (0)