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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"eslint-plugin-react-hooks": "^4.6.2",
"jest": "^29.0.3",
"jest-environment-jsdom": "^29.7.0",
"next": "^14.2.7",
"next": "^15.0.0",
"prettier-eslint-cli": "^8.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -85,7 +85,7 @@
},
"peerDependencies": {
"@types/history": "^4.9",
"next": "^14.2.7",
"next": "^15.0.0",
"react": "^16.13.1",
"react-router": "^6.22.2"
},
Comment on lines 85 to 91

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The file src/next/useSearchParams.ts uses client-side Next.js 15 hooks but is missing the required "use client" directive at the top.
Severity: HIGH

Suggested Fix

Add the "use client"; directive to the very first line of the file src/next/useSearchParams.ts. This will ensure that Next.js correctly identifies it as a Client Component module, preventing build failures in consuming applications.

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: package.json#L85-L91

Potential issue: The PR updates the `next` peer dependency to version 15, which mandates
that files using client-side hooks like `useSearchParams` must include a `"use client"`
directive. The file `src/next/useSearchParams.ts` uses these hooks and is explicitly
intended for the Next.js App Router, but it is missing this directive. While the
library's own CI will pass, consuming applications using Next.js 15 will experience
build failures when they import and use this hook in Server Components, as the module is
not correctly marked as a Client Component.

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

Expand Down
158 changes: 55 additions & 103 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ __metadata:
fuse.js: "npm:^7.0.0"
jest: "npm:^29.0.3"
jest-environment-jsdom: "npm:^29.7.0"
next: "npm:^14.2.7"
next: "npm:^15.0.0"
prettier-eslint-cli: "npm:^8.0.1"
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
Expand All @@ -1255,7 +1255,7 @@ __metadata:
typescript: "npm:5.8"
peerDependencies:
"@types/history": ^4.9
next: ^14.2.7
next: ^15.0.0
react: ^16.13.1
react-router: ^6.22.2
peerDependenciesMeta:
Expand All @@ -1280,10 +1280,10 @@ __metadata:
languageName: node
linkType: hard

"@next/env@npm:14.2.33":
version: 14.2.33
resolution: "@next/env@npm:14.2.33"
checksum: 10/04d6d2c724a4b4999b059cb2ed97c08162c009ec16cbb39001df62f91a75625555c48e85be296c15b1dcfda3cb8fc8c44d03190e7265c0713d634b5a2306ff5f
"@next/env@npm:15.5.22":
version: 15.5.22
resolution: "@next/env@npm:15.5.22"
checksum: 10/0289b68fe3aeb5783d239637ff50dd483d1609e45b9e98b31ac0d5578fc3228f696fbda1a860b4b0a7ae414c30156ce1d3d889d3a173a5dbd96b362a1a1436f9
languageName: node
linkType: hard

Expand All @@ -1294,9 +1294,9 @@ __metadata:
languageName: node
linkType: hard

"@next/swc-darwin-arm64@npm:14.2.33":
version: 14.2.33
resolution: "@next/swc-darwin-arm64@npm:14.2.33"
"@next/swc-darwin-arm64@npm:15.5.22":
version: 15.5.22
resolution: "@next/swc-darwin-arm64@npm:15.5.22"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
Expand All @@ -1308,9 +1308,9 @@ __metadata:
languageName: node
linkType: hard

"@next/swc-darwin-x64@npm:14.2.33":
version: 14.2.33
resolution: "@next/swc-darwin-x64@npm:14.2.33"
"@next/swc-darwin-x64@npm:15.5.22":
version: 15.5.22
resolution: "@next/swc-darwin-x64@npm:15.5.22"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
Expand All @@ -1322,9 +1322,9 @@ __metadata:
languageName: node
linkType: hard

"@next/swc-linux-arm64-gnu@npm:14.2.33":
version: 14.2.33
resolution: "@next/swc-linux-arm64-gnu@npm:14.2.33"
"@next/swc-linux-arm64-gnu@npm:15.5.22":
version: 15.5.22
resolution: "@next/swc-linux-arm64-gnu@npm:15.5.22"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
Expand All @@ -1336,9 +1336,9 @@ __metadata:
languageName: node
linkType: hard

"@next/swc-linux-arm64-musl@npm:14.2.33":
version: 14.2.33
resolution: "@next/swc-linux-arm64-musl@npm:14.2.33"
"@next/swc-linux-arm64-musl@npm:15.5.22":
version: 15.5.22
resolution: "@next/swc-linux-arm64-musl@npm:15.5.22"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
Expand All @@ -1350,9 +1350,9 @@ __metadata:
languageName: node
linkType: hard

"@next/swc-linux-x64-gnu@npm:14.2.33":
version: 14.2.33
resolution: "@next/swc-linux-x64-gnu@npm:14.2.33"
"@next/swc-linux-x64-gnu@npm:15.5.22":
version: 15.5.22
resolution: "@next/swc-linux-x64-gnu@npm:15.5.22"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
Expand All @@ -1364,9 +1364,9 @@ __metadata:
languageName: node
linkType: hard

"@next/swc-linux-x64-musl@npm:14.2.33":
version: 14.2.33
resolution: "@next/swc-linux-x64-musl@npm:14.2.33"
"@next/swc-linux-x64-musl@npm:15.5.22":
version: 15.5.22
resolution: "@next/swc-linux-x64-musl@npm:15.5.22"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
Expand All @@ -1378,9 +1378,9 @@ __metadata:
languageName: node
linkType: hard

"@next/swc-win32-arm64-msvc@npm:14.2.33":
version: 14.2.33
resolution: "@next/swc-win32-arm64-msvc@npm:14.2.33"
"@next/swc-win32-arm64-msvc@npm:15.5.22":
version: 15.5.22
resolution: "@next/swc-win32-arm64-msvc@npm:15.5.22"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
Expand All @@ -1392,16 +1392,9 @@ __metadata:
languageName: node
linkType: hard

"@next/swc-win32-ia32-msvc@npm:14.2.33":
version: 14.2.33
resolution: "@next/swc-win32-ia32-msvc@npm:14.2.33"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@next/swc-win32-x64-msvc@npm:14.2.33":
version: 14.2.33
resolution: "@next/swc-win32-x64-msvc@npm:14.2.33"
"@next/swc-win32-x64-msvc@npm:15.5.22":
version: 15.5.22
resolution: "@next/swc-win32-x64-msvc@npm:15.5.22"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
Expand Down Expand Up @@ -1686,16 +1679,6 @@ __metadata:
languageName: node
linkType: hard

"@swc/helpers@npm:0.5.5":
version: 0.5.5
resolution: "@swc/helpers@npm:0.5.5"
dependencies:
"@swc/counter": "npm:^0.1.3"
tslib: "npm:^2.4.0"
checksum: 10/1c5ef04f642542212df28c669438f3e0f459dcde7b448a5b1fcafb2e9e4f13e76d8428535a270e91ed123dd2a21189dbed34086b88a8cf68baf84984d6d0e39b
languageName: node
linkType: hard

"@swc/jest@npm:^0.2.36":
version: 0.2.39
resolution: "@swc/jest@npm:0.2.39"
Expand Down Expand Up @@ -2664,15 +2647,6 @@ __metadata:
languageName: node
linkType: hard

"busboy@npm:1.6.0":
version: 1.6.0
resolution: "busboy@npm:1.6.0"
dependencies:
streamsearch: "npm:^1.1.0"
checksum: 10/bee10fa10ea58e7e3e7489ffe4bda6eacd540a17de9f9cd21cc37e297b2dd9fe52b2715a5841afaec82900750d810d01d7edb4b2d456427f449b92b417579763
languageName: node
linkType: hard

"cacache@npm:^19.0.1":
version: 19.0.1
resolution: "cacache@npm:19.0.1"
Expand Down Expand Up @@ -4108,7 +4082,7 @@ __metadata:
languageName: node
linkType: hard

"graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9":
"graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9":
version: 4.2.11
resolution: "graceful-fs@npm:4.2.11"
checksum: 10/bf152d0ed1dc159239db1ba1f74fdbc40cb02f626770dcd5815c427ce0688c2635a06ed69af364396da4636d0408fcf7d4afdf7881724c3307e46aff30ca49e2
Expand Down Expand Up @@ -5777,31 +5751,30 @@ __metadata:
languageName: node
linkType: hard

"next@npm:^14.2.7":
version: 14.2.33
resolution: "next@npm:14.2.33"
"next@npm:^15.0.0":
version: 15.5.22
resolution: "next@npm:15.5.22"
dependencies:
"@next/env": "npm:14.2.33"
"@next/swc-darwin-arm64": "npm:14.2.33"
"@next/swc-darwin-x64": "npm:14.2.33"
"@next/swc-linux-arm64-gnu": "npm:14.2.33"
"@next/swc-linux-arm64-musl": "npm:14.2.33"
"@next/swc-linux-x64-gnu": "npm:14.2.33"
"@next/swc-linux-x64-musl": "npm:14.2.33"
"@next/swc-win32-arm64-msvc": "npm:14.2.33"
"@next/swc-win32-ia32-msvc": "npm:14.2.33"
"@next/swc-win32-x64-msvc": "npm:14.2.33"
"@swc/helpers": "npm:0.5.5"
busboy: "npm:1.6.0"
"@next/env": "npm:15.5.22"
"@next/swc-darwin-arm64": "npm:15.5.22"
"@next/swc-darwin-x64": "npm:15.5.22"
"@next/swc-linux-arm64-gnu": "npm:15.5.22"
"@next/swc-linux-arm64-musl": "npm:15.5.22"
"@next/swc-linux-x64-gnu": "npm:15.5.22"
"@next/swc-linux-x64-musl": "npm:15.5.22"
"@next/swc-win32-arm64-msvc": "npm:15.5.22"
"@next/swc-win32-x64-msvc": "npm:15.5.22"
"@swc/helpers": "npm:0.5.15"
caniuse-lite: "npm:^1.0.30001579"
graceful-fs: "npm:^4.2.11"
postcss: "npm:8.4.31"
styled-jsx: "npm:5.1.1"
sharp: "npm:^0.34.3"
styled-jsx: "npm:5.1.6"
peerDependencies:
"@opentelemetry/api": ^1.1.0
"@playwright/test": ^1.41.2
react: ^18.2.0
react-dom: ^18.2.0
"@playwright/test": ^1.51.1
babel-plugin-react-compiler: "*"
react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
sass: ^1.3.0
dependenciesMeta:
"@next/swc-darwin-arm64":
Expand All @@ -5818,20 +5791,22 @@ __metadata:
optional: true
"@next/swc-win32-arm64-msvc":
optional: true
"@next/swc-win32-ia32-msvc":
optional: true
"@next/swc-win32-x64-msvc":
optional: true
sharp:
optional: true
peerDependenciesMeta:
"@opentelemetry/api":
optional: true
"@playwright/test":
optional: true
babel-plugin-react-compiler:
optional: true
sass:
optional: true
bin:
next: dist/bin/next
checksum: 10/cd2faeed13fe5fec9dfae69dfefd203057236135664698f5ca59c224aaa05068d276fad1ef067ed21356497dff38e9f79863192d4887eacbfd25a84a5202ce8d
checksum: 10/92acab567b9b1436ec024d8d5227949bab5aa747320a7dee1b618a24ae163f2c1fb23bf9b4de7acfba91b7ad8288db23f295d1a0d8449bbf6c7de3f6f13dd146
languageName: node
linkType: hard

Expand Down Expand Up @@ -6971,13 +6946,6 @@ __metadata:
languageName: node
linkType: hard

"streamsearch@npm:^1.1.0":
version: 1.1.0
resolution: "streamsearch@npm:1.1.0"
checksum: 10/612c2b2a7dbcc859f74597112f80a42cbe4d448d03da790d5b7b39673c1197dd3789e91cd67210353e58857395d32c1e955a9041c4e6d5bae723436b3ed9ed14
languageName: node
linkType: hard

"string-length@npm:^4.0.1":
version: 4.0.2
resolution: "string-length@npm:4.0.2"
Expand Down Expand Up @@ -7127,22 +7095,6 @@ __metadata:
languageName: node
linkType: hard

"styled-jsx@npm:5.1.1":
version: 5.1.1
resolution: "styled-jsx@npm:5.1.1"
dependencies:
client-only: "npm:0.0.1"
peerDependencies:
react: ">= 16.8.0 || 17.x.x || ^18.0.0-0"
peerDependenciesMeta:
"@babel/core":
optional: true
babel-plugin-macros:
optional: true
checksum: 10/4f6a5d0010770fdeea1183d919d528fd46c484e23c0535ef3e1dd49488116f639c594f3bd4440e3bc8a8686c9f8d53c5761599870ff039ede11a5c3bfe08a4be
languageName: node
linkType: hard

"styled-jsx@npm:5.1.6":
version: 5.1.6
resolution: "styled-jsx@npm:5.1.6"
Expand Down