Skip to content

chore(nextjs): Apply deprecation warnings - #1760

Merged
dimkl merged 6 commits into
fix-shared-deps-in-nextjsfrom
apply-deprecation-warnings-nextjs
Sep 28, 2023
Merged

chore(nextjs): Apply deprecation warnings#1760
dimkl merged 6 commits into
fix-shared-deps-in-nextjsfrom
apply-deprecation-warnings-nextjs

Conversation

@dimkl

@dimkl dimkl commented Sep 21, 2023

Copy link
Copy Markdown
Contributor

Description

** REVIEW IT PER COMMIT **

Warn about deprecations of the following in Clerk Nextjs:

  • withClerkMiddleware
  • withServerSideAuth
  • CLERK_JS_VERSION environment variable
  • CLERK_API_KEY environment variable
  • NEXT_PUBLIC_FRONTEND_API environment variable

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/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

@dimkl
dimkl requested a review from a team as a code owner September 21, 2023 18:24
@dimkl dimkl self-assigned this Sep 21, 2023
@changeset-bot

changeset-bot Bot commented Sep 21, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4293442

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

Comment thread packages/nextjs/src/shared/deprecated.ts Outdated
@dimkl
dimkl changed the base branch from main to drop-exported-nextjs-constants September 21, 2023 18:40
@dimkl
dimkl changed the base branch from drop-exported-nextjs-constants to main September 21, 2023 18:42
@dimkl
dimkl force-pushed the apply-deprecation-warnings-nextjs branch from b9a21ca to 8109799 Compare September 21, 2023 18:49
@dimkl
dimkl changed the base branch from main to drop-exported-nextjs-constants September 21, 2023 18:50
@@ -0,0 +1,63 @@
// copy of packages/shared/src/utils/deprecated.ts

@LekoArts LekoArts Sep 22, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to spend time on fixing this error and the copy/paste should only be the very last resort.

What happens if you put "use client" into the usePagesOrInfinite file?

And if that doesn't help (and the file is not actually used) we need to think about splitting the utils into their own nested exports so that the bundler can tree-shake the rest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wanted to avoid introducing changes in @clerk/shared that would require extensive testing in this PR so I followed the naive approach of copy / paste to proceed with this PR objective and introduce another PR to support importing @clerk/shared in server-side frameworks.
Based on your comment, if we consider blocking this PR until the @clerk/shared is fixed and used I have opened the following PR in which we should also check if the @clerk/shared is tree-shakeable or not before we merge it: #1767
cc: @SokratisVidros

Comment thread packages/nextjs/src/shared/url.ts Outdated
@dimkl
dimkl force-pushed the apply-deprecation-warnings-nextjs branch from 8109799 to 94cc434 Compare September 22, 2023 09:47
@dimkl
dimkl changed the base branch from drop-exported-nextjs-constants to main September 22, 2023 09:47
@dimkl
dimkl force-pushed the apply-deprecation-warnings-nextjs branch from 94cc434 to 2b270f1 Compare September 22, 2023 09:51
@dimkl dimkl removed the remix label Sep 22, 2023
@dimkl dimkl changed the title chore(nextjs): Apply deprecation warnings for nextjs chore(nextjs): Apply deprecation warnings Sep 25, 2023
@dimkl
dimkl requested a review from LekoArts September 27, 2023 13:08
@dimkl
dimkl force-pushed the apply-deprecation-warnings-nextjs branch 2 times, most recently from 91930e0 to 333ea4d Compare September 27, 2023 15:16
@dimkl
dimkl changed the base branch from main to fix-shared-deps-in-nextjs September 27, 2023 15:45
@dimkl
dimkl force-pushed the fix-shared-deps-in-nextjs branch from b9df973 to 39a24a0 Compare September 28, 2023 08:27
@dimkl
dimkl force-pushed the apply-deprecation-warnings-nextjs branch from 333ea4d to 1f7dbe0 Compare September 28, 2023 08:27
@dimkl
dimkl force-pushed the fix-shared-deps-in-nextjs branch from 39a24a0 to 5864bc7 Compare September 28, 2023 10:31
@dimkl
dimkl force-pushed the apply-deprecation-warnings-nextjs branch from 1f7dbe0 to 4293442 Compare September 28, 2023 10:54
@dimkl
dimkl merged commit 921892f into fix-shared-deps-in-nextjs Sep 28, 2023
@dimkl
dimkl deleted the apply-deprecation-warnings-nextjs branch September 28, 2023 11:51
@clerk-cookie

Copy link
Copy Markdown
Collaborator

This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@clerk clerk locked as resolved and limited conversation to collaborators Sep 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants