Skip to content

Commit b4727a5

Browse files
committed
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit into remove-rtk-github-issues-example-sandbox
2 parents 631ac39 + 171f9e0 commit b4727a5

File tree

6 files changed

+73
-75
lines changed

6 files changed

+73
-75
lines changed

examples/query/react/pagination/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
"msw": "^0.40.2",
1717
"react": "^18.1.0",
1818
"react-dom": "^18.1.0",
19-
"react-icons": "3.11.0",
19+
"react-icons": "^5.0.1",
2020
"react-redux": "^9.1.0",
21-
"react-router-dom": "6.3.0",
2221
"react-scripts": "5.0.1"
2322
},
2423
"devDependencies": {

examples/query/react/pagination/public/mockServiceWorker.js

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
/* eslint-disable */
2+
/* tslint:disable */
3+
14
/**
2-
* Mock Service Worker.
5+
* Mock Service Worker (0.40.2).
36
* @see https://github.com/mswjs/msw
47
* - Please do NOT modify this file.
58
* - Please do NOT serve this file on production.
69
*/
7-
/* eslint-disable */
8-
/* tslint:disable */
910

10-
const INTEGRITY_CHECKSUM = '82ef9b96d8393b6da34527d1d6e19187'
11+
const INTEGRITY_CHECKSUM = '02f4ad4a2797f85668baf196e553d929'
1112
const bypassHeaderName = 'x-msw-bypass'
1213
const activeClientIds = new Set()
1314

@@ -82,11 +83,11 @@ self.addEventListener('message', async function (event) {
8283
}
8384
})
8485

85-
// Resolve the "master" client for the given event.
86+
// Resolve the "main" client for the given event.
8687
// Client that issues a request doesn't necessarily equal the client
8788
// that registered the worker. It's with the latter the worker should
8889
// communicate with during the response resolving phase.
89-
async function resolveMasterClient(event) {
90+
async function resolveMainClient(event) {
9091
const client = await self.clients.get(event.clientId)
9192

9293
if (client.frameType === 'top-level') {
@@ -108,7 +109,7 @@ async function resolveMasterClient(event) {
108109
}
109110

110111
async function handleRequest(event, requestId) {
111-
const client = await resolveMasterClient(event)
112+
const client = await resolveMainClient(event)
112113
const response = await getResponse(event, client, requestId)
113114

114115
// Send back the response clone for the "response:*" life-cycle events.
@@ -220,13 +221,11 @@ async function getResponse(event, client, requestId) {
220221

221222
console.error(
222223
`\
223-
[MSW] Request handler function for "%s %s" has thrown the following exception:
224+
[MSW] Uncaught exception in the request handler for "%s %s":
224225
225-
${parsedBody.errorType}: ${parsedBody.message}
226-
(see more detailed error stack trace in the mocked response body)
226+
${parsedBody.location}
227227
228-
This exception has been gracefully handled as a 500 response, however, it's strongly recommended to resolve this error.
229-
If you wish to mock an error response, please refer to this guide: https://mswjs.io/docs/recipes/mocking-error-responses\
228+
This exception has been gracefully handled as a 500 response, however, it's strongly recommended to resolve this error, as it indicates a mistake in your code. If you wish to mock an error response, please see this guide: https://mswjs.io/docs/recipes/mocking-error-responses\
230229
`,
231230
request.method,
232231
request.url,
@@ -241,6 +240,12 @@ If you wish to mock an error response, please refer to this guide: https://mswjs
241240

242241
self.addEventListener('fetch', function (event) {
243242
const { request } = event
243+
const accept = request.headers.get('accept') || ''
244+
245+
// Bypass server-sent events.
246+
if (accept.includes('text/event-stream')) {
247+
return
248+
}
244249

245250
// Bypass navigation requests.
246251
if (request.mode === 'navigate') {
@@ -264,11 +269,22 @@ self.addEventListener('fetch', function (event) {
264269

265270
return event.respondWith(
266271
handleRequest(event, requestId).catch((error) => {
272+
if (error.name === 'NetworkError') {
273+
console.warn(
274+
'[MSW] Successfully emulated a network error for the "%s %s" request.',
275+
request.method,
276+
request.url,
277+
)
278+
return
279+
}
280+
281+
// At this point, any exception indicates an issue with the original request/response.
267282
console.error(
268-
'[MSW] Failed to mock a "%s" request to "%s": %s',
283+
`\
284+
[MSW] Caught an exception from the "%s %s" request (%s). This is probably not a problem with Mock Service Worker. There is likely an additional logging output above.`,
269285
request.method,
270286
request.url,
271-
error,
287+
`${error.name}: ${error.message}`,
272288
)
273289
}),
274290
)

examples/query/react/pagination/src/App.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { Route, Routes } from 'react-router-dom'
21
import { PostsManager } from './features/posts/PostsManager'
32

43
function App() {
54
return (
6-
<Routes>
7-
<Route path="*" element={<PostsManager />} />
8-
</Routes>
5+
<PostsManager />
96
)
107
}
118

examples/query/react/pagination/src/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import App from './App'
44
import { api } from './app/services/posts'
55
import { ChakraProvider } from '@chakra-ui/react'
66

7-
import { BrowserRouter } from 'react-router-dom'
87
import { worker } from './mocks/browser'
98
import { ApiProvider } from '@reduxjs/toolkit/query/react'
109

@@ -14,9 +13,7 @@ worker.start({ quiet: true }).then(() =>
1413
<React.StrictMode>
1514
<ApiProvider api={api}>
1615
<ChakraProvider>
17-
<BrowserRouter>
1816
<App />
19-
</BrowserRouter>
2017
</ChakraProvider>
2118
</ApiProvider>
2219
</React.StrictMode>,

packages/rtk-query-codegen-openapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"msw": "^2.1.5",
5050
"node-fetch": "^3.3.2",
5151
"openapi-types": "^9.1.0",
52-
"pretty-quick": "^3.1.0",
52+
"pretty-quick": "^4.0.0",
5353
"rimraf": "^5.0.5",
5454
"ts-node": "^10.9.2",
5555
"vitest": "^1.2.2",

yarn.lock

Lines changed: 40 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5444,9 +5444,8 @@ __metadata:
54445444
msw: "npm:^0.40.2"
54455445
react: "npm:^18.1.0"
54465446
react-dom: "npm:^18.1.0"
5447-
react-icons: "npm:3.11.0"
5447+
react-icons: "npm:^5.0.1"
54485448
react-redux: "npm:^9.1.0"
5449-
react-router-dom: "npm:6.3.0"
54505449
react-scripts: "npm:5.0.1"
54515450
typescript: "npm:~4.9"
54525451
languageName: unknown
@@ -7620,7 +7619,7 @@ __metadata:
76207619
oazapfts: "npm:^4.8.0"
76217620
openapi-types: "npm:^9.1.0"
76227621
prettier: "npm:^3.2.5"
7623-
pretty-quick: "npm:^3.1.0"
7622+
pretty-quick: "npm:^4.0.0"
76247623
rimraf: "npm:^5.0.5"
76257624
semver: "npm:^7.3.5"
76267625
swagger2openapi: "npm:^7.0.4"
@@ -8707,13 +8706,6 @@ __metadata:
87078706
languageName: node
87088707
linkType: hard
87098708

8710-
"@types/minimatch@npm:^3.0.3":
8711-
version: 3.0.5
8712-
resolution: "@types/minimatch@npm:3.0.5"
8713-
checksum: 10/c41d136f67231c3131cf1d4ca0b06687f4a322918a3a5adddc87ce90ed9dbd175a3610adee36b106ae68c0b92c637c35e02b58c8a56c424f71d30993ea220b92
8714-
languageName: node
8715-
linkType: hard
8716-
87178709
"@types/nanoid@npm:^2.1.0":
87188710
version: 2.1.0
87198711
resolution: "@types/nanoid@npm:2.1.0"
@@ -10610,13 +10602,6 @@ __metadata:
1061010602
languageName: node
1061110603
linkType: hard
1061210604

10613-
"array-differ@npm:^3.0.0":
10614-
version: 3.0.0
10615-
resolution: "array-differ@npm:3.0.0"
10616-
checksum: 10/117edd9df5c1530bd116c6e8eea891d4bd02850fd89b1b36e532b6540e47ca620a373b81feca1c62d1395d9ae601516ba538abe5e8172d41091da2c546b05fb7
10617-
languageName: node
10618-
linkType: hard
10619-
1062010605
"array-flatten@npm:1.1.1":
1062110606
version: 1.1.1
1062210607
resolution: "array-flatten@npm:1.1.1"
@@ -10675,13 +10660,6 @@ __metadata:
1067510660
languageName: node
1067610661
linkType: hard
1067710662

10678-
"arrify@npm:^2.0.1":
10679-
version: 2.0.1
10680-
resolution: "arrify@npm:2.0.1"
10681-
checksum: 10/067c4c1afd182806a82e4c1cb8acee16ab8b5284fbca1ce29408e6e91281c36bb5b612f6ddfbd40a0f7a7e0c75bf2696eb94c027f6e328d6e9c52465c98e4209
10682-
languageName: node
10683-
linkType: hard
10684-
1068510663
"asap@npm:~2.0.3, asap@npm:~2.0.6":
1068610664
version: 2.0.6
1068710665
resolution: "asap@npm:2.0.6"
@@ -15235,7 +15213,7 @@ __metadata:
1523515213
languageName: node
1523615214
linkType: hard
1523715215

15238-
"execa@npm:^4.0.0, execa@npm:^4.0.2":
15216+
"execa@npm:^4.0.2":
1523915217
version: 4.1.0
1524015218
resolution: "execa@npm:4.1.0"
1524115219
dependencies:
@@ -17329,6 +17307,13 @@ __metadata:
1732917307
languageName: node
1733017308
linkType: hard
1733117309

17310+
"ignore@npm:^5.3.0":
17311+
version: 5.3.1
17312+
resolution: "ignore@npm:5.3.1"
17313+
checksum: 10/0a884c2fbc8c316f0b9f92beaf84464253b73230a4d4d286697be45fca081199191ca33e1c2e82d9e5f851f5e9a48a78e25a35c951e7eb41e59f150db3530065
17314+
languageName: node
17315+
linkType: hard
17316+
1733217317
"image-size@npm:^1.0.1":
1733317318
version: 1.0.1
1733417319
resolution: "image-size@npm:1.0.1"
@@ -20688,7 +20673,7 @@ __metadata:
2068820673
languageName: node
2068920674
linkType: hard
2069020675

20691-
"mri@npm:^1.1.0, mri@npm:^1.1.5":
20676+
"mri@npm:^1.1.0, mri@npm:^1.2.0":
2069220677
version: 1.2.0
2069320678
resolution: "mri@npm:1.2.0"
2069420679
checksum: 10/6775a1d2228bb9d191ead4efc220bd6be64f943ad3afd4dcb3b3ac8fc7b87034443f666e38805df38e8d047b29f910c3cc7810da0109af83e42c82c73bd3f6bc
@@ -20856,19 +20841,6 @@ __metadata:
2085620841
languageName: node
2085720842
linkType: hard
2085820843

20859-
"multimatch@npm:^4.0.0":
20860-
version: 4.0.0
20861-
resolution: "multimatch@npm:4.0.0"
20862-
dependencies:
20863-
"@types/minimatch": "npm:^3.0.3"
20864-
array-differ: "npm:^3.0.0"
20865-
array-union: "npm:^2.1.0"
20866-
arrify: "npm:^2.0.1"
20867-
minimatch: "npm:^3.0.4"
20868-
checksum: 10/bdb6a98dad4e919d9a1a2a0db872f44fa2337315f2fd5827d91ae005cf22f4425782bdfa97c10b80d567f0cb3c226c31f4e85f8f6a4a4be4facf9af0de1bb0c2
20869-
languageName: node
20870-
linkType: hard
20871-
2087220844
"mute-stream@npm:0.0.8":
2087320845
version: 0.0.8
2087420846
resolution: "mute-stream@npm:0.0.8"
@@ -22199,6 +22171,13 @@ __metadata:
2219922171
languageName: node
2220022172
linkType: hard
2220122173

22174+
"picomatch@npm:^3.0.1":
22175+
version: 3.0.1
22176+
resolution: "picomatch@npm:3.0.1"
22177+
checksum: 10/65ac837fedbd0640586f7c214f6c7481e1e12f41cdcd22a95eb6a2914d1773707ed0f0b5bd2d1e39b5ec7860b43a4c9150152332a3884cd8dd1d419b2a2fa5b5
22178+
languageName: node
22179+
linkType: hard
22180+
2220222181
"pify@npm:^2.3.0":
2220322182
version: 2.3.0
2220422183
resolution: "pify@npm:2.3.0"
@@ -23719,21 +23698,22 @@ __metadata:
2371923698
languageName: node
2372023699
linkType: hard
2372123700

23722-
"pretty-quick@npm:^3.1.0":
23723-
version: 3.1.1
23724-
resolution: "pretty-quick@npm:3.1.1"
23701+
"pretty-quick@npm:^4.0.0":
23702+
version: 4.0.0
23703+
resolution: "pretty-quick@npm:4.0.0"
2372523704
dependencies:
23726-
chalk: "npm:^3.0.0"
23727-
execa: "npm:^4.0.0"
23728-
find-up: "npm:^4.1.0"
23729-
ignore: "npm:^5.1.4"
23730-
mri: "npm:^1.1.5"
23731-
multimatch: "npm:^4.0.0"
23705+
execa: "npm:^5.1.1"
23706+
find-up: "npm:^5.0.0"
23707+
ignore: "npm:^5.3.0"
23708+
mri: "npm:^1.2.0"
23709+
picocolors: "npm:^1.0.0"
23710+
picomatch: "npm:^3.0.1"
23711+
tslib: "npm:^2.6.2"
2373223712
peerDependencies:
23733-
prettier: ">=2.0.0"
23713+
prettier: ^3.0.0
2373423714
bin:
23735-
pretty-quick: bin/pretty-quick.js
23736-
checksum: 10/28a64c9104aa74a9a259e4e8eee84169486342cf0b4d80aa230954b4676b79174bf74b14cac2f074e4e775465296c2632f3365506a1668aa20a0d96a39979512
23715+
pretty-quick: lib/cli.mjs
23716+
checksum: 10/df92a7ff9a485beb1d47d59c2a2ccb73f753e0133c59e99c56f3ded473fcf75b442fd9e4d53df13fd586c45bbc3e161531bd9d790f7d50f8d0b0a28fbd95c4a3
2373723717
languageName: node
2373823718
linkType: hard
2373923719

@@ -24183,6 +24163,15 @@ __metadata:
2418324163
languageName: node
2418424164
linkType: hard
2418524165

24166+
"react-icons@npm:^5.0.1":
24167+
version: 5.0.1
24168+
resolution: "react-icons@npm:5.0.1"
24169+
peerDependencies:
24170+
react: "*"
24171+
checksum: 10/c4458c643ae32a793ddebc5fa1235c7ec051be1b131205510e8199d15a4c89221a501f95a71fa21c2da93e8dd225290e2e24bb80abd3fb85801e43009e692098
24172+
languageName: node
24173+
linkType: hard
24174+
2418624175
"react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.7.0":
2418724176
version: 16.13.1
2418824177
resolution: "react-is@npm:16.13.1"

0 commit comments

Comments
 (0)