Commit 40b8aed
Migrate to React 19 (#4409)
* Update `react-redux` to 9.1.2
* Run tests against different versions of React during CI
* Remove unnecessary `tick` and `runAllTimers` from `cleanup.test.tsx`
* Remove redundant `act` wrappers around `fireEvent` method calls
- According to latest documentation of `@testing-library/react`, `fireEvent` methods are already wrapped inside `act` calls making manual wrapping unnecessary.
* Workaround issue `userEvent` not working with fake timers
- There currently seems to be an issue involving `sinon` fake timers used by `vitest`, `@testing-library/react` only supporting `jest` fake timers and `@testing-library/user-event` using `setTimeout` internally to simulate user actions such as button presses. Currently `@testing-library/react` only works with `jest` fake timers, which means if there are any component updates while `sinon` fake timers are running in `vitest` , `@testing-library/react` will not catch it and things start to break.
- To workaround this issue, We have to setup the `user` by calling `userEvent.setup({ delay: null })`. The reason why We do this is because `@testing-library/user-event` uses `setTimeout` internally which cannot be awaited in a test while fake timers are running as it can cause the tests to indefinitely hang. So the current workaround is to disable the `delay` functionality of `userEvent` and prevent it from calling `setTimeout`. We also have to pass in `shouldAdvanceTime: true` to `vi.useFakeTimers()` as it can get around the issue of `@testing-library/react` not tracking `sinon` fake timers in `vitest`.
* Fix test names in `fork.test.ts`
- Fixed test names in `fork.test.ts` which could cause the terminal to flicker in Windows.
* Fix issue with `console` spy inside `buildHooks.test.tsx`
- `.mockReset()` should not be called in spies since it calls `.mockClear()` and returns the implementation to its **initial** form. In this case it was silencing some of the `act` related warnings emitted by `@testing-library/react` which needed to be resolved since they were calling issues. So `.mockReset()` calls on spies need to be changed to `.mockRestore()` calls since `.mockRestore()` restores the implementation to its **original** form.
* Fix `act` related issues in `buildHooks.test.tsx`
* Fix issues related to spies and stubbing environments in `utils.spec.ts`
* Fix `console` spy related issues in `effectScenarios.test.ts`
* Fix `console` spy related issues in `listenerMiddleware.test.ts`
* Fix `console` spy related issues in `createApi.test.ts`
* Fix wrong `test.each` and `describe.each` calls
* Fix `console` spy related issues in `devWarnings.test.tsx`
* Fix `console` spy related issues in `injectEndpoints.test.tsx`
* Fix issue with test names in `queryFn.test.tsx`
* Migrate docs to React 19
* Update `peerDependencies` of toolkit to include React v19
* Update React and React-DOM to the new rc version
* Fix issues related to `console` spies in `createAsyncThunk.test.ts`
* Fix issues related to stubbing envs in `createAsyncThunk.test.ts`
* Fix issues related to `console` spies in `createReducer.test.ts`
* Fix issues related to stubbing envs in `createReducer.test.ts`
* Fix issues related to `console` spies in `createSlice.test.ts`
* Fix issues related to stubbing envs in `createSlice.test.ts`
* Fix issues related to `console` spies in `immutableStateInvariantMiddleware.test.ts`
* Fix issues related to `console` spies in `serializableStateInvariantMiddleware.test.ts`
* Change `.toHaveBeenCalledTimes(1)` to `.toHaveBeenCalledOnce()`
* Change `.toHaveBeenCalledTimes(0)` to `.not.toHaveBeenCalled()`
* Set `@types/react` and `@types/react-dom` to temporary types packages
- We set the `@types/react` and `@types/react-dom` package resolutions to `npm:types-react` and `npm:types-react-dom` according to the React 19 migration guide.
* Add `areErrorsEqual` equality tester
- This was done to make sure `toHaveBeenCalledWith` will fail if we pass in the wrong Error constructor. For example the assertion will now fail if we pass in an `Error` instead of a `TypeError`.
* Fix `console` spy related issues in `fakeBaseQuery.test.tsx`
* Fix `console` spy related issues in `queryFn.test.tsx`
* Remove `satisfies` operators in `queryFn.test.tsx`
* Remove `jest-snapshot` from `resolutions` field
- This was done because it was causing the unit tests in example workspaces to fail.
* Remove `console-testing-library` as it is no longer needed
* Fix minor JSX related type issues
* Bump `jsdom` to version 25.0.1
* Bump `@testing-library/react` to version 16.1.0
* Properly `await` assertion in `tests/fork.test.ts`
* Properly `await` assertion in `src/query/tests/errorHandling.test.tsx`
* Migrate to React 19
* Bump TS version in website
---------
Co-authored-by: Mark Erikson <[email protected]>1 parent e848a55 commit 40b8aed
File tree
59 files changed
+10807
-8025
lines changed- .github/workflows
- .yarn/patches
- docs
- tutorials
- usage
- examples
- action-listener/counter
- query/react
- advanced
- authentication-with-extrareducers
- authentication
- basic
- conditional-fetching
- deduping-queries
- graphql-codegen
- graphql
- kitchen-sink
- mutations
- optimistic-update
- pagination
- polling
- prefetching-automatic-waterfall
- prefetching-automatic
- prefetching
- with-apiprovider
- type-portability
- bundler
- nodenext-cjs
- nodenext-esm
- packages/toolkit
- src
- entities/tests
- listenerMiddleware/tests
- query/tests
- tests
- utils
- website
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
59 files changed
+10807
-8025
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
72 | 86 | | |
73 | 87 | | |
74 | 88 | | |
| |||
82 | 96 | | |
83 | 97 | | |
84 | 98 | | |
85 | | - | |
| 99 | + | |
| 100 | + | |
86 | 101 | | |
87 | 102 | | |
88 | 103 | | |
89 | 104 | | |
90 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
91 | 110 | | |
92 | 111 | | |
93 | 112 | | |
94 | 113 | | |
95 | | - | |
| 114 | + | |
| 115 | + | |
96 | 116 | | |
97 | 117 | | |
98 | 118 | | |
| |||
103 | 123 | | |
104 | 124 | | |
105 | 125 | | |
106 | | - | |
| 126 | + | |
107 | 127 | | |
108 | 128 | | |
109 | 129 | | |
| |||
112 | 132 | | |
113 | 133 | | |
114 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
115 | 149 | | |
116 | 150 | | |
117 | 151 | | |
| |||
125 | 159 | | |
126 | 160 | | |
127 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
128 | 165 | | |
129 | 166 | | |
130 | 167 | | |
| |||
139 | 176 | | |
140 | 177 | | |
141 | 178 | | |
142 | | - | |
| 179 | + | |
| 180 | + | |
143 | 181 | | |
144 | 182 | | |
145 | 183 | | |
| |||
Lines changed: 0 additions & 68 deletions
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
| |||
214 | 223 | | |
215 | 224 | | |
216 | 225 | | |
217 | | - | |
| 226 | + | |
218 | 227 | | |
219 | 228 | | |
220 | 229 | | |
221 | 230 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
229 | 247 | | |
230 | 248 | | |
231 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
166 | 174 | | |
167 | 175 | | |
168 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1041 | 1041 | | |
1042 | 1042 | | |
1043 | 1043 | | |
| 1044 | + | |
1044 | 1045 | | |
1045 | 1046 | | |
1046 | 1047 | | |
| |||
1078 | 1079 | | |
1079 | 1080 | | |
1080 | 1081 | | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
1089 | 1099 | | |
1090 | 1100 | | |
1091 | 1101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments