Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"react": "16.x || 17.x || 18.x"
},
"devDependencies": {
"@testing-library/react": "^13.0.0",
"@testing-library/react": "^15.0.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"webpack": "^5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"react": "^16.14.0 || 17.x || 18.x || 19.x"
},
"devDependencies": {
"@testing-library/react": "^13.0.0",
"@testing-library/react": "^15.0.5",
Comment on lines 48 to +49
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The renderHook import in profiler.test.tsx uses the deprecated @testing-library/react-hooks package, which is incompatible with React 18 and will cause test failures.
Severity: CRITICAL

Suggested Fix

In packages/react/test/profiler.test.tsx, change the import from @testing-library/react-hooks to @testing-library/react. Then, remove the @testing-library/react-hooks dependency from package.json.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: packages/react/package.json#L48-L49

Potential issue: The PR upgrades `@testing-library/react`, which now includes the
`renderHook` function. However, the test file `packages/react/test/profiler.test.tsx`
continues to import `renderHook` from the old `@testing-library/react-hooks` package.
This package is still listed as a dev dependency but is incompatible with the project's
React 18 version. This mismatch will cause tests to fail at runtime, blocking the CI
pipeline and preventing the deployment of this change.

Did we get this right? 👍 / 👎 to inform future reviews.

"@testing-library/react-hooks": "^7.0.2",
"@types/history-4": "npm:@types/history@4.7.8",
"@types/history-5": "npm:@types/history@4.7.8",
Expand Down
55 changes: 34 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9345,6 +9345,20 @@
"@tanstack/store" "0.8.0"
vue-demi "^0.14.10"

"@testing-library/dom@^10.0.0":
version "10.4.1"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-10.4.1.tgz#d444f8a889e9a46e9a3b4f3b88e0fcb3efb6cf95"
integrity sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==
dependencies:
"@babel/code-frame" "^7.10.4"
"@babel/runtime" "^7.12.5"
"@types/aria-query" "^5.0.1"
aria-query "5.3.0"
dom-accessibility-api "^0.5.9"
lz-string "^1.5.0"
picocolors "1.1.1"
pretty-format "^27.0.2"

"@testing-library/dom@^7.21.4":
version "7.31.2"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.31.2.tgz#df361db38f5212b88555068ab8119f5d841a8c4a"
Expand All @@ -9359,7 +9373,7 @@
lz-string "^1.4.4"
pretty-format "^26.6.2"

"@testing-library/dom@^8.1.0", "@testing-library/dom@^8.5.0":
"@testing-library/dom@^8.1.0":
version "8.17.1"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.17.1.tgz#2d7af4ff6dad8d837630fecd08835aee08320ad7"
integrity sha512-KnH2MnJUzmFNPW6RIKfd+zf2Wue8mEKX0M3cpX6aKl5ZXrJM1/c/Pc8c2xDNYQCnJO48Sm5ITbMXgqTr3h4jxQ==
Expand Down Expand Up @@ -9411,14 +9425,14 @@
"@types/react-test-renderer" ">=16.9.0"
react-error-boundary "^3.1.0"

"@testing-library/react@^13.0.0":
version "13.0.0"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-13.0.0.tgz#8cdaf4667c6c2b082eb0513731551e9db784e8bc"
integrity sha512-p0lYA1M7uoEmk2LnCbZLGmHJHyH59sAaZVXChTXlyhV/PRW9LoIh4mdf7tiXsO8BoNG+vN8UnFJff1hbZeXv+w==
"@testing-library/react@^15.0.5":
version "15.0.5"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-15.0.5.tgz#71bcc875e1142c3924cac7bdd7dc9a6db0bb1d42"
integrity sha512-ttodVWYA2i2w4hRa6krKrmS1vKxAEkwDz34y+CwbcrbZUxFzUYN3a5xZyFKo+K6LBseCRCUkwcjATpaNn/UsIA==
dependencies:
"@babel/runtime" "^7.12.5"
"@testing-library/dom" "^8.5.0"
"@types/react-dom" "*"
"@testing-library/dom" "^10.0.0"
"@types/react-dom" "^18.0.0"

"@testing-library/svelte@^3.2.1":
version "3.2.1"
Expand Down Expand Up @@ -10258,12 +10272,10 @@
resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c"
integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==

"@types/react-dom@*", "@types/react-dom@>=16.9.0":
version "17.0.14"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.14.tgz#c8f917156b652ddf807711f5becbd2ab018dea9f"
integrity sha512-H03xwEP1oXmSfl3iobtmQ/2dHF5aBHr8aUMwyGZya6OW45G+xtdzmq6HkncefiBt5JU8DVyaWl/nWZbjZCnzAQ==
dependencies:
"@types/react" "*"
"@types/react-dom@>=16.9.0", "@types/react-dom@^18.0.0":
version "18.3.7"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.7.tgz#b89ddf2cd83b4feafcc4e2ea41afdfb95a0d194f"
integrity sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==

"@types/react-router-4@npm:@types/react-router@4.0.25":
version "4.0.25"
Expand Down Expand Up @@ -12028,6 +12040,13 @@ aria-query@5.1.3:
dependencies:
deep-equal "^2.0.5"

aria-query@5.3.0, aria-query@^5.0.0, aria-query@^5.0.2, aria-query@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e"
integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==
dependencies:
dequal "^2.0.3"

aria-query@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b"
Expand All @@ -12036,13 +12055,6 @@ aria-query@^4.2.2:
"@babel/runtime" "^7.10.2"
"@babel/runtime-corejs3" "^7.10.2"

aria-query@^5.0.0, aria-query@^5.0.2, aria-query@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e"
integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==
dependencies:
dequal "^2.0.3"

arr-diff@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
Expand Down Expand Up @@ -25888,7 +25900,7 @@ pgpass@1.0.5:
dependencies:
split2 "^4.1.0"

picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.0, picocolors@^1.1.1:
picocolors@1.1.1, picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.0, picocolors@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
Expand Down Expand Up @@ -30030,6 +30042,7 @@ stylus@0.59.0, stylus@^0.59.0:

sucrase@^3.27.0, sucrase@^3.35.0, sucrase@getsentry/sucrase#es2020-polyfills:
version "3.36.0"
uid fd682f6129e507c00bb4e6319cc5d6b767e36061
resolved "https://codeload.github.com/getsentry/sucrase/tar.gz/fd682f6129e507c00bb4e6319cc5d6b767e36061"
dependencies:
"@jridgewell/gen-mapping" "^0.3.2"
Expand Down
Loading