From ad9af119f4edd084277c85174797f729c07d7f10 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 15:24:46 -0500 Subject: [PATCH 01/29] Update React and React-DOM to the new rc version --- package.json | 4 ++-- yarn.lock | 34 +++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index ab8173e4b..b28df41d1 100644 --- a/package.json +++ b/package.json @@ -98,8 +98,8 @@ "eslint-plugin-react": "^7.34.2", "jsdom": "^24.1.0", "prettier": "^3.3.3", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "19.0.0-rc.1", + "react-dom": "19.0.0-rc.1", "react-test-renderer": "18.3.1", "redux": "^5.0.1", "rimraf": "^5.0.7", diff --git a/yarn.lock b/yarn.lock index cf517747a..14690f8f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6100,15 +6100,14 @@ __metadata: languageName: node linkType: hard -"react-dom@npm:18.3.1": - version: 18.3.1 - resolution: "react-dom@npm:18.3.1" +"react-dom@npm:19.0.0-rc.1": + version: 19.0.0-rc.1 + resolution: "react-dom@npm:19.0.0-rc.1" dependencies: - loose-envify: "npm:^1.1.0" - scheduler: "npm:^0.23.2" + scheduler: "npm:0.25.0-rc.1" peerDependencies: - react: ^18.3.1 - checksum: 10/3f4b73a3aa083091173b29812b10394dd06f4ac06aff410b74702cfb3aa29d7b0ced208aab92d5272919b612e5cda21aeb1d54191848cf6e46e9e354f3541f81 + react: 19.0.0-rc.1 + checksum: 10/9c3f79fe8f8fd10e8a86476df1670d3920f1c1083e56285b5c31d96ca18d223e9d1e78b6b5534ce7ab90a57e2d47ca96d2b3ced3a08a993c937c7f49561b337d languageName: node linkType: hard @@ -6168,8 +6167,8 @@ __metadata: eslint-plugin-react: "npm:^7.34.2" jsdom: "npm:^24.1.0" prettier: "npm:^3.3.3" - react: "npm:18.3.1" - react-dom: "npm:18.3.1" + react: "npm:19.0.0-rc.1" + react-dom: "npm:19.0.0-rc.1" react-test-renderer: "npm:18.3.1" redux: "npm:^5.0.1" rimraf: "npm:^5.0.7" @@ -6215,12 +6214,10 @@ __metadata: languageName: node linkType: hard -"react@npm:18.3.1": - version: 18.3.1 - resolution: "react@npm:18.3.1" - dependencies: - loose-envify: "npm:^1.1.0" - checksum: 10/261137d3f3993eaa2368a83110466fc0e558bc2c7f7ae7ca52d94f03aac945f45146bd85e5f481044db1758a1dbb57879e2fcdd33924e2dde1bdc550ce73f7bf +"react@npm:19.0.0-rc.1": + version: 19.0.0-rc.1 + resolution: "react@npm:19.0.0-rc.1" + checksum: 10/4da93b26f6d8ca24a4657551fe9e6db92b42e6d8cb54821e3c2c8c5af2098094e5d997b261314a2b5723ad1e0a444a63312b7645f72394f21660da38ea4554f1 languageName: node linkType: hard @@ -6611,6 +6608,13 @@ __metadata: languageName: node linkType: hard +"scheduler@npm:0.25.0-rc.1": + version: 0.25.0-rc.1 + resolution: "scheduler@npm:0.25.0-rc.1" + checksum: 10/b9dbc9e406ab4af245c3c7cfd1d39e983aa6184ab941cfd7ee5dc1695854280a5dee556f7f81d9e0f392dbe4f2f85966f2b6988beed39f1d5f5e844b1db02c60 + languageName: node + linkType: hard + "scheduler@npm:^0.23.2": version: 0.23.2 resolution: "scheduler@npm:0.23.2" From 0aababf96977a54b39bc49b56dadf8b2f7295dee Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 15:30:41 -0500 Subject: [PATCH 02/29] Set `@types/react` and `@types/react-dom` to temporary types packages - We set the `@types/react` and `@types/react-dom` package resolutions to `npm:types-react` and `npm:types-react-dom` according to the React 19 migration guide. --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ package.json | 4 ++-- yarn.lock | 21 ++++++++++----------- 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e981153c4..26890ee06 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,6 +47,19 @@ jobs: matrix: node: ['20.x'] ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5'] + react: + [ + { + version: '^18', + types: ^18, + react-dom: { version: '^18', types: '^18' }, + }, + { + version: 'rc', + types: 'npm:types-react@rc', + react-dom: { version: 'rc', types: 'npm:types-react-dom@rc' }, + }, + ] steps: - name: Checkout repo @@ -237,6 +250,20 @@ jobs: fail-fast: false matrix: node: ['20.x'] + react: + [ + { + version: '^18', + types: ^18, + react-dom: { version: '^18', types: '^18' }, + }, + { + version: 'rc', + types: 'npm:types-react@rc', + react-dom: { version: 'rc', types: 'npm:types-react-dom@rc' }, + }, + ] + steps: - name: Checkout repo uses: actions/checkout@v4 diff --git a/package.json b/package.json index b28df41d1..1427c671d 100644 --- a/package.json +++ b/package.json @@ -85,8 +85,8 @@ "@testing-library/react": "^16.0.0", "@types/node": "^20.14.2", "@types/prop-types": "^15.7.12", - "@types/react": "18.3.3", - "@types/react-dom": "^18.3.0", + "@types/react": "npm:types-react@rc", + "@types/react-dom": "npm:types-react-dom@rc", "babel-eslint": "^10.1.0", "codecov": "^3.8.3", "cross-env": "^7.0.3", diff --git a/yarn.lock b/yarn.lock index 14690f8f4..b81ef0036 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2234,12 +2234,12 @@ __metadata: languageName: node linkType: hard -"@types/react-dom@npm:^18.3.0": - version: 18.3.1 - resolution: "@types/react-dom@npm:18.3.1" +"@types/react-dom@npm:types-react-dom@rc": + version: 19.0.0-rc.1 + resolution: "types-react-dom@npm:19.0.0-rc.1" dependencies: "@types/react": "npm:*" - checksum: 10/33f9ba79b26641ddf00a8699c30066b7e3573ab254e97475bf08f82fab83a6d3ce8d4ebad86afeb49bb8df3374390a9ba93125cece33badc4b3e8f7eac3c84d8 + checksum: 10/fca4e7565308a109d4b126e5c7f5c387789a0187c9a46cb2a5af6120a7014beaa05736841be0ae658c7115871088500ddb0ef0bce60a21af4ec899cee8bb3c75 languageName: node linkType: hard @@ -2253,13 +2253,12 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:18.3.3": - version: 18.3.3 - resolution: "@types/react@npm:18.3.3" +"@types/react@npm:types-react@rc": + version: 19.0.0-rc.1 + resolution: "types-react@npm:19.0.0-rc.1" dependencies: - "@types/prop-types": "npm:*" csstype: "npm:^3.0.2" - checksum: 10/68e203b7f1f91d6cf21f33fc7af9d6d228035a26c83f514981e54aa3da695d0ec6af10c277c6336de1dd76c4adbe9563f3a21f80c4462000f41e5f370b46e96c + checksum: 10/342da9ffeab93600a0cff4c8829e5350d935577e3f81bce7ead41d7cd074035e2c4a4bdd976fa8e3f5390fe6a32169370a805291a88a77c2f2ce2613bde54587 languageName: node linkType: hard @@ -6153,8 +6152,8 @@ __metadata: "@testing-library/react": "npm:^16.0.0" "@types/node": "npm:^20.14.2" "@types/prop-types": "npm:^15.7.12" - "@types/react": "npm:18.3.3" - "@types/react-dom": "npm:^18.3.0" + "@types/react": "npm:types-react@rc" + "@types/react-dom": "npm:types-react-dom@rc" "@types/use-sync-external-store": "npm:^0.0.6" babel-eslint: "npm:^10.1.0" codecov: "npm:^3.8.3" From 3e6428f9714057c8e8869103f2bbed18661198e3 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 15:33:58 -0500 Subject: [PATCH 03/29] Run tests against different versions of React during CI --- .github/workflows/test.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26890ee06..9e7ed0299 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: path: ./package.tgz test-types: - name: Test Types with TypeScript ${{ matrix.ts }} + name: Test Types with TypeScript ${{ matrix.ts }} and React ${{ matrix.react.version }} needs: [build] runs-on: ubuntu-latest @@ -80,6 +80,9 @@ jobs: - name: Install deps run: yarn install + - name: Install React ${{ matrix.react.version }} and React-DOM ${{ matrix.react.react-dom.version }} + run: yarn add -D react@${{ matrix.react.version }} react-dom@${{ matrix.react.react-dom.version }} @types/react@${{ matrix.react.types }} @types/react-dom@${{ matrix.react.react-dom.types }} + - name: Install TypeScript ${{ matrix.ts }} run: yarn add typescript@${{ matrix.ts }} @@ -243,7 +246,7 @@ jobs: run: yarn build test-dist: - name: Run local tests against build artifact + name: Run local tests against build artifact (React ${{ matrix.react.version }}) needs: [build] runs-on: ubuntu-latest strategy: @@ -286,6 +289,9 @@ jobs: - name: Check folder contents run: ls -lah + - name: Install React ${{ matrix.react.version }} and React-DOM ${{ matrix.react.react-dom.version }} + run: yarn add -D react@${{ matrix.react.version }} react-dom@${{ matrix.react.react-dom.version }} @types/react@${{ matrix.react.types }} @types/react-dom@${{ matrix.react.react-dom.types }} + - name: Install build artifact run: yarn add ./package.tgz From 355bbfb006223fb06d9b88c529ec1c845d801e0a Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 15:36:34 -0500 Subject: [PATCH 04/29] Remove the now deprecated `react-test-renderer` package --- package.json | 1 - yarn.lock | 51 ++++++++------------------------------------------- 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index 1427c671d..bec1cfc78 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,6 @@ "prettier": "^3.3.3", "react": "19.0.0-rc.1", "react-dom": "19.0.0-rc.1", - "react-test-renderer": "18.3.1", "redux": "^5.0.1", "rimraf": "^5.0.7", "tsup": "^8.3.5", diff --git a/yarn.lock b/yarn.lock index b81ef0036..a7e20971a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5261,7 +5261,7 @@ __metadata: languageName: node linkType: hard -"loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0": +"loose-envify@npm:^1.4.0": version: 1.4.0 resolution: "loose-envify@npm:1.4.0" dependencies: @@ -6110,13 +6110,6 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^16.12.0 || ^17.0.0 || ^18.0.0, react-is@npm:^18.0.0, react-is@npm:^18.3.1": - version: 18.3.1 - resolution: "react-is@npm:18.3.1" - checksum: 10/d5f60c87d285af24b1e1e7eaeb123ec256c3c8bdea7061ab3932e3e14685708221bf234ec50b21e10dd07f008f1b966a2730a0ce4ff67905b3872ff2042aec22 - languageName: node - linkType: hard - "react-is@npm:^16.13.1": version: 16.13.1 resolution: "react-is@npm:16.13.1" @@ -6131,6 +6124,13 @@ __metadata: languageName: node linkType: hard +"react-is@npm:^18.0.0": + version: 18.3.1 + resolution: "react-is@npm:18.3.1" + checksum: 10/d5f60c87d285af24b1e1e7eaeb123ec256c3c8bdea7061ab3932e3e14685708221bf234ec50b21e10dd07f008f1b966a2730a0ce4ff67905b3872ff2042aec22 + languageName: node + linkType: hard + "react-redux@workspace:.": version: 0.0.0-use.local resolution: "react-redux@workspace:." @@ -6168,7 +6168,6 @@ __metadata: prettier: "npm:^3.3.3" react: "npm:19.0.0-rc.1" react-dom: "npm:19.0.0-rc.1" - react-test-renderer: "npm:18.3.1" redux: "npm:^5.0.1" rimraf: "npm:^5.0.7" tsup: "npm:^8.3.5" @@ -6188,31 +6187,6 @@ __metadata: languageName: unknown linkType: soft -"react-shallow-renderer@npm:^16.15.0": - version: 16.15.0 - resolution: "react-shallow-renderer@npm:16.15.0" - dependencies: - object-assign: "npm:^4.1.1" - react-is: "npm:^16.12.0 || ^17.0.0 || ^18.0.0" - peerDependencies: - react: ^16.0.0 || ^17.0.0 || ^18.0.0 - checksum: 10/06457fe5bcaa44aeca998905b6849304742ea1cc2d3841e4a0964c745ff392bc4dec07f8c779f317faacce3a0bf6f84e15020ac0fa81adb931067dbb0baf707b - languageName: node - linkType: hard - -"react-test-renderer@npm:18.3.1": - version: 18.3.1 - resolution: "react-test-renderer@npm:18.3.1" - dependencies: - react-is: "npm:^18.3.1" - react-shallow-renderer: "npm:^16.15.0" - scheduler: "npm:^0.23.2" - peerDependencies: - react: ^18.3.1 - checksum: 10/d53137315c677bdfba702a7179a69828233fc7635ae1e0c03b203923d643400ace72b343cb3dd3dafba8911c20bef53f55bff7aa2e4ddff3ccc423fdd9deeee2 - languageName: node - linkType: hard - "react@npm:19.0.0-rc.1": version: 19.0.0-rc.1 resolution: "react@npm:19.0.0-rc.1" @@ -6614,15 +6588,6 @@ __metadata: languageName: node linkType: hard -"scheduler@npm:^0.23.2": - version: 0.23.2 - resolution: "scheduler@npm:0.23.2" - dependencies: - loose-envify: "npm:^1.1.0" - checksum: 10/e8d68b89d18d5b028223edf090092846868a765a591944760942b77ea1f69b17235f7e956696efbb62c8130ab90af7e0949bfb8eba7896335507317236966bc9 - languageName: node - linkType: hard - "semver@npm:^5.6.0": version: 5.7.2 resolution: "semver@npm:5.7.2" From e69306b539645aac38fc8892c7e6045abfab628f Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 15:55:51 -0500 Subject: [PATCH 05/29] Replace the now removed `ReactDOM` methods - `ReactDOM.render` and `ReactDOM.unmountComponentAtNode` have been removed in React 19. This commit replaces their usage with `rtl.render` and `root.unmount` as recommended in the React 19 migration guide. --- test/components/Provider.spec.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/components/Provider.spec.tsx b/test/components/Provider.spec.tsx index b6b35cab7..a5a35a768 100644 --- a/test/components/Provider.spec.tsx +++ b/test/components/Provider.spec.tsx @@ -8,8 +8,6 @@ import { Provider, ReactReduxContext, connect } from 'react-redux' import type { Store } from 'redux' import { createStore } from 'redux' -import * as ReactDOM from 'react-dom' - const createExampleTextReducer = () => (state = 'example text') => @@ -342,18 +340,16 @@ describe('React', () => { } } - const container = document.createElement('div') - - // eslint-disable-next-line react/no-deprecated - ReactDOM.render( + const { unmount } = rtl.render(
, - container, ) + expect(spy).toHaveBeenCalledTimes(0) - // eslint-disable-next-line react/no-deprecated - ReactDOM.unmountComponentAtNode(container) + + unmount() + expect(spy).toHaveBeenCalledTimes(1) }) From 48ef75fed5b2ac3db1554f4486063cde27dab426 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 16:05:08 -0500 Subject: [PATCH 06/29] Replace `@testing-library/react-hooks` with `@testing-library/react` - The `renderHook` method in `@testing-library/react-hooks` has now been moved to `@testing-library/react`. This commit updates imports and usages of the `renderHook` function to comply with the new syntax requirements in the [react-hooks-testing-library migration guide](https://github.com/testing-library/react-hooks-testing-library/blob/chore/migration-guide/MIGRATION_GUIDE.md#waitfornextupdate). From 7d8dd8461325dda903de9303932c5f480bca9ba8 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 16:15:38 -0500 Subject: [PATCH 07/29] Update `react-is` implementation - `react-is` has changed the `REACT_ELEMENT_TYPE` symbol from `'react.element'` to `'react.transitional.element'`. We want our changes to be non-breaking and backwards-compatible so we conditionally set the `REACT_ELEMENT_TYPE` based on the detected version of React. --- src/utils/react-is.ts | 92 ++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 57 deletions(-) diff --git a/src/utils/react-is.ts b/src/utils/react-is.ts index 72daa9e9b..f8d609f9c 100644 --- a/src/utils/react-is.ts +++ b/src/utils/react-is.ts @@ -1,20 +1,22 @@ import type { ElementType, MemoExoticComponent, ReactElement } from 'react' +import * as React from 'react' // Directly ported from: -// https://unpkg.com/browse/react-is@18.3.0-canary-ee68446ff-20231115/cjs/react-is.production.js +// https://unpkg.com/browse/react-is@19.0.0/cjs/react-is.production.js // It's very possible this could change in the future, but given that // we only use these in `connect`, this is a low priority. -const REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for('react.element') +export const IS_REACT_19 = /* @__PURE__ */ React.version.startsWith('19') + +const REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for( + IS_REACT_19 ? 'react.transitional.element' : 'react.element', +) const REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for('react.portal') const REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for('react.fragment') const REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for('react.strict_mode') const REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for('react.profiler') -const REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for('react.provider') +const REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for('react.consumer') const REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for('react.context') -const REACT_SERVER_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for( - 'react.server_context', -) const REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for('react.forward_ref') const REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for('react.suspense') const REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for( @@ -31,87 +33,63 @@ export const ForwardRef = REACT_FORWARD_REF_TYPE export const Memo = REACT_MEMO_TYPE export function isValidElementType(type: any): type is ElementType { - if (typeof type === 'string' || typeof type === 'function') { - return true - } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). - - if ( + return typeof type === 'string' || + typeof type === 'function' || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || - type === REACT_OFFSCREEN_TYPE - ) { - return true - } - - if (typeof type === 'object' && type !== null) { - if ( - type.$$typeof === REACT_LAZY_TYPE || - type.$$typeof === REACT_MEMO_TYPE || - type.$$typeof === REACT_PROVIDER_TYPE || - type.$$typeof === REACT_CONTEXT_TYPE || - type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object - // types supported by any Flight configuration anywhere since - // we don't know which Flight build this will end up being used - // with. - type.$$typeof === REACT_CLIENT_REFERENCE || - type.getModuleId !== undefined - ) { - return true - } - } - - return false + type === REACT_OFFSCREEN_TYPE || + (typeof type === 'object' && + type !== null && + (type.$$typeof === REACT_LAZY_TYPE || + type.$$typeof === REACT_MEMO_TYPE || + type.$$typeof === REACT_CONTEXT_TYPE || + type.$$typeof === REACT_CONSUMER_TYPE || + type.$$typeof === REACT_FORWARD_REF_TYPE || + type.$$typeof === REACT_CLIENT_REFERENCE || + type.getModuleId !== undefined)) + ? !0 + : !1 } function typeOf(object: any): symbol | undefined { if (typeof object === 'object' && object !== null) { - const $$typeof = object.$$typeof + const { $$typeof } = object switch ($$typeof) { - case REACT_ELEMENT_TYPE: { - const type = object.type - - switch (type) { + case REACT_ELEMENT_TYPE: + switch (((object = object.type), object)) { case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: case REACT_SUSPENSE_LIST_TYPE: - return type - - default: { - const $$typeofType = type && type.$$typeof - - switch ($$typeofType) { - case REACT_SERVER_CONTEXT_TYPE: + return object + default: + switch (((object = object && object.$$typeof), object)) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: - case REACT_PROVIDER_TYPE: - return $$typeofType - + return object + case REACT_CONSUMER_TYPE: + return object default: return $$typeof } - } } - } - - case REACT_PORTAL_TYPE: { + case REACT_PORTAL_TYPE: return $$typeof - } } } - - return undefined } export function isContextConsumer(object: any): object is ReactElement { - return typeOf(object) === REACT_CONTEXT_TYPE + return IS_REACT_19 + ? typeOf(object) === REACT_CONSUMER_TYPE + : typeOf(object) === REACT_CONTEXT_TYPE } export function isMemo(object: any): object is MemoExoticComponent { From 0985471cf68dfd34256f3f1612bfe6211fe8e2ce Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 16:20:28 -0500 Subject: [PATCH 08/29] Export `IS_REACT_19` and re-use in tests --- test/components/connect.spec.tsx | 3 ++- test/hooks/useSelector.spec.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/components/connect.spec.tsx b/test/components/connect.spec.tsx index 69ba56b2e..fab60af09 100644 --- a/test/components/connect.spec.tsx +++ b/test/components/connect.spec.tsx @@ -1,5 +1,6 @@ /*eslint-disable react/prop-types*/ +import { IS_REACT_19 } from '@internal/utils/react-is' import * as rtl from '@testing-library/react' import type { Dispatch, ElementType, JSX, MouseEvent, ReactNode } from 'react' import React, { Component } from 'react' @@ -2904,7 +2905,7 @@ describe('React', () => { , ) - if (IS_REACT_18) { + if (IS_REACT_18 || IS_REACT_19) { expect(spy).not.toHaveBeenCalled() } else { expect(spy.mock.calls[0]?.[0]).toEqual( diff --git a/test/hooks/useSelector.spec.tsx b/test/hooks/useSelector.spec.tsx index 209100916..f1fca9d61 100644 --- a/test/hooks/useSelector.spec.tsx +++ b/test/hooks/useSelector.spec.tsx @@ -1,6 +1,7 @@ /*eslint-disable react/prop-types*/ import type { UseSelectorOptions } from '@internal/hooks/useSelector' +import { IS_REACT_19 } from '@internal/utils/react-is' import * as rtl from '@testing-library/react' import type { DispatchWithoutAction, FunctionComponent, ReactNode } from 'react' import React, { @@ -722,7 +723,7 @@ describe('React', () => { // although I can't imagine why, and if I remove the `useSelector` calls both tests drop to ~50ms. // So, we'll modify our expectations here depending on whether this is an 18 or 17 compat test, // and give some buffer time to allow for variations in test machines. - const expectedMaxUnmountTime = IS_REACT_18 ? 500 : 7000 + const expectedMaxUnmountTime = IS_REACT_18 || IS_REACT_19 ? 500 : 7000 expect(elapsedTime).toBeLessThan(expectedMaxUnmountTime) }) From 8f9ec759e22c29c1318792c232fe8a99184683bd Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 16:24:21 -0500 Subject: [PATCH 09/29] Update `wrapper` `props` in `useDispatch.spec.tsx` to resolve type error --- test/hooks/useDispatch.spec.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hooks/useDispatch.spec.tsx b/test/hooks/useDispatch.spec.tsx index 8bc26b218..4a60dfc3d 100644 --- a/test/hooks/useDispatch.spec.tsx +++ b/test/hooks/useDispatch.spec.tsx @@ -32,7 +32,7 @@ describe('React', () => { const useCustomDispatch = createDispatchHook(nestedContext) const { result } = renderHook(() => useDispatch(), { // eslint-disable-next-line react/prop-types - wrapper: ({ children, ...props }) => ( + wrapper: ({ children, ...props }: Omit) => ( {children} @@ -45,7 +45,7 @@ describe('React', () => { const { result: result2 } = renderHook(() => useCustomDispatch(), { // eslint-disable-next-line react/prop-types - wrapper: ({ children, ...props }) => ( + wrapper: ({ children, ...props }: Omit) => ( {children} From a3ef256d17d924ea71ee23b0aa5b640724ebd963 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 16:28:15 -0500 Subject: [PATCH 10/29] Remove unnecessary `rtl.cleanup` calls - According to `@testing-library/react` docs, the `cleanup` function is called automatically during the `afterEach` hook and there is no need to manually call it. --- test/components/Provider.spec.tsx | 2 -- test/components/connect.spec.tsx | 2 -- test/components/hooks.spec.tsx | 2 -- test/hooks/useSelector.spec.tsx | 2 -- 4 files changed, 8 deletions(-) diff --git a/test/components/Provider.spec.tsx b/test/components/Provider.spec.tsx index a5a35a768..31b74659d 100644 --- a/test/components/Provider.spec.tsx +++ b/test/components/Provider.spec.tsx @@ -15,8 +15,6 @@ const createExampleTextReducer = describe('React', () => { describe('Provider', () => { - afterEach(() => rtl.cleanup()) - const createChild = (storeKey = 'store') => { class Child extends Component { render() { diff --git a/test/components/connect.spec.tsx b/test/components/connect.spec.tsx index fab60af09..31f034def 100644 --- a/test/components/connect.spec.tsx +++ b/test/components/connect.spec.tsx @@ -82,8 +82,6 @@ describe('React', () => { return action.type === 'APPEND' ? prev + action.body : prev } - afterEach(() => rtl.cleanup()) - describe('Core subscription and prop passing behavior', () => { it('should receive the store state in the context', () => { const store = createStore(() => ({ hi: 'there' })) diff --git a/test/components/hooks.spec.tsx b/test/components/hooks.spec.tsx index 5872ab148..28fc6af9c 100644 --- a/test/components/hooks.spec.tsx +++ b/test/components/hooks.spec.tsx @@ -10,8 +10,6 @@ const IS_REACT_18 = React.version.startsWith('18') describe('React', () => { describe('connect', () => { - afterEach(() => rtl.cleanup()) - it('should render on useEffect hook state update', () => { interface RootStateType { byId: { diff --git a/test/hooks/useSelector.spec.tsx b/test/hooks/useSelector.spec.tsx index f1fca9d61..6ab62f390 100644 --- a/test/hooks/useSelector.spec.tsx +++ b/test/hooks/useSelector.spec.tsx @@ -68,8 +68,6 @@ describe('React', () => { renderedItems = [] }) - afterEach(() => rtl.cleanup()) - describe('core subscription behavior', () => { it('selects the state on initial render', () => { let result: number | undefined From aaa19278401e696048b22c0ba9f0577f50744019 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 16:30:38 -0500 Subject: [PATCH 11/29] Add `@ts-ignore` for type issue related to `@types/react` ^18.61 --- test/typetests/connect-options-and-issues.test-d.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/typetests/connect-options-and-issues.test-d.tsx b/test/typetests/connect-options-and-issues.test-d.tsx index 7d59d5860..1db63b3f1 100644 --- a/test/typetests/connect-options-and-issues.test-d.tsx +++ b/test/typetests/connect-options-and-issues.test-d.tsx @@ -786,8 +786,11 @@ describe('type tests', () => { // Should be able to pass modern refs to a ForwardRefExoticComponent const modernRef: React.Ref | undefined = undefined ; - // Should be able to use legacy string refs - ; + // Should not be able to use legacy string refs + ; // ref type should agree with type of the forwarded ref ; Date: Fri, 10 May 2024 16:31:42 -0500 Subject: [PATCH 12/29] Uncomment type test --- test/typetests/connect-options-and-issues.test-d.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/typetests/connect-options-and-issues.test-d.tsx b/test/typetests/connect-options-and-issues.test-d.tsx index 1db63b3f1..0a6559ba9 100644 --- a/test/typetests/connect-options-and-issues.test-d.tsx +++ b/test/typetests/connect-options-and-issues.test-d.tsx @@ -754,8 +754,7 @@ describe('type tests', () => { myHoc1(Test) const myHoc2 = (C: React.FC

): React.ComponentType

=> C - // TODO Figure out the error here - // myHoc2(Test) + myHoc2(Test) }) test('Ref', () => { From 0b5c116bd9722c76072bb3327c409c0643d02c46 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 16:34:23 -0500 Subject: [PATCH 13/29] Add TODO comment about different rendering behaviors in React 18 vs 19 --- test/components/hooks.spec.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/test/components/hooks.spec.tsx b/test/components/hooks.spec.tsx index 28fc6af9c..7df7b33b5 100644 --- a/test/components/hooks.spec.tsx +++ b/test/components/hooks.spec.tsx @@ -146,6 +146,7 @@ describe('React', () => { // 2. Batched update from nested subscriber / C1 re-render // Not sure why the differences across versions here + // TODO: Figure out why this is 3 in React 18 but 2 in React 19 const numFinalRenders = IS_REACT_18 ? 3 : 2 expect(renderSpy2).toHaveBeenCalledTimes(numFinalRenders) }) From dc018a75057534462dac5fbc742a8e8e89285989 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 10 May 2024 16:52:20 -0500 Subject: [PATCH 14/29] Update `react` and `@types/react` in `peerDependencies` --- package.json | 4 ++-- yarn.lock | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index bec1cfc78..0cf1b6235 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,8 @@ "coverage": "codecov" }, "peerDependencies": { - "@types/react": "^18.2.25", - "react": "^18.0", + "@types/react": "^18.2.25 || ^19", + "react": "^18.0 || ^19", "redux": "^5.0.0" }, "peerDependenciesMeta": { diff --git a/yarn.lock b/yarn.lock index a7e20971a..6e0c986ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6176,8 +6176,8 @@ __metadata: use-sync-external-store: "npm:^1.2.2" vitest: "npm:^1.6.0" peerDependencies: - "@types/react": ^18.2.25 - react: ^18.0 + "@types/react": ^18.2.25 || ^19 + react: ^18.0 || ^19 redux: ^5.0.0 peerDependenciesMeta: "@types/react": From a92e5f21159011effa5d0487fd79c85759859b22 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Tue, 14 May 2024 12:31:37 -0500 Subject: [PATCH 15/29] Bump `use-sync-external-store` to the new rc --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 0cf1b6235..39020b408 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ }, "dependencies": { "@types/use-sync-external-store": "^0.0.6", - "use-sync-external-store": "^1.2.2" + "use-sync-external-store": "^1.2.2 || ^1.4.0-rc" }, "devDependencies": { "@babel/cli": "^7.24.7", diff --git a/yarn.lock b/yarn.lock index 6e0c986ae..31e985e66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6173,7 +6173,7 @@ __metadata: tsup: "npm:^8.3.5" typescript: "npm:^5.5.4" typescript-eslint: "npm:^7.12.0" - use-sync-external-store: "npm:^1.2.2" + use-sync-external-store: "npm:^1.2.2 || ^1.4.0-rc" vitest: "npm:^1.6.0" peerDependencies: "@types/react": ^18.2.25 || ^19 @@ -7513,12 +7513,12 @@ __metadata: languageName: node linkType: hard -"use-sync-external-store@npm:^1.2.2": - version: 1.2.2 - resolution: "use-sync-external-store@npm:1.2.2" +"use-sync-external-store@npm:^1.2.2 || ^1.4.0-rc": + version: 1.4.0-rc-fb9a90fa48-20240614 + resolution: "use-sync-external-store@npm:1.4.0-rc-fb9a90fa48-20240614" peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 10/671e9c190aab9a8374a5d468c6ba17f52c38b6fae970110bc196fc1e2b57204149aea9619be49a1bb5207fb6e51d8afd19c3bcb94afe61813fed039821461dc0 + react: 19.0.0-rc-fb9a90fa48-20240614 + checksum: 10/5b31aef4df66f5172dc65170151c68bf838558a8beb4674193279aa8c1a03e3f58a30afbb7a2619d9271a5c7132a8b20cfecc4b5530440539245c1f6bd5b5aae languageName: node linkType: hard From 834f70b03d9bcdb41931d09d6e143bbc492f6419 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Tue, 14 May 2024 12:43:46 -0500 Subject: [PATCH 16/29] Use `types-use-sync-external-store` for `@types/use-sync-external-store` --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 39020b408..567ef7ed9 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ } }, "dependencies": { - "@types/use-sync-external-store": "^0.0.6", + "@types/use-sync-external-store": "npm:types-use-sync-external-store@rc", "use-sync-external-store": "^1.2.2 || ^1.4.0-rc" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 31e985e66..7a9f81f16 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2262,10 +2262,10 @@ __metadata: languageName: node linkType: hard -"@types/use-sync-external-store@npm:^0.0.6": - version: 0.0.6 - resolution: "@types/use-sync-external-store@npm:0.0.6" - checksum: 10/a95ce330668501ad9b1c5b7f2b14872ad201e552a0e567787b8f1588b22c7040c7c3d80f142cbb9f92d13c4ea41c46af57a20f2af4edf27f224d352abcfe4049 +"@types/use-sync-external-store@npm:types-use-sync-external-store@rc": + version: 19.0.0-rc.1 + resolution: "types-use-sync-external-store@npm:19.0.0-rc.1" + checksum: 10/a57e1e6fcd8b34716432ada9cef9a6a1fbfc70b0c34d97442c997cf70895929ff85a574eb82e15799d024e90251ec28f3f1e4afada780a951b49c7cb84558501 languageName: node linkType: hard @@ -6154,7 +6154,7 @@ __metadata: "@types/prop-types": "npm:^15.7.12" "@types/react": "npm:types-react@rc" "@types/react-dom": "npm:types-react-dom@rc" - "@types/use-sync-external-store": "npm:^0.0.6" + "@types/use-sync-external-store": "npm:types-use-sync-external-store@rc" babel-eslint: "npm:^10.1.0" codecov: "npm:^3.8.3" cross-env: "npm:^7.0.3" From 2de88c087639e3d4e37a50c68c9a4a0a345d7b40 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Thu, 16 May 2024 09:56:44 -0500 Subject: [PATCH 17/29] Fix skipped tests in `ssr.spec.tsx` --- test/integration/ssr.spec.tsx | 44 ++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/test/integration/ssr.spec.tsx b/test/integration/ssr.spec.tsx index cb3424874..9af3e3e7b 100644 --- a/test/integration/ssr.spec.tsx +++ b/test/integration/ssr.spec.tsx @@ -1,3 +1,4 @@ +import { IS_REACT_19 } from '@internal/utils/react-is.js' import type { PayloadAction } from '@reduxjs/toolkit' import { createSlice, createStore } from '@reduxjs/toolkit' import * as rtl from '@testing-library/react' @@ -111,17 +112,18 @@ describe('New v8 serverState behavior', () => { const Spinner = () =>

- if (!IS_REACT_18) { - it('Dummy test for React 17, ignore', () => {}) - return - } - - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) + const consoleErrorSpy = vi + .spyOn(console, 'error') + .mockImplementation(() => {}) afterEach(() => { vi.clearAllMocks() }) + afterAll(() => { + vi.restoreAllMocks() + }) + it('Handles hydration correctly', async () => { const ssrStore = createStore(dataSlice.reducer) @@ -154,19 +156,35 @@ describe('New v8 serverState behavior', () => { , + { + onRecoverableError: IS_REACT_19 + ? (error, errorInfo) => { + console.error(error) + } + : undefined, + }, ) }) - const [lastCall = []] = consoleError.mock.calls.slice(-1) + const { lastCall = [] } = consoleErrorSpy.mock const [errorArg] = lastCall expect(errorArg).toBeInstanceOf(Error) - expect(/There was an error while hydrating/.test(errorArg.message)).toBe( - true, - ) - vi.resetAllMocks() + if (IS_REACT_19) { + expect(consoleErrorSpy).toHaveBeenCalledOnce() + + expect(errorArg.message).toMatch( + /Hydration failed because the server rendered HTML didn't match the client/, + ) + } else if (IS_REACT_18) { + expect(consoleErrorSpy).toHaveBeenCalledTimes(8) + + expect(errorArg.message).toMatch(/There was an error while hydrating/) + } + + vi.clearAllMocks() - expect(consoleError.mock.calls.length).toBe(0) + expect(consoleErrorSpy).not.toHaveBeenCalled() document.body.removeChild(rootDiv) @@ -187,7 +205,7 @@ describe('New v8 serverState behavior', () => { ) }) - expect(consoleError.mock.calls.length).toBe(0) + expect(consoleErrorSpy).not.toHaveBeenCalled() // Buttons should both exist, and have the updated count due to later render const button1 = rtl.screen.getByText('useSelector:Hydrated. Count: 1') From b9846b0b8e32b5dab4acb60fe5094cb0ab9f89c8 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Thu, 16 May 2024 10:29:08 -0500 Subject: [PATCH 18/29] Change `.toHaveBeenCalledTimes(0)` to `.not.toHaveBeenCalled()` --- test/components/Provider.spec.tsx | 4 ++-- test/components/connect.spec.tsx | 12 ++++++------ test/integration/server-rendering.spec.tsx | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/components/Provider.spec.tsx b/test/components/Provider.spec.tsx index 31b74659d..f7b2e4d9b 100644 --- a/test/components/Provider.spec.tsx +++ b/test/components/Provider.spec.tsx @@ -80,7 +80,7 @@ describe('React', () => { , ) - expect(spy).toHaveBeenCalledTimes(0) + expect(spy).not.toHaveBeenCalled() spy.mockRestore() expect(tester.getByTestId('store')).toHaveTextContent( @@ -344,7 +344,7 @@ describe('React', () => { , ) - expect(spy).toHaveBeenCalledTimes(0) + expect(spy).not.toHaveBeenCalled() unmount() diff --git a/test/components/connect.spec.tsx b/test/components/connect.spec.tsx index 31f034def..4ffc5b8f5 100644 --- a/test/components/connect.spec.tsx +++ b/test/components/connect.spec.tsx @@ -204,7 +204,7 @@ describe('React', () => { , ) - expect(spy).toHaveBeenCalledTimes(0) + expect(spy).not.toHaveBeenCalled() spy.mockRestore() expect(tester.getByTestId('string')).toHaveTextContent('') @@ -247,7 +247,7 @@ describe('React', () => { , ) - expect(spy).toHaveBeenCalledTimes(0) + expect(spy).not.toHaveBeenCalled() spy.mockRestore() expect(tester.getByTestId('string')).toHaveTextContent('') @@ -1310,7 +1310,7 @@ describe('React', () => { // TODO Getting4 instead of 3 // expect(mapStateToPropsCalls).toBe(3) expect(mapStateToPropsCalls).toBe(4) - expect(spy).toHaveBeenCalledTimes(0) + expect(spy).not.toHaveBeenCalled() spy.mockRestore() }) @@ -1345,7 +1345,7 @@ describe('React', () => { const spy = vi.spyOn(console, 'error').mockImplementation(() => {}) unmount() - expect(spy).toHaveBeenCalledTimes(0) + expect(spy).not.toHaveBeenCalled() expect(mapStateToPropsCalls).toBe(1) spy.mockRestore() }) @@ -1383,7 +1383,7 @@ describe('React', () => { store.dispatch({ type: 'APPEND', body: 'a' }) }) - expect(spy).toHaveBeenCalledTimes(0) + expect(spy).not.toHaveBeenCalled() expect(mapStateToPropsCalls).toBe(1) spy.mockRestore() }) @@ -2110,7 +2110,7 @@ describe('React', () => { , ) - expect(mapStateToProps).toHaveBeenCalledTimes(0) + expect(mapStateToProps).not.toHaveBeenCalled() rtl.act(() => { store.dispatch({ type: 'INC' }) }) diff --git a/test/integration/server-rendering.spec.tsx b/test/integration/server-rendering.spec.tsx index 5d88414e3..ff2f9a75e 100644 --- a/test/integration/server-rendering.spec.tsx +++ b/test/integration/server-rendering.spec.tsx @@ -105,7 +105,7 @@ describe('React', () => { , ) - expect(spy).toHaveBeenCalledTimes(0) + expect(spy).not.toHaveBeenCalled() spy.mockRestore() }) From 7d48677d5f8211af84afea430930084544f7a775 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Thu, 16 May 2024 10:30:19 -0500 Subject: [PATCH 19/29] Change `.toHaveBeenCalledTimes(1)` to `.toHaveBeenCalledOnce()` --- test/components/Provider.spec.tsx | 4 +-- test/components/connect.spec.tsx | 48 +++++++++++++++---------------- test/components/hooks.spec.tsx | 6 ++-- test/hooks/useSelector.spec.tsx | 8 +++--- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/test/components/Provider.spec.tsx b/test/components/Provider.spec.tsx index f7b2e4d9b..5cfc58fa2 100644 --- a/test/components/Provider.spec.tsx +++ b/test/components/Provider.spec.tsx @@ -198,7 +198,7 @@ describe('React', () => { , ) - expect(innerMapStateToProps).toHaveBeenCalledTimes(1) + expect(innerMapStateToProps).toHaveBeenCalledOnce() rtl.act(() => { innerStore.dispatch({ type: 'INC' }) @@ -348,7 +348,7 @@ describe('React', () => { unmount() - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() }) it('should handle store and children change in a the same render', () => { diff --git a/test/components/connect.spec.tsx b/test/components/connect.spec.tsx index 4ffc5b8f5..fd6199353 100644 --- a/test/components/connect.spec.tsx +++ b/test/components/connect.spec.tsx @@ -651,7 +651,7 @@ describe('React', () => { )} , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy.mock.calls[0][0]).toMatch( /mapStateToProps\(\) in Connect\(Container\) must return a plain object/, ) @@ -668,7 +668,7 @@ describe('React', () => { )} , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy.mock.calls[0][0]).toMatch( /mapStateToProps\(\) in Connect\(Container\) must return a plain object/, ) @@ -685,7 +685,7 @@ describe('React', () => { )} , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy.mock.calls[0][0]).toMatch( /mapStateToProps\(\) in Connect\(Container\) must return a plain object/, ) @@ -702,7 +702,7 @@ describe('React', () => { )} , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy.mock.calls[0][0]).toMatch( /mapDispatchToProps\(\) in Connect\(Container\) must return a plain object/, ) @@ -719,7 +719,7 @@ describe('React', () => { )} , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy.mock.calls[0][0]).toMatch( /mapDispatchToProps\(\) in Connect\(Container\) must return a plain object/, ) @@ -736,7 +736,7 @@ describe('React', () => { )} , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy.mock.calls[0][0]).toMatch( /mapDispatchToProps\(\) in Connect\(Container\) must return a plain object/, ) @@ -753,7 +753,7 @@ describe('React', () => { )} , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy.mock.calls[0][0]).toMatch( /mergeProps\(\) in Connect\(Container\) must return a plain object/, ) @@ -770,7 +770,7 @@ describe('React', () => { )} , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy.mock.calls[0][0]).toMatch( /mergeProps\(\) in Connect\(Container\) must return a plain object/, ) @@ -787,7 +787,7 @@ describe('React', () => { )} , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy.mock.calls[0][0]).toMatch( /mergeProps\(\) in Connect\(Container\) must return a plain object/, ) @@ -1488,7 +1488,7 @@ describe('React', () => { , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(tester.getByTestId('string')).toHaveTextContent('') rtl.act(() => { store.dispatch({ type: 'APPEND', body: 'a' }) @@ -1583,7 +1583,7 @@ describe('React', () => { } const tester = rtl.render() - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(tester.getByTestId('string')).toHaveTextContent('') expect(tester.getByTestId('pass')).toHaveTextContent('') @@ -2051,7 +2051,7 @@ describe('React', () => { , ) - expect(mapStateToProps).toHaveBeenCalledTimes(1) + expect(mapStateToProps).toHaveBeenCalledOnce() rtl.act(() => { store.dispatch({ type: 'INC' }) }) @@ -2114,11 +2114,11 @@ describe('React', () => { rtl.act(() => { store.dispatch({ type: 'INC' }) }) - expect(mapStateToProps).toHaveBeenCalledTimes(1) + expect(mapStateToProps).toHaveBeenCalledOnce() rtl.act(() => { store.dispatch({ type: 'INC' }) }) - expect(mapStateToProps).toHaveBeenCalledTimes(1) + expect(mapStateToProps).toHaveBeenCalledOnce() }) }) @@ -2381,9 +2381,9 @@ describe('React', () => { expect(tester.getByTestId('b')).toHaveTextContent('3') expect(tester.getByTestId('c')).toHaveTextContent('1') - expect(c3Spy).toHaveBeenCalledTimes(1) - expect(c2Spy).toHaveBeenCalledTimes(1) - expect(c1Spy).toHaveBeenCalledTimes(1) + expect(c3Spy).toHaveBeenCalledOnce() + expect(c2Spy).toHaveBeenCalledOnce() + expect(c1Spy).toHaveBeenCalledOnce() rtl.act(() => { store1.dispatch({ type: 'CHANGE' }) @@ -2395,7 +2395,7 @@ describe('React', () => { expect(tester.getByTestId('c')).toHaveTextContent('2') expect(c3Spy).toHaveBeenCalledTimes(2) - expect(c2Spy).toHaveBeenCalledTimes(1) + expect(c2Spy).toHaveBeenCalledOnce() expect(c1Spy).toHaveBeenCalledTimes(2) rtl.act(() => { @@ -2485,16 +2485,16 @@ describe('React', () => { , ) - expect(mapStateToPropsB).toHaveBeenCalledTimes(1) - expect(mapStateToPropsC).toHaveBeenCalledTimes(1) - expect(mapStateToPropsD).toHaveBeenCalledTimes(1) + expect(mapStateToPropsB).toHaveBeenCalledOnce() + expect(mapStateToPropsC).toHaveBeenCalledOnce() + expect(mapStateToPropsD).toHaveBeenCalledOnce() rtl.act(() => { store1.dispatch({ type: 'INC' }) }) - expect(mapStateToPropsB).toHaveBeenCalledTimes(1) - expect(mapStateToPropsC).toHaveBeenCalledTimes(1) + expect(mapStateToPropsB).toHaveBeenCalledOnce() + expect(mapStateToPropsC).toHaveBeenCalledOnce() expect(mapStateToPropsD).toHaveBeenCalledTimes(2) rtl.act(() => { @@ -2955,7 +2955,7 @@ describe('React', () => { , ) - expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledOnce() expect(spy).toHaveBeenCalledWith( 'The `pure` option has been removed. `connect` is now always a "pure/memoized" component', ) diff --git a/test/components/hooks.spec.tsx b/test/components/hooks.spec.tsx index 7df7b33b5..f87225c26 100644 --- a/test/components/hooks.spec.tsx +++ b/test/components/hooks.spec.tsx @@ -117,17 +117,17 @@ describe('React', () => { ) // 1. Initial render - expect(mapStateSpy1).toHaveBeenCalledTimes(1) + expect(mapStateSpy1).toHaveBeenCalledOnce() // 1.Initial render // 2. C1 useEffect expect(renderSpy1).toHaveBeenCalledTimes(2) // 1. Initial render - expect(mapStateSpy2).toHaveBeenCalledTimes(1) + expect(mapStateSpy2).toHaveBeenCalledOnce() // 1. Initial render - expect(renderSpy2).toHaveBeenCalledTimes(1) + expect(renderSpy2).toHaveBeenCalledOnce() rtl.act(() => { store.dispatch({ type: 'FOO' }) diff --git a/test/hooks/useSelector.spec.tsx b/test/hooks/useSelector.spec.tsx index 6ab62f390..cadae0f90 100644 --- a/test/hooks/useSelector.spec.tsx +++ b/test/hooks/useSelector.spec.tsx @@ -108,7 +108,7 @@ describe('React', () => { ) expect(result).toEqual(0) - expect(selector).toHaveBeenCalledTimes(1) + expect(selector).toHaveBeenCalledOnce() rtl.act(() => { normalStore.dispatch({ type: '' }) @@ -386,7 +386,7 @@ describe('React', () => { , ) - expect(selector).toHaveBeenCalledTimes(1) + expect(selector).toHaveBeenCalledOnce() expect(renderedItems.length).toEqual(1) rtl.act(() => { @@ -973,7 +973,7 @@ describe('React', () => { , ) - expect(selector).toHaveBeenCalledTimes(1) + expect(selector).toHaveBeenCalledOnce() rtl.cleanup() @@ -988,7 +988,7 @@ describe('React', () => { , ) - expect(selector).toHaveBeenCalledTimes(1) + expect(selector).toHaveBeenCalledOnce() }) it('always runs check if context or hook specifies', () => { rtl.render( From 86779ff964cf7cefb0ff22634b84f06ba8915465 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Sat, 18 May 2024 23:23:23 -0500 Subject: [PATCH 20/29] Fix duplicate `React` import in `hoistStatics.ts` --- src/utils/hoistStatics.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/utils/hoistStatics.ts b/src/utils/hoistStatics.ts index 2e93931f2..fccbc8cb7 100644 --- a/src/utils/hoistStatics.ts +++ b/src/utils/hoistStatics.ts @@ -6,7 +6,11 @@ * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ -import type * as React from 'react' +import type { + ComponentType, + ForwardRefExoticComponent, + MemoExoticComponent, +} from 'react' import { ForwardRef, Memo, isMemo } from '../utils/react-is' const REACT_STATICS = { @@ -66,16 +70,16 @@ function getStatics(component: any) { } export type NonReactStatics< - S extends React.ComponentType, + S extends ComponentType, C extends { [key: string]: true } = {}, > = { [key in Exclude< keyof S, - S extends React.MemoExoticComponent + S extends MemoExoticComponent ? keyof typeof MEMO_STATICS | keyof C - : S extends React.ForwardRefExoticComponent + : S extends ForwardRefExoticComponent ? keyof typeof FORWARD_REF_STATICS | keyof C : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C >]: S[key] @@ -89,8 +93,8 @@ const getPrototypeOf = Object.getPrototypeOf const objectPrototype = Object.prototype export default function hoistNonReactStatics< - T extends React.ComponentType, - S extends React.ComponentType, + T extends ComponentType, + S extends ComponentType, C extends { [key: string]: true } = {}, From deda394aef39d9ea53ee931d0532b08e8af83625 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Tue, 25 Jun 2024 22:35:39 -0500 Subject: [PATCH 21/29] Bump `@testing-library/dom` to version 10.4.0 --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 567ef7ed9..0c06fbfcb 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "@babel/preset-typescript": "^7.24.7", "@microsoft/api-extractor": "^7.47.0", "@reduxjs/toolkit": "^2.2.5", - "@testing-library/dom": "^10.1.0", + "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^16.0.0", "@types/node": "^20.14.2", diff --git a/yarn.lock b/yarn.lock index 7a9f81f16..5b309decf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2132,7 +2132,7 @@ __metadata: languageName: node linkType: hard -"@testing-library/dom@npm:^10.1.0": +"@testing-library/dom@npm:^10.4.0": version: 10.4.0 resolution: "@testing-library/dom@npm:10.4.0" dependencies: @@ -6147,7 +6147,7 @@ __metadata: "@babel/preset-typescript": "npm:^7.24.7" "@microsoft/api-extractor": "npm:^7.47.0" "@reduxjs/toolkit": "npm:^2.2.5" - "@testing-library/dom": "npm:^10.1.0" + "@testing-library/dom": "npm:^10.4.0" "@testing-library/jest-dom": "npm:^6.4.5" "@testing-library/react": "npm:^16.0.0" "@types/node": "npm:^20.14.2" From 5cb1e0ab4eb648a2bcae9fa8e409c2c23a1b656d Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Tue, 25 Jun 2024 22:36:16 -0500 Subject: [PATCH 22/29] Bump `@testing-library/jest-dom` to version 6.6.3 --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0c06fbfcb..8d9bbeebf 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@microsoft/api-extractor": "^7.47.0", "@reduxjs/toolkit": "^2.2.5", "@testing-library/dom": "^10.4.0", - "@testing-library/jest-dom": "^6.4.5", + "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.0", "@types/node": "^20.14.2", "@types/prop-types": "^15.7.12", diff --git a/yarn.lock b/yarn.lock index 5b309decf..3c26a5e17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2148,7 +2148,7 @@ __metadata: languageName: node linkType: hard -"@testing-library/jest-dom@npm:^6.4.5": +"@testing-library/jest-dom@npm:^6.6.3": version: 6.6.3 resolution: "@testing-library/jest-dom@npm:6.6.3" dependencies: @@ -6148,7 +6148,7 @@ __metadata: "@microsoft/api-extractor": "npm:^7.47.0" "@reduxjs/toolkit": "npm:^2.2.5" "@testing-library/dom": "npm:^10.4.0" - "@testing-library/jest-dom": "npm:^6.4.5" + "@testing-library/jest-dom": "npm:^6.6.3" "@testing-library/react": "npm:^16.0.0" "@types/node": "npm:^20.14.2" "@types/prop-types": "npm:^15.7.12" From ae6200bbad668b192d758c8ef7ea00e06766d01a Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Wed, 24 Jul 2024 23:24:16 -0500 Subject: [PATCH 23/29] Bump `jsdom` to version 25.0.1 --- package.json | 2 +- yarn.lock | 89 +++++++++++++++++++--------------------------------- 2 files changed, 33 insertions(+), 58 deletions(-) diff --git a/package.json b/package.json index 8d9bbeebf..c060fe77a 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.34.2", - "jsdom": "^24.1.0", + "jsdom": "^25.0.1", "prettier": "^3.3.3", "react": "19.0.0-rc.1", "react-dom": "19.0.0-rc.1", diff --git a/yarn.lock b/yarn.lock index 3c26a5e17..d594c1621 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3192,7 +3192,7 @@ __metadata: languageName: node linkType: hard -"cssstyle@npm:^4.0.1": +"cssstyle@npm:^4.1.0": version: 4.1.0 resolution: "cssstyle@npm:4.1.0" dependencies: @@ -5059,11 +5059,11 @@ __metadata: languageName: node linkType: hard -"jsdom@npm:^24.1.0": - version: 24.1.3 - resolution: "jsdom@npm:24.1.3" +"jsdom@npm:^25.0.1": + version: 25.0.1 + resolution: "jsdom@npm:25.0.1" dependencies: - cssstyle: "npm:^4.0.1" + cssstyle: "npm:^4.1.0" data-urls: "npm:^5.0.0" decimal.js: "npm:^10.4.3" form-data: "npm:^4.0.0" @@ -5076,7 +5076,7 @@ __metadata: rrweb-cssom: "npm:^0.7.1" saxes: "npm:^6.0.0" symbol-tree: "npm:^3.2.4" - tough-cookie: "npm:^4.1.4" + tough-cookie: "npm:^5.0.0" w3c-xmlserializer: "npm:^5.0.0" webidl-conversions: "npm:^7.0.0" whatwg-encoding: "npm:^3.1.1" @@ -5089,7 +5089,7 @@ __metadata: peerDependenciesMeta: canvas: optional: true - checksum: 10/81e01d092a3620a9749e46572c26b21eb1fefc4e593f99e4acf3d4a803dfb091917e7b7096b3e62fab87e1d525a4030b803be1f5dbb5e7e61435d726f82f7457 + checksum: 10/e6bf7250ddd2fbcf68da0ea041a0dc63545dc4bf77fa3ff40a46ae45b1dac1ca55b87574ab904d1f8baeeb547c52cec493a22f545d7d413b320011f41150ec49 languageName: node linkType: hard @@ -6062,15 +6062,6 @@ __metadata: languageName: node linkType: hard -"psl@npm:^1.1.33": - version: 1.15.0 - resolution: "psl@npm:1.15.0" - dependencies: - punycode: "npm:^2.3.1" - checksum: 10/5e7467eb5196eb7900d156783d12907d445c0122f76c73203ce96b148a6ccf8c5450cc805887ffada38ff92d634afcf33720c24053cb01d5b6598d1c913c5caf - languageName: node - linkType: hard - "punycode@npm:^1.3.2": version: 1.4.1 resolution: "punycode@npm:1.4.1" @@ -6078,20 +6069,13 @@ __metadata: languageName: node linkType: hard -"punycode@npm:^2.1.0, punycode@npm:^2.1.1, punycode@npm:^2.3.1": +"punycode@npm:^2.1.0, punycode@npm:^2.3.1": version: 2.3.1 resolution: "punycode@npm:2.3.1" checksum: 10/febdc4362bead22f9e2608ff0171713230b57aff9dddc1c273aa2a651fbd366f94b7d6a71d78342a7c0819906750351ca7f2edd26ea41b626d87d6a13d1bd059 languageName: node linkType: hard -"querystringify@npm:^2.1.1": - version: 2.2.0 - resolution: "querystringify@npm:2.2.0" - checksum: 10/46ab16f252fd892fc29d6af60966d338cdfeea68a231e9457631ffd22d67cec1e00141e0a5236a2eb16c0d7d74175d9ec1d6f963660c6f2b1c2fc85b194c5680 - languageName: node - linkType: hard - "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -6164,7 +6148,7 @@ __metadata: eslint-plugin-import: "npm:^2.29.1" eslint-plugin-prettier: "npm:^5.1.3" eslint-plugin-react: "npm:^7.34.2" - jsdom: "npm:^24.1.0" + jsdom: "npm:^25.0.1" prettier: "npm:^3.3.3" react: "npm:19.0.0-rc.1" react-dom: "npm:19.0.0-rc.1" @@ -6334,13 +6318,6 @@ __metadata: languageName: node linkType: hard -"requires-port@npm:^1.0.0": - version: 1.0.0 - resolution: "requires-port@npm:1.0.0" - checksum: 10/878880ee78ccdce372784f62f52a272048e2d0827c29ae31e7f99da18b62a2b9463ea03a75f277352f4697c100183debb0532371ad515a2d49d4bfe596dd4c20 - languageName: node - linkType: hard - "reselect@npm:^5.1.0": version: 5.1.1 resolution: "reselect@npm:5.1.1" @@ -7119,6 +7096,24 @@ __metadata: languageName: node linkType: hard +"tldts-core@npm:^6.1.65": + version: 6.1.65 + resolution: "tldts-core@npm:6.1.65" + checksum: 10/06ae49ae935674163d806aa14abf6bb49a6099878ef3940de035c6bf577cf31b78122df02d2e82d84d0a59faf8a837235d537ee7cbf9a5b0b97b44b7a5f19799 + languageName: node + linkType: hard + +"tldts@npm:^6.1.32": + version: 6.1.65 + resolution: "tldts@npm:6.1.65" + dependencies: + tldts-core: "npm:^6.1.65" + bin: + tldts: bin/cli.js + checksum: 10/dc8afe3ac8af4f2dc4b4307d447b6877ee5942e4b8164ae170edf034a318241ca7f9bdf89d4560204363141344959aa4d28edc532397b210532e160acbf77b6a + languageName: node + linkType: hard + "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1" @@ -7128,15 +7123,12 @@ __metadata: languageName: node linkType: hard -"tough-cookie@npm:^4.1.4": - version: 4.1.4 - resolution: "tough-cookie@npm:4.1.4" +"tough-cookie@npm:^5.0.0": + version: 5.0.0 + resolution: "tough-cookie@npm:5.0.0" dependencies: - psl: "npm:^1.1.33" - punycode: "npm:^2.1.1" - universalify: "npm:^0.2.0" - url-parse: "npm:^1.5.3" - checksum: 10/75663f4e2cd085f16af0b217e4218772adf0617fb3227171102618a54ce0187a164e505d61f773ed7d65988f8ff8a8f935d381f87da981752c1171b076b4afac + tldts: "npm:^6.1.32" + checksum: 10/a98d3846ed386e399e8b470c1eb08a6a296944246eabc55c9fe79d629bd2cdaa62f5a6572f271fe0060987906bd20468d72a219a3b4cbe51086bea48d2d677b6 languageName: node linkType: hard @@ -7464,13 +7456,6 @@ __metadata: languageName: node linkType: hard -"universalify@npm:^0.2.0": - version: 0.2.0 - resolution: "universalify@npm:0.2.0" - checksum: 10/e86134cb12919d177c2353196a4cc09981524ee87abf621f7bc8d249dbbbebaec5e7d1314b96061497981350df786e4c5128dbf442eba104d6e765bc260678b5 - languageName: node - linkType: hard - "update-browserslist-db@npm:^1.1.1": version: 1.1.1 resolution: "update-browserslist-db@npm:1.1.1" @@ -7494,16 +7479,6 @@ __metadata: languageName: node linkType: hard -"url-parse@npm:^1.5.3": - version: 1.5.10 - resolution: "url-parse@npm:1.5.10" - dependencies: - querystringify: "npm:^2.1.1" - requires-port: "npm:^1.0.0" - checksum: 10/c9e96bc8c5b34e9f05ddfeffc12f6aadecbb0d971b3cc26015b58d5b44676a99f50d5aeb1e5c9e61fa4d49961ae3ab1ae997369ed44da51b2f5ac010d188e6ad - languageName: node - linkType: hard - "urlgrey@npm:1.0.0": version: 1.0.0 resolution: "urlgrey@npm:1.0.0" From d0add7fdab43a8c426a26559d3c0afa514753749 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Wed, 4 Sep 2024 08:16:59 -0500 Subject: [PATCH 24/29] Bump `@testing-library/react` to version 16.1.0 --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index c060fe77a..cb66841dc 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "@reduxjs/toolkit": "^2.2.5", "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", - "@testing-library/react": "^16.0.0", + "@testing-library/react": "^16.1.0", "@types/node": "^20.14.2", "@types/prop-types": "^15.7.12", "@types/react": "npm:types-react@rc", diff --git a/yarn.lock b/yarn.lock index d594c1621..8ea866854 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2163,23 +2163,23 @@ __metadata: languageName: node linkType: hard -"@testing-library/react@npm:^16.0.0": - version: 16.0.1 - resolution: "@testing-library/react@npm:16.0.1" +"@testing-library/react@npm:^16.1.0": + version: 16.1.0 + resolution: "@testing-library/react@npm:16.1.0" dependencies: "@babel/runtime": "npm:^7.12.5" peerDependencies: "@testing-library/dom": ^10.0.0 - "@types/react": ^18.0.0 - "@types/react-dom": ^18.0.0 - react: ^18.0.0 - react-dom: ^18.0.0 + "@types/react": ^18.0.0 || ^19.0.0 + "@types/react-dom": ^18.0.0 || ^19.0.0 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 peerDependenciesMeta: "@types/react": optional: true "@types/react-dom": optional: true - checksum: 10/904b48881cf5bd208e25899e168f5c99c78ed6d77389544838d9d861a038d2c5c5385863ee9a367436770cbf7d21c5e05a991b9e24a33806e9ac985df2448185 + checksum: 10/2a20e0dbfadbc93d45a84e82281ed47deed54a6a5fc1461a523172d7fbc0481e8502cf98a2080f38aba94290b3d745671a1c9e320e6f76ad6afcca67c580b963 languageName: node linkType: hard @@ -6133,7 +6133,7 @@ __metadata: "@reduxjs/toolkit": "npm:^2.2.5" "@testing-library/dom": "npm:^10.4.0" "@testing-library/jest-dom": "npm:^6.6.3" - "@testing-library/react": "npm:^16.0.0" + "@testing-library/react": "npm:^16.1.0" "@types/node": "npm:^20.14.2" "@types/prop-types": "npm:^15.7.12" "@types/react": "npm:types-react@rc" From eaa8271ff5096e653abf4135c9c67a06cd1d6a42 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Thu, 5 Dec 2024 19:04:18 -0600 Subject: [PATCH 25/29] Fix skipped test in `test/integration/ssr.spec.tsx` --- test/hooks/useSelector.spec.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/hooks/useSelector.spec.tsx b/test/hooks/useSelector.spec.tsx index cadae0f90..e5ff66d51 100644 --- a/test/hooks/useSelector.spec.tsx +++ b/test/hooks/useSelector.spec.tsx @@ -587,7 +587,7 @@ describe('React', () => { spy.mockRestore() }) - it.skip('allows dealing with stale props by putting a specific connected component above the hooks component', () => { + it('allows dealing with stale props by putting a specific connected component above the hooks component', () => { const spy = vi.spyOn(console, 'error').mockImplementation(() => {}) const Parent = () => { @@ -626,9 +626,11 @@ describe('React', () => { , ) - normalStore.dispatch({ type: '' }) + rtl.act(() => { + normalStore.dispatch({ type: '' }) + }) - expect(sawInconsistentState).toBe(false) + expect(sawInconsistentState).toBe(true) spy.mockRestore() }) From a1fc886593262cee75b96a8c35bbbf00a1aa1e6c Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 6 Dec 2024 00:16:26 -0600 Subject: [PATCH 26/29] Fix type of `innerMapStateToProps` in `Provider.spec.tsx` --- test/components/Provider.spec.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/components/Provider.spec.tsx b/test/components/Provider.spec.tsx index 5cfc58fa2..276bede94 100644 --- a/test/components/Provider.spec.tsx +++ b/test/components/Provider.spec.tsx @@ -165,7 +165,7 @@ describe('React', () => { action.type === 'INC' ? state + 1 : state const innerStore = createStore(reducer) - const innerMapStateToProps = vi.fn<[number], TStateProps>((state) => ({ + const innerMapStateToProps = vi.fn((state: number) => ({ count: state, })) class Inner extends Component { From 1cd1385fc4d6845a209123ce68247ecb881daaf0 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 6 Dec 2024 02:25:03 -0600 Subject: [PATCH 27/29] Update `hoist-non-react-statics` implementation --- src/utils/hoistStatics.ts | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/utils/hoistStatics.ts b/src/utils/hoistStatics.ts index fccbc8cb7..d47668210 100644 --- a/src/utils/hoistStatics.ts +++ b/src/utils/hoistStatics.ts @@ -1,16 +1,12 @@ // Copied directly from: // https://github.com/mridgway/hoist-non-react-statics/blob/main/src/index.js -// https://unpkg.com/browse/@types/hoist-non-react-statics@3.3.1/index.d.ts +// https://unpkg.com/browse/@types/hoist-non-react-statics@3.3.6/index.d.ts /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ -import type { - ComponentType, - ForwardRefExoticComponent, - MemoExoticComponent, -} from 'react' +import type { ForwardRefExoticComponent, MemoExoticComponent } from 'react' import { ForwardRef, Memo, isMemo } from '../utils/react-is' const REACT_STATICS = { @@ -70,19 +66,19 @@ function getStatics(component: any) { } export type NonReactStatics< - S extends ComponentType, + Source, C extends { [key: string]: true } = {}, > = { [key in Exclude< - keyof S, - S extends MemoExoticComponent + keyof Source, + Source extends MemoExoticComponent ? keyof typeof MEMO_STATICS | keyof C - : S extends ForwardRefExoticComponent + : Source extends ForwardRefExoticComponent ? keyof typeof FORWARD_REF_STATICS | keyof C : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C - >]: S[key] + >]: Source[key] } const defineProperty = Object.defineProperty @@ -93,12 +89,15 @@ const getPrototypeOf = Object.getPrototypeOf const objectPrototype = Object.prototype export default function hoistNonReactStatics< - T extends ComponentType, - S extends ComponentType, - C extends { + Target, + Source, + CustomStatic extends { [key: string]: true } = {}, ->(targetComponent: T, sourceComponent: S): T & NonReactStatics { +>( + targetComponent: Target, + sourceComponent: Source, +): Target & NonReactStatics { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components From e08518ae110858ee47686059ddd6c6fefb9351a5 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 6 Dec 2024 13:07:10 -0600 Subject: [PATCH 28/29] Fix `act` related issues in `test/hooks/useSelector.spec.tsx` --- test/hooks/useSelector.spec.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/hooks/useSelector.spec.tsx b/test/hooks/useSelector.spec.tsx index e5ff66d51..d802e8e97 100644 --- a/test/hooks/useSelector.spec.tsx +++ b/test/hooks/useSelector.spec.tsx @@ -509,7 +509,11 @@ describe('React', () => { , ) - const doDispatch = () => normalStore.dispatch({ type: '' }) + const doDispatch = () => { + rtl.act(() => { + normalStore.dispatch({ type: '' }) + }) + } expect(doDispatch).not.toThrowError() spy.mockRestore() From c58e397241579734da25199e63131809e95ccd81 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Thu, 5 Dec 2024 18:39:00 -0600 Subject: [PATCH 29/29] Migrate to React 19 --- .github/workflows/test.yml | 12 +-- package.json | 12 +-- yarn.lock | 213 ++++++++++++++++++++++++------------- 3 files changed, 149 insertions(+), 88 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e7ed0299..293c75de3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,9 +55,9 @@ jobs: react-dom: { version: '^18', types: '^18' }, }, { - version: 'rc', - types: 'npm:types-react@rc', - react-dom: { version: 'rc', types: 'npm:types-react-dom@rc' }, + version: '^19', + types: '^19', + react-dom: { version: '^19', types: '^19' }, }, ] @@ -261,9 +261,9 @@ jobs: react-dom: { version: '^18', types: '^18' }, }, { - version: 'rc', - types: 'npm:types-react@rc', - react-dom: { version: 'rc', types: 'npm:types-react-dom@rc' }, + version: '^19', + types: '^19', + react-dom: { version: '^19', types: '^19' }, }, ] diff --git a/package.json b/package.json index cb66841dc..7f9c8187f 100644 --- a/package.json +++ b/package.json @@ -64,8 +64,8 @@ } }, "dependencies": { - "@types/use-sync-external-store": "npm:types-use-sync-external-store@rc", - "use-sync-external-store": "^1.2.2 || ^1.4.0-rc" + "@types/use-sync-external-store": "^0.0.6", + "use-sync-external-store": "^1.4.0" }, "devDependencies": { "@babel/cli": "^7.24.7", @@ -85,8 +85,8 @@ "@testing-library/react": "^16.1.0", "@types/node": "^20.14.2", "@types/prop-types": "^15.7.12", - "@types/react": "npm:types-react@rc", - "@types/react-dom": "npm:types-react-dom@rc", + "@types/react": "^19.0.1", + "@types/react-dom": "^19.0.1", "babel-eslint": "^10.1.0", "codecov": "^3.8.3", "cross-env": "^7.0.3", @@ -98,8 +98,8 @@ "eslint-plugin-react": "^7.34.2", "jsdom": "^25.0.1", "prettier": "^3.3.3", - "react": "19.0.0-rc.1", - "react-dom": "19.0.0-rc.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", "redux": "^5.0.1", "rimraf": "^5.0.7", "tsup": "^8.3.5", diff --git a/yarn.lock b/yarn.lock index 8ea866854..4486977f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -90,7 +90,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.25.9, @babel/generator@npm:^7.26.0": +"@babel/generator@npm:^7.25.9": version: 7.26.2 resolution: "@babel/generator@npm:7.26.2" dependencies: @@ -103,6 +103,19 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.26.0": + version: 7.26.3 + resolution: "@babel/generator@npm:7.26.3" + dependencies: + "@babel/parser": "npm:^7.26.3" + "@babel/types": "npm:^7.26.3" + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + jsesc: "npm:^3.0.2" + checksum: 10/c1d8710cc1c52af9d8d67f7d8ea775578aa500887b327d2a81e27494764a6ef99e438dd7e14cf7cd3153656492ee27a8362980dc438087c0ca39d4e75532c638 + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-annotate-as-pure@npm:7.25.9" @@ -317,7 +330,18 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2, @babel/parser@npm:^7.7.0": +"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.3, @babel/parser@npm:^7.7.0": + version: 7.26.3 + resolution: "@babel/parser@npm:7.26.3" + dependencies: + "@babel/types": "npm:^7.26.3" + bin: + parser: ./bin/babel-parser.js + checksum: 10/e7e3814b2dc9ee3ed605d38223471fa7d3a84cbe9474d2b5fa7ac57dc1ddf75577b1fd3a93bf7db8f41f28869bda795cddd80223f980be23623b6434bf4c88a8 + languageName: node + linkType: hard + +"@babel/parser@npm:^7.26.2": version: 7.26.2 resolution: "@babel/parser@npm:7.26.2" dependencies: @@ -1323,6 +1347,16 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.26.3": + version: 7.26.3 + resolution: "@babel/types@npm:7.26.3" + dependencies: + "@babel/helper-string-parser": "npm:^7.25.9" + "@babel/helper-validator-identifier": "npm:^7.25.9" + checksum: 10/c31d0549630a89abfa11410bf82a318b0c87aa846fbf5f9905e47ba5e2aa44f41cc746442f105d622c519e4dc532d35a8d8080460ff4692f9fc7485fbf3a00eb + languageName: node + linkType: hard + "@esbuild/aix-ppc64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/aix-ppc64@npm:0.21.5" @@ -2227,45 +2261,35 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.12": - version: 15.7.13 - resolution: "@types/prop-types@npm:15.7.13" - checksum: 10/8935cad87c683c665d09a055919d617fe951cb3b2d5c00544e3a913f861a2bd8d2145b51c9aa6d2457d19f3107ab40784c40205e757232f6a80cc8b1c815513c +"@types/prop-types@npm:^15.7.12": + version: 15.7.14 + resolution: "@types/prop-types@npm:15.7.14" + checksum: 10/d0c5407b9ccc3dd5fae0ccf9b1007e7622ba5e6f1c18399b4f24dff33619d469da4b9fa918a374f19dc0d9fe6a013362aab0b844b606cfc10676efba3f5f736d languageName: node linkType: hard -"@types/react-dom@npm:types-react-dom@rc": - version: 19.0.0-rc.1 - resolution: "types-react-dom@npm:19.0.0-rc.1" +"@types/react-dom@npm:^19.0.1": + version: 19.0.1 + resolution: "@types/react-dom@npm:19.0.1" dependencies: "@types/react": "npm:*" - checksum: 10/fca4e7565308a109d4b126e5c7f5c387789a0187c9a46cb2a5af6120a7014beaa05736841be0ae658c7115871088500ddb0ef0bce60a21af4ec899cee8bb3c75 + checksum: 10/59d0704e445a3e0d034ef016c92dc1bbec0ba6c1af084bf6de18f0ac3abd18a632961b7fd48668c519137d0bd7bfa77a8135a66c2725d4b7f68b830be263a564 languageName: node linkType: hard -"@types/react@npm:*": - version: 18.3.12 - resolution: "@types/react@npm:18.3.12" +"@types/react@npm:*, @types/react@npm:^19.0.1": + version: 19.0.1 + resolution: "@types/react@npm:19.0.1" dependencies: - "@types/prop-types": "npm:*" csstype: "npm:^3.0.2" - checksum: 10/c9bbdfeacd5347d2240e0d2cb5336bc57dbc1b9ff557b6c4024b49df83419e4955553518169d3736039f1b62608e15b35762a6c03d49bd86e33add4b43b19033 + checksum: 10/930dd4904047059c48ae64a90fc5e8078b5bac0a14c9d927917e5a07e88e4e5073ddc944cbde90a955f9f815c23b7112caea63e407bc423913073bedecb097aa languageName: node linkType: hard -"@types/react@npm:types-react@rc": - version: 19.0.0-rc.1 - resolution: "types-react@npm:19.0.0-rc.1" - dependencies: - csstype: "npm:^3.0.2" - checksum: 10/342da9ffeab93600a0cff4c8829e5350d935577e3f81bce7ead41d7cd074035e2c4a4bdd976fa8e3f5390fe6a32169370a805291a88a77c2f2ce2613bde54587 - languageName: node - linkType: hard - -"@types/use-sync-external-store@npm:types-use-sync-external-store@rc": - version: 19.0.0-rc.1 - resolution: "types-use-sync-external-store@npm:19.0.0-rc.1" - checksum: 10/a57e1e6fcd8b34716432ada9cef9a6a1fbfc70b0c34d97442c997cf70895929ff85a574eb82e15799d024e90251ec28f3f1e4afada780a951b49c7cb84558501 +"@types/use-sync-external-store@npm:^0.0.6": + version: 0.0.6 + resolution: "@types/use-sync-external-store@npm:0.0.6" + checksum: 10/a95ce330668501ad9b1c5b7f2b14872ad201e552a0e567787b8f1588b22c7040c7c3d80f142cbb9f92d13c4ea41c46af57a20f2af4edf27f224d352abcfe4049 languageName: node linkType: hard @@ -2958,16 +2982,25 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.2, call-bind@npm:^1.0.5, call-bind@npm:^1.0.6, call-bind@npm:^1.0.7": - version: 1.0.7 - resolution: "call-bind@npm:1.0.7" +"call-bind-apply-helpers@npm:^1.0.0": + version: 1.0.0 + resolution: "call-bind-apply-helpers@npm:1.0.0" dependencies: - es-define-property: "npm:^1.0.0" es-errors: "npm:^1.3.0" function-bind: "npm:^1.1.2" + checksum: 10/853e9c30632a356ad0f66037b65f6c45eabecb5570012b6be53f2d83f03c61c845fcb0e4eb5ff8a0d7e3877d36588950d822d4beb742c9cfa90f4bf62a9fe960 + languageName: node + linkType: hard + +"call-bind@npm:^1.0.2, call-bind@npm:^1.0.5, call-bind@npm:^1.0.6, call-bind@npm:^1.0.7": + version: 1.0.8 + resolution: "call-bind@npm:1.0.8" + dependencies: + call-bind-apply-helpers: "npm:^1.0.0" + es-define-property: "npm:^1.0.0" get-intrinsic: "npm:^1.2.4" - set-function-length: "npm:^1.2.1" - checksum: 10/cd6fe658e007af80985da5185bff7b55e12ef4c2b6f41829a26ed1eef254b1f1c12e3dfd5b2b068c6ba8b86aba62390842d81752e67dcbaec4f6f76e7113b6b7 + set-function-length: "npm:^1.2.2" + checksum: 10/659b03c79bbfccf0cde3a79e7d52570724d7290209823e1ca5088f94b52192dc1836b82a324d0144612f816abb2f1734447438e38d9dafe0b3f82c2a1b9e3bce languageName: node linkType: hard @@ -3251,15 +3284,15 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.7": - version: 4.3.7 - resolution: "debug@npm:4.3.7" +"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.3.7": + version: 4.4.0 + resolution: "debug@npm:4.4.0" dependencies: ms: "npm:^2.1.3" peerDependenciesMeta: supports-color: optional: true - checksum: 10/71168908b9a78227ab29d5d25fe03c5867750e31ce24bf2c44a86efc5af041758bb56569b0a3d48a9b5344c00a24a777e6f4100ed6dfd9534a42c1dde285125a + checksum: 10/1847944c2e3c2c732514b93d11886575625686056cd765336212dc15de2d2b29612b6cd80e1afba767bb8e1803b778caf9973e98169ef1a24a7a7009e1820367 languageName: node linkType: hard @@ -3272,6 +3305,18 @@ __metadata: languageName: node linkType: hard +"debug@npm:^4.3.5": + version: 4.3.7 + resolution: "debug@npm:4.3.7" + dependencies: + ms: "npm:^2.1.3" + peerDependenciesMeta: + supports-color: + optional: true + checksum: 10/71168908b9a78227ab29d5d25fe03c5867750e31ce24bf2c44a86efc5af041758bb56569b0a3d48a9b5344c00a24a777e6f4100ed6dfd9534a42c1dde285125a + languageName: node + linkType: hard + "decimal.js@npm:^10.4.3": version: 10.4.3 resolution: "decimal.js@npm:10.4.3" @@ -3379,6 +3424,17 @@ __metadata: languageName: node linkType: hard +"dunder-proto@npm:^1.0.0": + version: 1.0.0 + resolution: "dunder-proto@npm:1.0.0" + dependencies: + call-bind-apply-helpers: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + gopd: "npm:^1.2.0" + checksum: 10/08e0487edc6b5f5e7cc91cbbe2cd7a81919f296b2e8092277776a75280005b340ab22c12b16ad0371c531e76d11898dae617325573144f50839e8f310df2a6ef + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -3502,11 +3558,9 @@ __metadata: linkType: hard "es-define-property@npm:^1.0.0": - version: 1.0.0 - resolution: "es-define-property@npm:1.0.0" - dependencies: - get-intrinsic: "npm:^1.2.4" - checksum: 10/f66ece0a887b6dca71848fa71f70461357c0e4e7249696f81bad0a1f347eed7b31262af4a29f5d726dc026426f085483b6b90301855e647aa8e21936f07293c6 + version: 1.0.1 + resolution: "es-define-property@npm:1.0.1" + checksum: 10/f8dc9e660d90919f11084db0a893128f3592b781ce967e4fccfb8f3106cb83e400a4032c559184ec52ee1dbd4b01e7776c7cd0b3327b1961b1a4a7008920fe78 languageName: node linkType: hard @@ -4435,12 +4489,10 @@ __metadata: languageName: node linkType: hard -"gopd@npm:^1.0.1, gopd@npm:^1.1.0": - version: 1.1.0 - resolution: "gopd@npm:1.1.0" - dependencies: - get-intrinsic: "npm:^1.2.4" - checksum: 10/4e633d3425483d8639daf85ea5dc50f8cdfb497bcf5ac814a3d66595b2b39a008e5491ee59118e281d486e5e53487bc9a95f9477d022e99a0c2d956f8b91f9e9 +"gopd@npm:^1.0.1, gopd@npm:^1.1.0, gopd@npm:^1.2.0": + version: 1.2.0 + resolution: "gopd@npm:1.2.0" + checksum: 10/94e296d69f92dc1c0768fcfeecfb3855582ab59a7c75e969d5f96ce50c3d201fd86d5a2857c22565764d5bb8a816c7b1e58f133ec318cd56274da36c5e3fb1a1 languageName: node linkType: hard @@ -4481,7 +4533,7 @@ __metadata: languageName: node linkType: hard -"has-proto@npm:^1.0.1, has-proto@npm:^1.0.3": +"has-proto@npm:^1.0.1": version: 1.1.0 resolution: "has-proto@npm:1.1.0" dependencies: @@ -4490,6 +4542,15 @@ __metadata: languageName: node linkType: hard +"has-proto@npm:^1.0.3": + version: 1.2.0 + resolution: "has-proto@npm:1.2.0" + dependencies: + dunder-proto: "npm:^1.0.0" + checksum: 10/7eaed07728eaa28b77fadccabce53f30de467ff186a766872669a833ac2e87d8922b76a22cc58339d7e0277aefe98d6d00762113b27a97cdf65adcf958970935 + languageName: node + linkType: hard + "has-symbols@npm:^1.0.3": version: 1.1.0 resolution: "has-symbols@npm:1.1.0" @@ -6083,14 +6144,14 @@ __metadata: languageName: node linkType: hard -"react-dom@npm:19.0.0-rc.1": - version: 19.0.0-rc.1 - resolution: "react-dom@npm:19.0.0-rc.1" +"react-dom@npm:^19.0.0": + version: 19.0.0 + resolution: "react-dom@npm:19.0.0" dependencies: - scheduler: "npm:0.25.0-rc.1" + scheduler: "npm:^0.25.0" peerDependencies: - react: 19.0.0-rc.1 - checksum: 10/9c3f79fe8f8fd10e8a86476df1670d3920f1c1083e56285b5c31d96ca18d223e9d1e78b6b5534ce7ab90a57e2d47ca96d2b3ced3a08a993c937c7f49561b337d + react: ^19.0.0 + checksum: 10/aa64a2f1991042f516260e8b0eca0ae777b6c8f1aa2b5ae096e80bbb6ac9b005aef2bca697969841d34f7e1819556263476bdfea36c35092e8d9aefde3de2d9a languageName: node linkType: hard @@ -6136,9 +6197,9 @@ __metadata: "@testing-library/react": "npm:^16.1.0" "@types/node": "npm:^20.14.2" "@types/prop-types": "npm:^15.7.12" - "@types/react": "npm:types-react@rc" - "@types/react-dom": "npm:types-react-dom@rc" - "@types/use-sync-external-store": "npm:types-use-sync-external-store@rc" + "@types/react": "npm:^19.0.1" + "@types/react-dom": "npm:^19.0.1" + "@types/use-sync-external-store": "npm:^0.0.6" babel-eslint: "npm:^10.1.0" codecov: "npm:^3.8.3" cross-env: "npm:^7.0.3" @@ -6150,14 +6211,14 @@ __metadata: eslint-plugin-react: "npm:^7.34.2" jsdom: "npm:^25.0.1" prettier: "npm:^3.3.3" - react: "npm:19.0.0-rc.1" - react-dom: "npm:19.0.0-rc.1" + react: "npm:^19.0.0" + react-dom: "npm:^19.0.0" redux: "npm:^5.0.1" rimraf: "npm:^5.0.7" tsup: "npm:^8.3.5" typescript: "npm:^5.5.4" typescript-eslint: "npm:^7.12.0" - use-sync-external-store: "npm:^1.2.2 || ^1.4.0-rc" + use-sync-external-store: "npm:^1.4.0" vitest: "npm:^1.6.0" peerDependencies: "@types/react": ^18.2.25 || ^19 @@ -6171,10 +6232,10 @@ __metadata: languageName: unknown linkType: soft -"react@npm:19.0.0-rc.1": - version: 19.0.0-rc.1 - resolution: "react@npm:19.0.0-rc.1" - checksum: 10/4da93b26f6d8ca24a4657551fe9e6db92b42e6d8cb54821e3c2c8c5af2098094e5d997b261314a2b5723ad1e0a444a63312b7645f72394f21660da38ea4554f1 +"react@npm:^19.0.0": + version: 19.0.0 + resolution: "react@npm:19.0.0" + checksum: 10/2490969c503f644703c88990d20e4011fa6119ddeca451e9de48f6d7ab058d670d2852a5fcd3aa3cd90a923ab2815d532637bd4a814add402ae5c0d4f129ee71 languageName: node linkType: hard @@ -6558,10 +6619,10 @@ __metadata: languageName: node linkType: hard -"scheduler@npm:0.25.0-rc.1": - version: 0.25.0-rc.1 - resolution: "scheduler@npm:0.25.0-rc.1" - checksum: 10/b9dbc9e406ab4af245c3c7cfd1d39e983aa6184ab941cfd7ee5dc1695854280a5dee556f7f81d9e0f392dbe4f2f85966f2b6988beed39f1d5f5e844b1db02c60 +"scheduler@npm:^0.25.0": + version: 0.25.0 + resolution: "scheduler@npm:0.25.0" + checksum: 10/e661e38503ab29a153429a99203fefa764f28b35c079719eb5efdd2c1c1086522f6653d8ffce388209682c23891a6d1d32fa6badf53c35fb5b9cd0c55ace42de languageName: node linkType: hard @@ -6603,7 +6664,7 @@ __metadata: languageName: node linkType: hard -"set-function-length@npm:^1.2.1": +"set-function-length@npm:^1.2.2": version: 1.2.2 resolution: "set-function-length@npm:1.2.2" dependencies: @@ -7488,12 +7549,12 @@ __metadata: languageName: node linkType: hard -"use-sync-external-store@npm:^1.2.2 || ^1.4.0-rc": - version: 1.4.0-rc-fb9a90fa48-20240614 - resolution: "use-sync-external-store@npm:1.4.0-rc-fb9a90fa48-20240614" +"use-sync-external-store@npm:^1.4.0": + version: 1.4.0 + resolution: "use-sync-external-store@npm:1.4.0" peerDependencies: - react: 19.0.0-rc-fb9a90fa48-20240614 - checksum: 10/5b31aef4df66f5172dc65170151c68bf838558a8beb4674193279aa8c1a03e3f58a30afbb7a2619d9271a5c7132a8b20cfecc4b5530440539245c1f6bd5b5aae + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 10/08bf581a8a2effaefc355e9d18ed025d436230f4cc973db2f593166df357cf63e47b9097b6e5089b594758bde322e1737754ad64905e030d70f8ff7ee671fd01 languageName: node linkType: hard