From 2628933af62c49e88c6f465e4eefaae2f5ea8427 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:13:39 -0400 Subject: [PATCH] build(deps): Bump react-dom and @types/react-dom (#1826) * build(deps): Bump react-dom and @types/react-dom Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) and [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom). These dependencies needed to be updated together. Updates `react-dom` from 18.2.0 to 18.3.1 - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/v18.3.1/packages/react-dom) Updates `@types/react-dom` from 18.2.24 to 18.3.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom) --- updated-dependencies: - dependency-name: react-dom dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: "@types/react-dom" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * fix: update act import to remove depreaction warning * style: reformat code after import change --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Paul Schreiber --- package-lock.json | 26 +++++++++---------- package.json | 4 +-- src/account/components/AccountProfile.test.js | 3 +-- src/contact/ContactForm.test.js | 3 +-- src/group/components/GroupForm.test.js | 3 +-- src/group/components/GroupList.test.js | 3 +-- .../components/GroupMembers.test.js | 3 +-- .../LandscapeForm/AffiliationUpdate.test.js | 3 +-- .../BoundaryStepNewBoundariesFile.test.js | 3 +-- .../BoundaryStepNewDrawPolygon.test.js | 3 +-- .../BoundaryStepNewFormPin.test.js | 3 +-- .../DevelopmentStrategyUpdate.test.js | 3 +-- .../LandscapeForm/KeyInfoNew.test.js | 3 +-- .../LandscapeForm/KeyInfoUpdate.test.js | 3 +-- .../LandscapeForm/ProfileImageUpdate.test.js | 3 +-- .../LandscapeForm/ProfileUpdate.test.js | 3 +-- .../components/LandscapeList.test.js | 3 +-- .../components/LandscapeMembers.test.js | 3 +-- src/layout/AppBar.test.js | 3 +-- .../components/LocalePicker.test.js | 3 +-- src/localization/i18n.test.js | 2 +- src/navigation/components/Navigation.test.js | 3 +-- src/tests/utils.js | 2 +- 23 files changed, 36 insertions(+), 55 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7620f12c6..1530c63da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "react": "^18.2.0", "react-avatar-editor": "^13.0.2", "react-beautiful-dnd": "^13.1.1", - "react-dom": "^18.2.0", + "react-dom": "^18.3.1", "react-dropzone": "^14.2.3", "react-error-boundary": "^4.0.13", "react-helmet-async": "^2.0.4", @@ -69,7 +69,7 @@ "@types/jest": "^29.5.12", "@types/js-cookie": "^3.0.6", "@types/react": "^18.2.78", - "@types/react-dom": "^18.2.24", + "@types/react-dom": "^18.3.0", "@typescript-eslint/parser": "^7.6.0", "depcheck": "^1.4.7", "eslint-config-prettier": "^9.1.0", @@ -8070,9 +8070,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.24", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.24.tgz", - "integrity": "sha512-cN6upcKd8zkGy4HU9F1+/s98Hrp6D4MOcippK4PoE8OZRngohHZpbJn1GsaDLz87MqvHNoT13nHvNqM9ocRHZg==", + "version": "18.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", + "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", "devOptional": true, "dependencies": { "@types/react": "*" @@ -25349,9 +25349,9 @@ } }, "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dependencies": { "loose-envify": "^1.1.0" }, @@ -25576,15 +25576,15 @@ } }, "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "dependencies": { "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" + "scheduler": "^0.23.2" }, "peerDependencies": { - "react": "^18.2.0" + "react": "^18.3.1" } }, "node_modules/react-dropzone": { diff --git a/package.json b/package.json index d85a5edce..f67beebc7 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "react": "^18.2.0", "react-avatar-editor": "^13.0.2", "react-beautiful-dnd": "^13.1.1", - "react-dom": "^18.2.0", + "react-dom": "^18.3.1", "react-dropzone": "^14.2.3", "react-error-boundary": "^4.0.13", "react-helmet-async": "^2.0.4", @@ -98,7 +98,7 @@ "@types/jest": "^29.5.12", "@types/js-cookie": "^3.0.6", "@types/react": "^18.2.78", - "@types/react-dom": "^18.2.24", + "@types/react-dom": "^18.3.0", "@typescript-eslint/parser": "^7.6.0", "depcheck": "^1.4.7", "eslint-config-prettier": "^9.1.0", diff --git a/src/account/components/AccountProfile.test.js b/src/account/components/AccountProfile.test.js index 8e2ff338b..2108b6903 100644 --- a/src/account/components/AccountProfile.test.js +++ b/src/account/components/AccountProfile.test.js @@ -15,10 +15,9 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, within } from 'tests/utils'; -import React from 'react'; +import React, { act } from 'react'; import { when } from 'jest-when'; import _ from 'lodash/fp'; -import { act } from 'react-dom/test-utils'; import { useNavigate, useParams, useSearchParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/contact/ContactForm.test.js b/src/contact/ContactForm.test.js index b18542e7a..6fc984f2c 100644 --- a/src/contact/ContactForm.test.js +++ b/src/contact/ContactForm.test.js @@ -15,9 +15,8 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { render, screen } from 'tests/utils'; -import React from 'react'; +import React, { act } from 'react'; import _ from 'lodash/fp'; -import { act } from 'react-dom/test-utils'; import { useScript } from 'custom-hooks'; diff --git a/src/group/components/GroupForm.test.js b/src/group/components/GroupForm.test.js index 15e4b773b..eb3c21524 100644 --- a/src/group/components/GroupForm.test.js +++ b/src/group/components/GroupForm.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, within } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/group/components/GroupList.test.js b/src/group/components/GroupList.test.js index 1def22d78..8d01c12aa 100644 --- a/src/group/components/GroupList.test.js +++ b/src/group/components/GroupList.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, within } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useSearchParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import useMediaQuery from '@mui/material/useMediaQuery'; diff --git a/src/group/membership/components/GroupMembers.test.js b/src/group/membership/components/GroupMembers.test.js index d079834a3..dd2d03991 100644 --- a/src/group/membership/components/GroupMembers.test.js +++ b/src/group/membership/components/GroupMembers.test.js @@ -15,9 +15,8 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, waitFor, within } from 'tests/utils'; -import React from 'react'; +import React, { act } from 'react'; import _ from 'lodash/fp'; -import { act } from 'react-dom/test-utils'; import { useNavigate, useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { GROUP_TYPES_WITH_REDIRECTS } from 'tests/constants'; diff --git a/src/landscape/components/LandscapeForm/AffiliationUpdate.test.js b/src/landscape/components/LandscapeForm/AffiliationUpdate.test.js index 18cfb904f..0544f705e 100644 --- a/src/landscape/components/LandscapeForm/AffiliationUpdate.test.js +++ b/src/landscape/components/LandscapeForm/AffiliationUpdate.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, within } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/landscape/components/LandscapeForm/BoundaryStepNewBoundariesFile.test.js b/src/landscape/components/LandscapeForm/BoundaryStepNewBoundariesFile.test.js index d46a3430f..2a215679b 100644 --- a/src/landscape/components/LandscapeForm/BoundaryStepNewBoundariesFile.test.js +++ b/src/landscape/components/LandscapeForm/BoundaryStepNewBoundariesFile.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, waitFor, within } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/landscape/components/LandscapeForm/BoundaryStepNewDrawPolygon.test.js b/src/landscape/components/LandscapeForm/BoundaryStepNewDrawPolygon.test.js index b3555c21f..e511abb79 100644 --- a/src/landscape/components/LandscapeForm/BoundaryStepNewDrawPolygon.test.js +++ b/src/landscape/components/LandscapeForm/BoundaryStepNewDrawPolygon.test.js @@ -15,9 +15,8 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, waitFor, within } from 'tests/utils'; -import React from 'react'; +import React, { act } from 'react'; import MapboxDraw from '@mapbox/mapbox-gl-draw'; -import { act } from 'react-dom/test-utils'; import { useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/landscape/components/LandscapeForm/BoundaryStepNewFormPin.test.js b/src/landscape/components/LandscapeForm/BoundaryStepNewFormPin.test.js index 2e452d61c..1508d3b8f 100644 --- a/src/landscape/components/LandscapeForm/BoundaryStepNewFormPin.test.js +++ b/src/landscape/components/LandscapeForm/BoundaryStepNewFormPin.test.js @@ -15,9 +15,8 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, waitFor, within } from 'tests/utils'; -import React from 'react'; +import React, { act } from 'react'; import MapboxDraw from '@mapbox/mapbox-gl-draw'; -import { act } from 'react-dom/test-utils'; import { useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.test.js b/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.test.js index 773c0e4d7..a9d0ecb2b 100644 --- a/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.test.js +++ b/src/landscape/components/LandscapeForm/DevelopmentStrategyUpdate.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/landscape/components/LandscapeForm/KeyInfoNew.test.js b/src/landscape/components/LandscapeForm/KeyInfoNew.test.js index 36c3a8488..65b95e077 100644 --- a/src/landscape/components/LandscapeForm/KeyInfoNew.test.js +++ b/src/landscape/components/LandscapeForm/KeyInfoNew.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, waitFor, within } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/landscape/components/LandscapeForm/KeyInfoUpdate.test.js b/src/landscape/components/LandscapeForm/KeyInfoUpdate.test.js index 2362ded3e..3199eb095 100644 --- a/src/landscape/components/LandscapeForm/KeyInfoUpdate.test.js +++ b/src/landscape/components/LandscapeForm/KeyInfoUpdate.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, within } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/landscape/components/LandscapeForm/ProfileImageUpdate.test.js b/src/landscape/components/LandscapeForm/ProfileImageUpdate.test.js index e35bf4355..75b5aa7ef 100644 --- a/src/landscape/components/LandscapeForm/ProfileImageUpdate.test.js +++ b/src/landscape/components/LandscapeForm/ProfileImageUpdate.test.js @@ -15,9 +15,8 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, waitFor } from 'tests/utils'; -import React from 'react'; +import React, { act } from 'react'; import AvatarEditor from 'react-avatar-editor'; -import { act } from 'react-dom/test-utils'; import { useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/landscape/components/LandscapeForm/ProfileUpdate.test.js b/src/landscape/components/LandscapeForm/ProfileUpdate.test.js index 7e2ba33da..2bc417a0b 100644 --- a/src/landscape/components/LandscapeForm/ProfileUpdate.test.js +++ b/src/landscape/components/LandscapeForm/ProfileUpdate.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, waitFor, within } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; diff --git a/src/landscape/components/LandscapeList.test.js b/src/landscape/components/LandscapeList.test.js index 9af78087d..a7b49c0e7 100644 --- a/src/landscape/components/LandscapeList.test.js +++ b/src/landscape/components/LandscapeList.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, waitFor, within } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useSearchParams } from 'react-router-dom'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { mockTerrasoAPIrequestGraphQL } from 'tests/apiUtils'; diff --git a/src/landscape/membership/components/LandscapeMembers.test.js b/src/landscape/membership/components/LandscapeMembers.test.js index afc2bbf50..b7dc1b785 100644 --- a/src/landscape/membership/components/LandscapeMembers.test.js +++ b/src/landscape/membership/components/LandscapeMembers.test.js @@ -15,9 +15,8 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, waitFor, within } from 'tests/utils'; -import React from 'react'; +import React, { act } from 'react'; import _ from 'lodash/fp'; -import { act } from 'react-dom/test-utils'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import { mockTerrasoAPIrequestGraphQL } from 'tests/apiUtils'; import useMediaQuery from '@mui/material/useMediaQuery'; diff --git a/src/layout/AppBar.test.js b/src/layout/AppBar.test.js index 77185f8a9..ea3f0f0d4 100644 --- a/src/layout/AppBar.test.js +++ b/src/layout/AppBar.test.js @@ -15,9 +15,8 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen } from 'tests/utils'; -import React from 'react'; +import React, { act } from 'react'; import Cookies from 'js-cookie'; -import { act } from 'react-dom/test-utils'; import { useLocation, useNavigate } from 'react-router-dom'; import useMediaQuery from '@mui/material/useMediaQuery'; diff --git a/src/localization/components/LocalePicker.test.js b/src/localization/components/LocalePicker.test.js index 1e135b2cd..0e4b58262 100644 --- a/src/localization/components/LocalePicker.test.js +++ b/src/localization/components/LocalePicker.test.js @@ -15,9 +15,8 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen, within } from 'tests/utils'; -import React from 'react'; +import React, { act } from 'react'; import _ from 'lodash/fp'; -import { act } from 'react-dom/test-utils'; import * as terrasoApi from 'terraso-client-shared/terrasoApi/api'; import useMediaQuery from '@mui/material/useMediaQuery'; diff --git a/src/localization/i18n.test.js b/src/localization/i18n.test.js index 3a64c20cd..12ab3c7cf 100644 --- a/src/localization/i18n.test.js +++ b/src/localization/i18n.test.js @@ -15,7 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { render, screen } from 'tests/utils'; -import { act } from 'react-dom/test-utils'; +import { act } from 'react'; import { useTranslation } from 'react-i18next'; import i18n from 'localization/i18n'; diff --git a/src/navigation/components/Navigation.test.js b/src/navigation/components/Navigation.test.js index 464bdc2ca..07b76229e 100644 --- a/src/navigation/components/Navigation.test.js +++ b/src/navigation/components/Navigation.test.js @@ -15,8 +15,7 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ import { fireEvent, render, screen } from 'tests/utils'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React, { act } from 'react'; import { useLocation } from 'react-router-dom'; import Navigation from 'navigation/components/Navigation'; diff --git a/src/tests/utils.js b/src/tests/utils.js index 5a3208b14..0088735b7 100644 --- a/src/tests/utils.js +++ b/src/tests/utils.js @@ -19,13 +19,13 @@ import React from 'react'; // import for side effects to ensure config happens before running tests import 'config'; +import { act } from 'react'; import { waitFor as baseWaitFor, cleanup, render as rtlRender, } from '@testing-library/react'; import { axe, toHaveNoViolations } from 'jest-axe'; -import { act } from 'react-dom/test-utils'; import createStore from 'terrasoApi/store'; import AppWrappers from 'layout/AppWrappers';