Skip to content
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
2 changes: 1 addition & 1 deletion examples/action-listener/counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"react-dom": "^18.1.0",
"react-redux": "^8.0.2",
"react-scripts": "5.0.1",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"eslintConfig": {
"extends": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"devDependencies": {
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"devDependencies": {
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"msw": "^0.40.2",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/conditional-fetching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/deduping-queries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/kitchen-sink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@types/node": "^14.14.6",
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4",
"typescript": "~4.9",
"whatwg-fetch": "^3.4.1"
},
"eslintConfig": {
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/mutations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/optimistic-update/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"devDependencies": {
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4",
"typescript": "~4.9",
"whatwg-fetch": "^3.4.1"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/pagination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/faker": "^5.5.5",
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/polling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"eslintConfig": {
"extends": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/faker": "^5.5.5",
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/prefetching-automatic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/faker": "^5.5.5",
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/prefetching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/faker": "^5.5.5",
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion examples/query/react/with-apiprovider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.5",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"eslintConfig": {
"extends": [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@babel/traverse": "7.19.3",
"@babel/types": "7.19.3",
"console-testing-library": "patch:console-testing-library@npm:0.3.1#.yarn/patches/console-testing-library__npm_0.3.1.patch",
"esbuild": "0.17.0",
"msw": "patch:msw@npm:0.40.2#.yarn/patches/msw-npm-0.40.2-2107d48752",
"jscodeshift": "0.13.1",
"react-redux": "npm:8.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/rtk-query-codegen-openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"babel-jest": "^26.6.3",
"chalk": "^4.1.0",
"del": "^6.0.0",
"esbuild": "^0.13.10",
"esbuild": "~0.17",
"esbuild-runner": "^2.2.1",
"husky": "^4.3.6",
"jest": "^27",
Expand Down
12 changes: 7 additions & 5 deletions packages/toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"axios": "^0.19.2",
"console-testing-library": "^0.3.1",
"convert-source-map": "^1.7.0",
"esbuild": "^0.11.13",
"esbuild": "~0.17",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^7.0.1",
Expand Down Expand Up @@ -73,14 +73,16 @@
"terser": "^5.6.1",
"ts-jest": "^27",
"tslib": "^1.10.0",
"typescript": "~4.2.4",
"tsx": "^3.12.2",
"typescript": "~4.9",
"yargs": "^15.3.1"
},
"scripts": {
"build-ci": "yarn rimraf dist && yarn tsc && node scripts/cli.js --skipExtraction",
"run-build": "tsx ./scripts/build.ts",
"build-ci": "yarn rimraf dist && yarn tsc && yarn run-build --skipExtraction",
"build-prepare": "npm run build-ci",
"build": "yarn rimraf dist && yarn tsc && node scripts/cli.js --local --skipExtraction",
"build-only": "yarn rimraf dist && yarn tsc && node scripts/cli.js --skipExtraction",
"build": "yarn rimraf dist && yarn tsc && yarn run-build --local --skipExtraction",
"build-only": "yarn rimraf dist && yarn tsc && yarn run-build --skipExtraction",
"format": "prettier --write \"(src|examples)/**/*.{ts,tsx}\" \"**/*.md\"",
"format:check": "prettier --list-different \"(src|examples)/**/*.{ts,tsx}\" \"docs/*/**.md\"",
"lint": "eslint src examples",
Expand Down
5 changes: 3 additions & 2 deletions packages/toolkit/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @ts-check
import { build } from 'esbuild'
import terser from 'terser'
import rollup from 'rollup'
import { rollup } from 'rollup'
import path from 'path'
import fs from 'fs-extra'
import ts from 'typescript'
Expand Down Expand Up @@ -256,7 +256,7 @@ async function buildUMD(
) {
for (let umdExtension of ['umd', 'umd.min']) {
const input = path.join(outputPath, `${prefix}.${umdExtension}.js`)
const instance = await rollup.rollup({
const instance = await rollup({
input: [input],
onwarn(warning, warn) {
if (warning.code === 'THIS_IS_UNDEFINED') return
Expand All @@ -272,6 +272,7 @@ async function buildUMD(
// These packages have specific global names from their UMD bundles
react: 'React',
'react-redux': 'ReactRedux',
'@reduxjs/toolkit': 'RTK',
},
})
}
Expand Down
2 changes: 0 additions & 2 deletions packages/toolkit/scripts/cli.js

This file was deleted.

11 changes: 0 additions & 11 deletions packages/toolkit/scripts/register.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/toolkit/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from 'redux'
export {
default as createNextState,
produce as createNextState,
current,
freeze,
original,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('createListenerMiddleware', () => {
middleware: (gDM) => gDM().prepend(listenerMiddleware.middleware),
})

let foundExtra: number | null = null
let foundExtra: number | null = null

const typedAddListener =
listenerMiddleware.startListening as TypedStartListening<
Expand Down Expand Up @@ -1061,12 +1061,13 @@ describe('createListenerMiddleware', () => {
middleware: (gDM) => gDM().prepend(middleware),
})

const typedAddListener =
startListening as TypedStartListening<
CounterState,
typeof store.dispatch
>
let result: [ReturnType<typeof increment>, CounterState, CounterState] | null = null
const typedAddListener = startListening as TypedStartListening<
CounterState,
typeof store.dispatch
>
let result:
| [ReturnType<typeof increment>, CounterState, CounterState]
| null = null

typedAddListener({
predicate: incrementByAmount.match,
Expand Down Expand Up @@ -1126,31 +1127,34 @@ describe('createListenerMiddleware', () => {
expect(takeResult).toEqual([increment(), stateCurrent, stateBefore])
})

test("take resolves to `[A, CurrentState, PreviousState] | null` if a possibly undefined timeout parameter is provided", async () => {
test('take resolves to `[A, CurrentState, PreviousState] | null` if a possibly undefined timeout parameter is provided', async () => {
const store = configureStore({
reducer: counterSlice.reducer,
middleware: (gDM) => gDM().prepend(middleware),
})

type ExpectedTakeResultType = readonly [ReturnType<typeof increment>, CounterState, CounterState] | null
type ExpectedTakeResultType =
| readonly [ReturnType<typeof increment>, CounterState, CounterState]
| null

let timeout: number | undefined = undefined
let done = false

const startAppListening = startListening as TypedStartListening<CounterState>
const startAppListening =
startListening as TypedStartListening<CounterState>
startAppListening({
predicate: incrementByAmount.match,
effect: async (_, listenerApi) => {
const stateBefore = listenerApi.getState()

let takeResult = await listenerApi.take(increment.match, timeout)
const stateCurrent = listenerApi.getState()
expect(takeResult).toEqual([increment(), stateCurrent, stateBefore])

timeout = 1
takeResult = await listenerApi.take(increment.match, timeout)
expect(takeResult).toBeNull()

expectType<ExpectedTakeResultType>(takeResult)

done = true
Expand All @@ -1160,7 +1164,7 @@ describe('createListenerMiddleware', () => {
store.dispatch(increment())

await delay(25)
expect(done).toBe(true);
expect(done).toBe(true)
})

test('condition method resolves promise when the predicate succeeds', async () => {
Expand Down Expand Up @@ -1444,7 +1448,6 @@ describe('createListenerMiddleware', () => {
return typeof action.payload === 'boolean'
},
effect: (action, listenerApi) => {
// @ts-expect-error
expectExactType<PayloadAction<number>>(action)
},
})
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"react-dom": "^18.1.0",
"react-lite-youtube-embed": "^2.0.3",
"remark-typescript-tools": "^1.0.8",
"typescript": "~4.2.4"
"typescript": "~4.9"
},
"browserslist": {
"production": [
Expand Down
Loading