-
Notifications
You must be signed in to change notification settings - Fork 460
fix(shared, nextjs): Support importing @clerk/shared in @clerk/nextjs #1767
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9f890cf
fix(shared): Use `use client` directive to support shared in RSC
dimkl e6174a5
chore(nextjs): Introduce shared module to contain @clerk/shared relat…
dimkl 5864bc7
chore(nextjs): Use utilities from @clerk/shared
dimkl 514d743
chore(nextjs): Warn about withClerkMiddleware deprecation
dimkl 89d05f4
chore(nextjs): Add deprecation JSDoc for server constants to be marke…
dimkl 45d7483
chore(nextjs): Warn about CLERK_JS_VERSION environment variable depre…
dimkl c32924b
chore(nextjs): Warn about CLERK_API_KEY environment variable deprecation
dimkl 17ad6da
chore(nextjs): Warn about NEXT_PUBLIC_CLERK_FRONTEND_API environment …
dimkl 921892f
chore(nextjs): Warn about withServerSideAuth deprecation
dimkl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@clerk/nextjs': patch | ||
| --- | ||
|
|
||
| Warn about deprecations that will be dropped in next major version |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@clerk/nextjs': minor | ||
| '@clerk/shared': minor | ||
| --- | ||
|
|
||
| Add the `use client` directive in `@clerk/shared` to make the package compatible with an RSC environment. | ||
| Remove several helpers from `@clerk/nextjs` and import them from `@clerk/shared` instead. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { deprecated } from '@clerk/shared'; | ||
|
|
||
| /** | ||
| * @deprecated Use `CLERK_JS_VERSION` instead. | ||
| */ | ||
| export const JS_VERSION = process.env.CLERK_JS_VERSION || ''; | ||
| if (JS_VERSION) { | ||
| deprecated('CLERK_JS_VERSION', 'Use `NEXT_PUBLIC_CLERK_JS_VERSION` environment variable instead.'); | ||
| } | ||
| export const CLERK_JS_VERSION = process.env.NEXT_PUBLIC_CLERK_JS_VERSION || ''; | ||
| export const CLERK_JS_URL = process.env.NEXT_PUBLIC_CLERK_JS || ''; | ||
| export const API_URL = process.env.CLERK_API_URL || 'https://api.clerk.dev'; | ||
| export const API_VERSION = process.env.CLERK_API_VERSION || 'v1'; | ||
| /** | ||
| * @deprecated Use `CLERK_SECRET_KEY` instead. | ||
| */ | ||
| export const API_KEY = process.env.CLERK_API_KEY || ''; | ||
| if (API_KEY) { | ||
| deprecated('CLERK_API_KEY', 'Use `CLERK_SECRET_KEY` environment variable instead.'); | ||
| } | ||
| export const SECRET_KEY = process.env.CLERK_SECRET_KEY || ''; | ||
| /** | ||
| * @deprecated Use `PUBLISHABLE_KEY` instead. | ||
| */ | ||
| export const FRONTEND_API = process.env.NEXT_PUBLIC_CLERK_FRONTEND_API || ''; | ||
| if (FRONTEND_API) { | ||
| deprecated('NEXT_PUBLIC_CLERK_FRONTEND_API', 'Use `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` environment variable instead.'); | ||
| } | ||
| export const PUBLISHABLE_KEY = process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY || ''; | ||
| export const DOMAIN = process.env.NEXT_PUBLIC_CLERK_DOMAIN || ''; | ||
| export const PROXY_URL = process.env.NEXT_PUBLIC_CLERK_PROXY_URL || ''; | ||
| export const IS_SATELLITE = process.env.NEXT_PUBLIC_CLERK_IS_SATELLITE === 'true' || false; | ||
| export const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || ''; | ||
| export const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || ''; |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| 'use client'; | ||
| export * from 'swr'; | ||
| export { default as useSWR } from 'swr'; | ||
| export { default as useSWRInfinite } from 'swr/infinite'; |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.