chore: ensure compat type definitions do not break existing types#11741
Merged
zomars merged 2 commits intocalcom:mainfrom Oct 10, 2023
codemod:intuita/compatTypes
Merged
chore: ensure compat type definitions do not break existing types#11741zomars merged 2 commits intocalcom:mainfrom codemod:intuita/compatTypes
zomars merged 2 commits intocalcom:mainfrom
codemod:intuita/compatTypes
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@grzpab is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes! |
Contributor
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR introduces changes to handle nullable return value from Next.js hooks (
useSearchParams,useParams,usePathnameanduseRouter).If you add the
appdirectory to thewebdirectory and runyarn build, the types will be updated by Next.js builder/plugin and the projects will then include the compat type definitions provided by Next.js.This mechanism is coded here: https://github.com/vercel/next.js/blob/524b31513a58e58e15862ac8aa3f27da8a47a267/packages/next/src/lib/typescript/writeAppTypeDeclarations.ts#L54
The example compat type definition is here: https://github.com/vercel/next.js/blob/524b31513a58e58e15862ac8aa3f27da8a47a267/packages/next/navigation-types/compat/navigation.d.ts
Fixes # (issue)
There is no reported issue, this problem becomes visible only when the
appdirectory is added and someone runsyarn type-check.Type of change
How should this be tested?
This requires the entire app check, because I touched
fromEntriesWithDuplicateKeysinpackages/lib/hooks/useRouterQuery.tswhich is used inuseRouterQuery, which in turn is used in 19 pagespackages/lib/next-seo.config.ts)Checklist