Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: [app dir bootstrapping 9]: replace useSearchParams with useCompatSearchParams hook #12056

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

DmytroHryshyn
Copy link
Contributor

@DmytroHryshyn DmytroHryshyn commented Oct 24, 2023

What does this PR do?

Applies replace-use-search-params codemod to provide consistent hook behaviour between next@13.4.6 and next@13.5.4 versions.
Adds tests for useCompatSearchParams hook

Codemod impact: 46 files changed. Estimated time saving ~1h

useSearchParams in next@13.4.6 returns both params and searchParams when executed in Pages Router. On latest version of next js useSearchParams hook behaviour is same in Pages Router and App Router - it returns only searchParams, params are no more included.
useCompatSearchParams is aimed to simplify migration by providing next@13.4.6 useSearchParams hook behaviour.

Requirement/Documentation

See navigation hooks comparison

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

new useCompatSearchParams hook was covered with unit tests

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

@vercel
Copy link

vercel bot commented Oct 24, 2023

@DmytroHryshyn is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@DmytroHryshyn DmytroHryshyn changed the title chore: replace useSearchParams with useCompatSearchParams hook chore: [app dir bootstrapping 9]: replace useSearchParams with useCompatSearchParams hook Oct 24, 2023
@hbjORbj hbjORbj force-pushed the intuita/useCompatSearchParams branch from b398e2c to 7e47aa8 Compare November 2, 2023 18:07
@PeerRich PeerRich added the Medium priority Created by Linear-GitHub Sync label Nov 2, 2023
Copy link
Contributor

github-actions bot commented Nov 7, 2023

Hey there, there is a merge conflict, can you take a look?

@github-actions github-actions bot added the 🚨 merge conflict This PR has a merge conflict that has to be addressed label Nov 7, 2023
@grzpab grzpab force-pushed the intuita/useCompatSearchParams branch 2 times, most recently from bdb2c4c to 7d8e2e4 Compare November 13, 2023 12:59
@grzpab grzpab force-pushed the intuita/useCompatSearchParams branch from 7d8e2e4 to 08b6d70 Compare November 14, 2023 17:14
@zomars zomars self-requested a review November 14, 2023 17:15
Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

All code and checks are looking good. Thank you for your contribution 🙏

Copy link
Member

Choose a reason for hiding this comment

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

Noice

@zomars
Copy link
Member

zomars commented Nov 15, 2023

Merge activity

  • Nov 15, 1:05 PM: Graphite failed to merge this pull request due to internal failures. Try your merge again, or report a bug if you see this consistently.

@zomars zomars merged commit 28acbe5 into calcom:main Nov 16, 2023
28 of 36 checks passed
@zomars zomars deleted the intuita/useCompatSearchParams branch November 16, 2023 20:38
hbjORbj pushed a commit to codemod-com/cal.com-demo that referenced this pull request Nov 28, 2023
…patSearchParams hook (calcom#12056)

Co-authored-by: zomars <zomars@me.com>
jakazzy pushed a commit to jakazzy/cal.com that referenced this pull request Dec 5, 2023
…patSearchParams hook (calcom#12056)

Co-authored-by: zomars <zomars@me.com>
hbjORbj pushed a commit to codemod-com/cal.com-demo that referenced this pull request Dec 21, 2023
…patSearchParams hook (calcom#12056)

Co-authored-by: zomars <zomars@me.com>
zomars added a commit that referenced this pull request Jan 29, 2024
…patSearchParams hook (#12056)

Co-authored-by: zomars <zomars@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium priority Created by Linear-GitHub Sync 🚨 merge conflict This PR has a merge conflict that has to be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants