Skip to content

Update build tooling for 2.0 #3902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16.x']
node: ['18.x']

steps:
- name: Checkout repo
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['16.x']
node: ['18.x']
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand Down Expand Up @@ -104,8 +104,8 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['16.x']
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2']
node: ['18.x']
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3']
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['16.x']
node: ['18.x']
example: ['cra4', 'cra5', 'next', 'vite', 'node-standard', 'node-esm']
defaults:
run:
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
run: yarn info @reduxjs/toolkit && yarn why @reduxjs/toolkit

- name: Build example
run: yarn build
run: NODE_OPTIONS=--openssl-legacy-provider yarn build

- name: Run test step
run: yarn test
Expand All @@ -197,7 +197,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['16.x']
node: ['18.x']
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"netlify-plugin-cache": "^1.0.3",
"prettier": "^2.2.1",
"release-it": "^14.12.5",
"serve": "^14.2.0"
"serve": "^14.2.0",
"typescript": "5.2"
},
"resolutions": {
"@babel/core": "7.19.3",
Expand All @@ -44,7 +45,7 @@
"@babel/helper-compilation-targets": "7.19.3",
"@babel/traverse": "7.19.3",
"@babel/types": "7.19.3",
"esbuild": "0.19.3",
"esbuild": "0.19.7",
"jest-snapshot": "29.3.1",
"msw": "patch:msw@npm:0.40.2#.yarn/patches/msw-npm-0.40.2-2107d48752",
"jscodeshift": "0.13.1",
Expand All @@ -65,7 +66,10 @@
"docs/@types/react-dom": "npm:17.0.11",
"docs/@types/react": "npm:17.0.11",
"type-fest": "2.19.0",
"[email protected]": "patch:console-testing-library@npm%3A0.6.1#./.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch"
"[email protected]": "patch:console-testing-library@npm%3A0.6.1#./.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch",
"@typescript-eslint/eslint-plugin": "6.12.0",
"@typescript-eslint/parser": "6.12.0",
"typescript": "5.2.2"
},
"scripts": {
"build": "yarn build:packages",
Expand Down
10 changes: 5 additions & 5 deletions packages/rtk-query-graphql-request-base-query/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isPlainObject } from '@reduxjs/toolkit'
import type { BaseQueryFn } from '@reduxjs/toolkit/query'
import type { DocumentNode } from 'graphql'
import { GraphQLClient, ClientError } from 'graphql-request'
import { GraphQLClient, ClientError, RequestOptions } from 'graphql-request'
import type {
ErrorResponse,
GraphqlRequestBaseQueryArgs,
Expand Down Expand Up @@ -43,7 +43,7 @@ export const graphqlRequestBaseQuery = <E = ErrorResponse>(
data: await client.request({
document,
variables,
signal,
signal: signal as unknown as RequestOptions['signal'],
requestHeaders: preparedHeaders,
}),
meta: {},
Expand All @@ -52,10 +52,10 @@ export const graphqlRequestBaseQuery = <E = ErrorResponse>(
if (error instanceof ClientError) {
const { name, message, stack, request, response } = error

const customErrors =
options.customErrors ?? (() => ({ name, message, stack }));
const customErrors =
options.customErrors ?? (() => ({ name, message, stack }))

const customizedErrors = customErrors(error) as E;
const customizedErrors = customErrors(error) as E

return { error: customizedErrors, meta: { request, response } }
}
Expand Down
8 changes: 3 additions & 5 deletions packages/toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,17 @@
"@size-limit/preset-small-lib": "^4.11.0",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.1.5",
"@types/convert-source-map": "^1.5.1",
"@types/json-stringify-safe": "^5.0.0",
"@types/nanoid": "^2.1.0",
"@types/node": "^10.14.4",
"@types/query-string": "^6.3.0",
"@types/react": "^18.0.12",
"@types/react-dom": "^18.0.5",
"@types/yargs": "^16.0.1",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"@typescript-eslint/eslint-plugin": "^6",
"@typescript-eslint/parser": "^6",
"axios": "^0.19.2",
"console-testing-library": "0.6.1",
"convert-source-map": "^1.7.0",
"esbuild-extra": "^0.3.1",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -91,7 +89,7 @@
"tslib": "^1.10.0",
"tsup": "^7.2.0",
"tsx": "^3.12.2",
"typescript": "~4.9",
"typescript": "5.2",
"vitest": "^0.30.1",
"yargs": "^15.3.1"
},
Expand Down
9 changes: 9 additions & 0 deletions packages/toolkit/src/query/tests/devWarnings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ describe('warns on multiple apis using the same `reducerPath`', () => {
test('common: two apis, same order', async () => {
const store = configureStore({
reducer: {
// TS 5.3 now errors on identical object keys. We want to force that behavior.
// @ts-ignore
[api1.reducerPath]: api1.reducer,
// @ts-ignore
[api1_2.reducerPath]: api1_2.reducer,
},
middleware: (gDM) => gDM().concat(api1.middleware, api1_2.middleware),
Expand All @@ -222,7 +225,9 @@ If you have multiple apis, you *have* to specify the reducerPath option when usi
test('common: two apis, opposing order', async () => {
const store = configureStore({
reducer: {
// @ts-ignore
[api1.reducerPath]: api1.reducer,
// @ts-ignore
[api1_2.reducerPath]: api1_2.reducer,
},
middleware: (gDM) => gDM().concat(api1_2.middleware, api1.middleware),
Expand All @@ -242,7 +247,9 @@ If you have multiple apis, you *have* to specify the reducerPath option when usi
test('common: two apis, only first middleware', async () => {
const store = configureStore({
reducer: {
// @ts-ignore
[api1.reducerPath]: api1.reducer,
// @ts-ignore
[api1_2.reducerPath]: api1_2.reducer,
},
middleware: (gDM) => gDM().concat(api1.middleware),
Expand All @@ -266,7 +273,9 @@ If you have multiple apis, you *have* to specify the reducerPath option when usi
test.skip('common: two apis, only second middleware', async () => {
const store = configureStore({
reducer: {
// @ts-ignore
[api1.reducerPath]: api1.reducer,
// @ts-ignore
[api1_2.reducerPath]: api1_2.reducer,
},
middleware: (gDM) => gDM().concat(api1_2.middleware),
Expand Down
Loading