Skip to content

Commit

Permalink
Merge pull request #4255 from aryaemami59/update-ts-to-5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored May 9, 2024
2 parents 2283987 + 6cfeb58 commit 13ae28b
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
fail-fast: false
matrix:
node: ['20.x']
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3']
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3', '5.4']
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"release-it": "^14.12.5",
"serve": "^14.2.0",
"ts-node": "^10.9.2",
"typescript": "^5.2.2"
"typescript": "^5.4.3"
},
"resolutions": {
"esbuild": "0.19.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"tslib": "^1.10.0",
"tsup": "^7.2.0",
"tsx": "^3.12.2",
"typescript": "^5.3.3",
"typescript": "^5.4.5",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.1.3",
"yargs": "^15.3.1"
Expand Down
6 changes: 3 additions & 3 deletions packages/toolkit/src/createAsyncThunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const miniSerializeError = (value: any): SerializedError => {

export type AsyncThunkConfig = {
state?: unknown
dispatch?: Dispatch
dispatch?: ThunkDispatch<unknown, unknown, UnknownAction>
extra?: unknown
rejectValue?: unknown
serializedErrorType?: unknown
Expand Down Expand Up @@ -240,7 +240,7 @@ export type AsyncThunkAction<
ThunkArg,
ThunkApiConfig extends AsyncThunkConfig,
> = (
dispatch: GetDispatch<ThunkApiConfig>,
dispatch: NonNullable<GetDispatch<ThunkApiConfig>>,
getState: () => GetState<ThunkApiConfig>,
extra: GetExtra<ThunkApiConfig>,
) => SafePromise<
Expand Down Expand Up @@ -577,7 +577,7 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {

function actionCreator(
arg: ThunkArg,
): AsyncThunkAction<Returned, ThunkArg, ThunkApiConfig> {
): AsyncThunkAction<Returned, ThunkArg, Required<ThunkApiConfig>> {
return (dispatch, getState, extra) => {
const requestId = options?.idGenerator
? options.idGenerator(arg)
Expand Down
11 changes: 7 additions & 4 deletions packages/toolkit/src/tests/createReducer.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ describe('type tests', () => {

// @ts-expect-error
createReducer<string>(0 as number, (builder) => {
// @ts-expect-error
builder
.addCase('increment', incrementHandler)
.addCase('decrement', decrementHandler)
expectTypeOf(builder.addCase)
.parameter(1)
.not.toMatchTypeOf(incrementHandler)

expectTypeOf(builder.addCase)
.parameter(1)
.not.toMatchTypeOf(decrementHandler)
})
})

Expand Down
44 changes: 42 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7488,7 +7488,7 @@ __metadata:
tslib: "npm:^1.10.0"
tsup: "npm:^7.2.0"
tsx: "npm:^3.12.2"
typescript: "npm:^5.3.3"
typescript: "npm:^5.4.5"
vite-tsconfig-paths: "npm:^4.3.1"
vitest: "npm:^1.1.3"
yargs: "npm:^15.3.1"
Expand Down Expand Up @@ -25733,7 +25733,7 @@ __metadata:
release-it: "npm:^14.12.5"
serve: "npm:^14.2.0"
ts-node: "npm:^10.9.2"
typescript: "npm:^5.2.2"
typescript: "npm:^5.4.3"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -28334,6 +28334,26 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:^5.4.3":
version: 5.4.3
resolution: "typescript@npm:5.4.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10/de4c69f49a7ad4b1ea66a6dcc8b055ac34eb56af059a069d8988dd811c5e649be07e042e5bf573e8d0ac3ec2f30e6c999aa651cd09f6e9cbc6113749e8b6be20
languageName: node
linkType: hard

"typescript@npm:^5.4.5":
version: 5.4.5
resolution: "typescript@npm:5.4.5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10/d04a9e27e6d83861f2126665aa8d84847e8ebabcea9125b9ebc30370b98cb38b5dff2508d74e2326a744938191a83a69aa9fddab41f193ffa43eabfdf3f190a5
languageName: node
linkType: hard

"typescript@npm:~4.2.4":
version: 4.2.4
resolution: "typescript@npm:4.2.4"
Expand Down Expand Up @@ -28384,6 +28404,26 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A^5.4.3#optional!builtin<compat/typescript>":
version: 5.4.3
resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin<compat/typescript>::version=5.4.3&hash=d69c25"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10/3abea475798fdf7ee46e75dafc50c85f30fd1e7061559ec2af61646f23d16c91742703f04f0ac55be52f58ca05c02f77404b7b94bbad16278c9a54c9eeb4f4ea
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A^5.4.5#optional!builtin<compat/typescript>":
version: 5.4.5
resolution: "typescript@patch:typescript@npm%3A5.4.5#optional!builtin<compat/typescript>::version=5.4.5&hash=d69c25"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10/584be8bac7112ad49a9eb9992f71d542b1ff2fafb5bb315e1c196145e8feab589f1d7223cfb2d5df6770789582e6918f8287d1f2f89911b38eb80e29c560ad00
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A~4.2.4#optional!builtin<compat/typescript>":
version: 4.2.4
resolution: "typescript@patch:typescript@npm%3A4.2.4#optional!builtin<compat/typescript>::version=4.2.4&hash=334f98"
Expand Down

0 comments on commit 13ae28b

Please sign in to comment.