Skip to content

Commit 13ae28b

Browse files
authored
Merge pull request #4255 from aryaemami59/update-ts-to-5.4
2 parents 2283987 + 6cfeb58 commit 13ae28b

File tree

6 files changed

+55
-12
lines changed

6 files changed

+55
-12
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
fail-fast: false
107107
matrix:
108108
node: ['20.x']
109-
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3']
109+
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3', '5.4']
110110
steps:
111111
- name: Checkout repo
112112
uses: actions/checkout@v4

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"release-it": "^14.12.5",
5151
"serve": "^14.2.0",
5252
"ts-node": "^10.9.2",
53-
"typescript": "^5.2.2"
53+
"typescript": "^5.4.3"
5454
},
5555
"resolutions": {
5656
"esbuild": "0.19.7",

packages/toolkit/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"tslib": "^1.10.0",
9191
"tsup": "^7.2.0",
9292
"tsx": "^3.12.2",
93-
"typescript": "^5.3.3",
93+
"typescript": "^5.4.5",
9494
"vite-tsconfig-paths": "^4.3.1",
9595
"vitest": "^1.1.3",
9696
"yargs": "^15.3.1"

packages/toolkit/src/createAsyncThunk.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const miniSerializeError = (value: any): SerializedError => {
116116

117117
export type AsyncThunkConfig = {
118118
state?: unknown
119-
dispatch?: Dispatch
119+
dispatch?: ThunkDispatch<unknown, unknown, UnknownAction>
120120
extra?: unknown
121121
rejectValue?: unknown
122122
serializedErrorType?: unknown
@@ -240,7 +240,7 @@ export type AsyncThunkAction<
240240
ThunkArg,
241241
ThunkApiConfig extends AsyncThunkConfig,
242242
> = (
243-
dispatch: GetDispatch<ThunkApiConfig>,
243+
dispatch: NonNullable<GetDispatch<ThunkApiConfig>>,
244244
getState: () => GetState<ThunkApiConfig>,
245245
extra: GetExtra<ThunkApiConfig>,
246246
) => SafePromise<
@@ -577,7 +577,7 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
577577

578578
function actionCreator(
579579
arg: ThunkArg,
580-
): AsyncThunkAction<Returned, ThunkArg, ThunkApiConfig> {
580+
): AsyncThunkAction<Returned, ThunkArg, Required<ThunkApiConfig>> {
581581
return (dispatch, getState, extra) => {
582582
const requestId = options?.idGenerator
583583
? options.idGenerator(arg)

packages/toolkit/src/tests/createReducer.test-d.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,13 @@ describe('type tests', () => {
4343

4444
// @ts-expect-error
4545
createReducer<string>(0 as number, (builder) => {
46-
// @ts-expect-error
47-
builder
48-
.addCase('increment', incrementHandler)
49-
.addCase('decrement', decrementHandler)
46+
expectTypeOf(builder.addCase)
47+
.parameter(1)
48+
.not.toMatchTypeOf(incrementHandler)
49+
50+
expectTypeOf(builder.addCase)
51+
.parameter(1)
52+
.not.toMatchTypeOf(decrementHandler)
5053
})
5154
})
5255

yarn.lock

+42-2
Original file line numberDiff line numberDiff line change
@@ -7488,7 +7488,7 @@ __metadata:
74887488
tslib: "npm:^1.10.0"
74897489
tsup: "npm:^7.2.0"
74907490
tsx: "npm:^3.12.2"
7491-
typescript: "npm:^5.3.3"
7491+
typescript: "npm:^5.4.5"
74927492
vite-tsconfig-paths: "npm:^4.3.1"
74937493
vitest: "npm:^1.1.3"
74947494
yargs: "npm:^15.3.1"
@@ -25733,7 +25733,7 @@ __metadata:
2573325733
release-it: "npm:^14.12.5"
2573425734
serve: "npm:^14.2.0"
2573525735
ts-node: "npm:^10.9.2"
25736-
typescript: "npm:^5.2.2"
25736+
typescript: "npm:^5.4.3"
2573725737
languageName: unknown
2573825738
linkType: soft
2573925739

@@ -28334,6 +28334,26 @@ __metadata:
2833428334
languageName: node
2833528335
linkType: hard
2833628336

28337+
"typescript@npm:^5.4.3":
28338+
version: 5.4.3
28339+
resolution: "typescript@npm:5.4.3"
28340+
bin:
28341+
tsc: bin/tsc
28342+
tsserver: bin/tsserver
28343+
checksum: 10/de4c69f49a7ad4b1ea66a6dcc8b055ac34eb56af059a069d8988dd811c5e649be07e042e5bf573e8d0ac3ec2f30e6c999aa651cd09f6e9cbc6113749e8b6be20
28344+
languageName: node
28345+
linkType: hard
28346+
28347+
"typescript@npm:^5.4.5":
28348+
version: 5.4.5
28349+
resolution: "typescript@npm:5.4.5"
28350+
bin:
28351+
tsc: bin/tsc
28352+
tsserver: bin/tsserver
28353+
checksum: 10/d04a9e27e6d83861f2126665aa8d84847e8ebabcea9125b9ebc30370b98cb38b5dff2508d74e2326a744938191a83a69aa9fddab41f193ffa43eabfdf3f190a5
28354+
languageName: node
28355+
linkType: hard
28356+
2833728357
"typescript@npm:~4.2.4":
2833828358
version: 4.2.4
2833928359
resolution: "typescript@npm:4.2.4"
@@ -28384,6 +28404,26 @@ __metadata:
2838428404
languageName: node
2838528405
linkType: hard
2838628406

28407+
"typescript@patch:typescript@npm%3A^5.4.3#optional!builtin<compat/typescript>":
28408+
version: 5.4.3
28409+
resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin<compat/typescript>::version=5.4.3&hash=d69c25"
28410+
bin:
28411+
tsc: bin/tsc
28412+
tsserver: bin/tsserver
28413+
checksum: 10/3abea475798fdf7ee46e75dafc50c85f30fd1e7061559ec2af61646f23d16c91742703f04f0ac55be52f58ca05c02f77404b7b94bbad16278c9a54c9eeb4f4ea
28414+
languageName: node
28415+
linkType: hard
28416+
28417+
"typescript@patch:typescript@npm%3A^5.4.5#optional!builtin<compat/typescript>":
28418+
version: 5.4.5
28419+
resolution: "typescript@patch:typescript@npm%3A5.4.5#optional!builtin<compat/typescript>::version=5.4.5&hash=d69c25"
28420+
bin:
28421+
tsc: bin/tsc
28422+
tsserver: bin/tsserver
28423+
checksum: 10/584be8bac7112ad49a9eb9992f71d542b1ff2fafb5bb315e1c196145e8feab589f1d7223cfb2d5df6770789582e6918f8287d1f2f89911b38eb80e29c560ad00
28424+
languageName: node
28425+
linkType: hard
28426+
2838728427
"typescript@patch:typescript@npm%3A~4.2.4#optional!builtin<compat/typescript>":
2838828428
version: 4.2.4
2838928429
resolution: "typescript@patch:typescript@npm%3A4.2.4#optional!builtin<compat/typescript>::version=4.2.4&hash=334f98"

0 commit comments

Comments
 (0)