Skip to content

Commit 6778062

Browse files
authored
Merge pull request #3902 from reduxjs/feature/2.0-ci-node18
2 parents 3dcd73b + 32898c4 commit 6778062

File tree

6 files changed

+281
-390
lines changed

6 files changed

+281
-390
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131
strategy:
3232
matrix:
33-
node: ['16.x']
33+
node: ['18.x']
3434

3535
steps:
3636
- name: Checkout repo
@@ -67,7 +67,7 @@ jobs:
6767
strategy:
6868
fail-fast: false
6969
matrix:
70-
node: ['16.x']
70+
node: ['18.x']
7171
steps:
7272
- name: Checkout repo
7373
uses: actions/checkout@v2
@@ -104,8 +104,8 @@ jobs:
104104
strategy:
105105
fail-fast: false
106106
matrix:
107-
node: ['16.x']
108-
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2']
107+
node: ['18.x']
108+
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3']
109109
steps:
110110
- name: Checkout repo
111111
uses: actions/checkout@v2
@@ -148,7 +148,7 @@ jobs:
148148
strategy:
149149
fail-fast: false
150150
matrix:
151-
node: ['16.x']
151+
node: ['18.x']
152152
example: ['cra4', 'cra5', 'next', 'vite', 'node-standard', 'node-esm']
153153
defaults:
154154
run:
@@ -184,7 +184,7 @@ jobs:
184184
run: yarn info @reduxjs/toolkit && yarn why @reduxjs/toolkit
185185

186186
- name: Build example
187-
run: yarn build
187+
run: NODE_OPTIONS=--openssl-legacy-provider yarn build
188188

189189
- name: Run test step
190190
run: yarn test
@@ -197,7 +197,7 @@ jobs:
197197
strategy:
198198
fail-fast: false
199199
matrix:
200-
node: ['16.x']
200+
node: ['18.x']
201201
steps:
202202
- name: Checkout repo
203203
uses: actions/checkout@v2

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"netlify-plugin-cache": "^1.0.3",
3636
"prettier": "^2.2.1",
3737
"release-it": "^14.12.5",
38-
"serve": "^14.2.0"
38+
"serve": "^14.2.0",
39+
"typescript": "5.2"
3940
},
4041
"resolutions": {
4142
"@babel/core": "7.19.3",
@@ -44,7 +45,7 @@
4445
"@babel/helper-compilation-targets": "7.19.3",
4546
"@babel/traverse": "7.19.3",
4647
"@babel/types": "7.19.3",
47-
"esbuild": "0.19.3",
48+
"esbuild": "0.19.7",
4849
"jest-snapshot": "29.3.1",
4950
"msw": "patch:msw@npm:0.40.2#.yarn/patches/msw-npm-0.40.2-2107d48752",
5051
"jscodeshift": "0.13.1",
@@ -65,7 +66,10 @@
6566
"docs/@types/react-dom": "npm:17.0.11",
6667
"docs/@types/react": "npm:17.0.11",
6768
"type-fest": "2.19.0",
68-
"console-testing-library@0.6.1": "patch:console-testing-library@npm%3A0.6.1#./.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch"
69+
"console-testing-library@0.6.1": "patch:console-testing-library@npm%3A0.6.1#./.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch",
70+
"@typescript-eslint/eslint-plugin": "6.12.0",
71+
"@typescript-eslint/parser": "6.12.0",
72+
"typescript": "5.2.2"
6973
},
7074
"scripts": {
7175
"build": "yarn build:packages",

packages/rtk-query-graphql-request-base-query/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isPlainObject } from '@reduxjs/toolkit'
22
import type { BaseQueryFn } from '@reduxjs/toolkit/query'
33
import type { DocumentNode } from 'graphql'
4-
import { GraphQLClient, ClientError } from 'graphql-request'
4+
import { GraphQLClient, ClientError, RequestOptions } from 'graphql-request'
55
import type {
66
ErrorResponse,
77
GraphqlRequestBaseQueryArgs,
@@ -43,7 +43,7 @@ export const graphqlRequestBaseQuery = <E = ErrorResponse>(
4343
data: await client.request({
4444
document,
4545
variables,
46-
signal,
46+
signal: signal as unknown as RequestOptions['signal'],
4747
requestHeaders: preparedHeaders,
4848
}),
4949
meta: {},
@@ -52,10 +52,10 @@ export const graphqlRequestBaseQuery = <E = ErrorResponse>(
5252
if (error instanceof ClientError) {
5353
const { name, message, stack, request, response } = error
5454

55-
const customErrors =
56-
options.customErrors ?? (() => ({ name, message, stack }));
55+
const customErrors =
56+
options.customErrors ?? (() => ({ name, message, stack }))
5757

58-
const customizedErrors = customErrors(error) as E;
58+
const customizedErrors = customErrors(error) as E
5959

6060
return { error: customizedErrors, meta: { request, response } }
6161
}

packages/toolkit/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,17 @@
5555
"@size-limit/preset-small-lib": "^4.11.0",
5656
"@testing-library/react": "^13.3.0",
5757
"@testing-library/user-event": "^13.1.5",
58-
"@types/convert-source-map": "^1.5.1",
5958
"@types/json-stringify-safe": "^5.0.0",
6059
"@types/nanoid": "^2.1.0",
6160
"@types/node": "^10.14.4",
6261
"@types/query-string": "^6.3.0",
6362
"@types/react": "^18.0.12",
6463
"@types/react-dom": "^18.0.5",
6564
"@types/yargs": "^16.0.1",
66-
"@typescript-eslint/eslint-plugin": "^4.22.0",
67-
"@typescript-eslint/parser": "^4.22.0",
65+
"@typescript-eslint/eslint-plugin": "^6",
66+
"@typescript-eslint/parser": "^6",
6867
"axios": "^0.19.2",
6968
"console-testing-library": "0.6.1",
70-
"convert-source-map": "^1.7.0",
7169
"esbuild-extra": "^0.3.1",
7270
"eslint": "^7.25.0",
7371
"eslint-config-prettier": "^8.3.0",
@@ -91,7 +89,7 @@
9189
"tslib": "^1.10.0",
9290
"tsup": "^7.2.0",
9391
"tsx": "^3.12.2",
94-
"typescript": "~4.9",
92+
"typescript": "5.2",
9593
"vitest": "^0.30.1",
9694
"yargs": "^15.3.1"
9795
},

packages/toolkit/src/query/tests/devWarnings.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ describe('warns on multiple apis using the same `reducerPath`', () => {
205205
test('common: two apis, same order', async () => {
206206
const store = configureStore({
207207
reducer: {
208+
// TS 5.3 now errors on identical object keys. We want to force that behavior.
209+
// @ts-ignore
208210
[api1.reducerPath]: api1.reducer,
211+
// @ts-ignore
209212
[api1_2.reducerPath]: api1_2.reducer,
210213
},
211214
middleware: (gDM) => gDM().concat(api1.middleware, api1_2.middleware),
@@ -222,7 +225,9 @@ If you have multiple apis, you *have* to specify the reducerPath option when usi
222225
test('common: two apis, opposing order', async () => {
223226
const store = configureStore({
224227
reducer: {
228+
// @ts-ignore
225229
[api1.reducerPath]: api1.reducer,
230+
// @ts-ignore
226231
[api1_2.reducerPath]: api1_2.reducer,
227232
},
228233
middleware: (gDM) => gDM().concat(api1_2.middleware, api1.middleware),
@@ -242,7 +247,9 @@ If you have multiple apis, you *have* to specify the reducerPath option when usi
242247
test('common: two apis, only first middleware', async () => {
243248
const store = configureStore({
244249
reducer: {
250+
// @ts-ignore
245251
[api1.reducerPath]: api1.reducer,
252+
// @ts-ignore
246253
[api1_2.reducerPath]: api1_2.reducer,
247254
},
248255
middleware: (gDM) => gDM().concat(api1.middleware),
@@ -266,7 +273,9 @@ If you have multiple apis, you *have* to specify the reducerPath option when usi
266273
test.skip('common: two apis, only second middleware', async () => {
267274
const store = configureStore({
268275
reducer: {
276+
// @ts-ignore
269277
[api1.reducerPath]: api1.reducer,
278+
// @ts-ignore
270279
[api1_2.reducerPath]: api1_2.reducer,
271280
},
272281
middleware: (gDM) => gDM().concat(api1_2.middleware),

0 commit comments

Comments
 (0)