Skip to content

chore(nextjs): Remove useSearchParams usage#2651

Merged
nikosdouvlis merged 3 commits into
mainfrom
brk.chore/no-use-search-params
Feb 2, 2024
Merged

chore(nextjs): Remove useSearchParams usage#2651
nikosdouvlis merged 3 commits into
mainfrom
brk.chore/no-use-search-params

Conversation

@brkalow

@brkalow brkalow commented Jan 22, 2024

Copy link
Copy Markdown
Member

Description

Attempting to avoid CSR de-opt due to useSearchParams() usage. Refactors useAwaitableNavigate() to rely on useTransition instead of Next's route state hooks. This avoids any potential de-opt and provides a more reliable implementation by relying on React's native transition behavior.

Fixes SDK-1266

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/backend
  • @clerk/chrome-extension
  • @clerk/clerk-js
  • @clerk/clerk-expo
  • @clerk/fastify
  • gatsby-plugin-clerk
  • @clerk/localizations
  • @clerk/nextjs
  • @clerk/clerk-react
  • @clerk/remix
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/themes
  • @clerk/types
  • build/tooling/chore

@changeset-bot

changeset-bot Bot commented Jan 22, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5fa57ad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brkalow brkalow marked this pull request as ready for review January 22, 2024 23:14
@brkalow brkalow requested review from a team and panteliselef and removed request for a team January 22, 2024 23:16
@phibr0

phibr0 commented Jan 23, 2024

Copy link
Copy Markdown
Contributor

This is currently blocking us from upgrading to Next 14. Hopefully this can be merged soon

@WillFP

WillFP commented Feb 1, 2024

Copy link
Copy Markdown

Can this be merged? Currently preventing my app from working properly with Next.JS 14

@LekoArts

LekoArts commented Feb 2, 2024

Copy link
Copy Markdown
Contributor

@phibr0 @WillFP Please note that this breaking change was introduced by Next.js and as we support older versions we'll need to verify that it works on all supported versions. It'll be merged soon.

@nikosdouvlis nikosdouvlis force-pushed the brk.chore/no-use-search-params branch from de14bfd to 5fa57ad Compare February 2, 2024 12:33
@nikosdouvlis nikosdouvlis merged commit f68b015 into main Feb 2, 2024
@nikosdouvlis nikosdouvlis deleted the brk.chore/no-use-search-params branch February 2, 2024 12:44
nikosdouvlis pushed a commit that referenced this pull request Feb 2, 2024
* chore(nextjs): Remove useSearchParams usage

* feat(nextjs): Implement useAwaitableNavigate with useTransition

* chore(repo): Update type dependencies to fix integration build error

(cherry picked from commit f68b015)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants