From 920a8690d163fd3daa9e4bee26ec21b1e75f9c3c Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Fri, 22 Nov 2024 10:41:31 -0500 Subject: [PATCH 1/3] chore(react,vue): Add deprecation notice to redirect components --- packages/react/src/components/controlComponents.tsx | 9 +++++++++ packages/vue/src/components/controlComponents.ts | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/react/src/components/controlComponents.tsx b/packages/react/src/components/controlComponents.tsx index 2bfa02362e7..ccc36f28892 100644 --- a/packages/react/src/components/controlComponents.tsx +++ b/packages/react/src/components/controlComponents.tsx @@ -164,6 +164,9 @@ export const RedirectToSignUp = withClerk(({ clerk, ...props }: WithClerkProp { React.useEffect(() => { void clerk.redirectToUserProfile(); @@ -172,6 +175,9 @@ export const RedirectToUserProfile = withClerk(({ clerk }) => { return null; }, 'RedirectToUserProfile'); +/** + * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-organization-profile) instead, will be removed in the next major version. + */ export const RedirectToOrganizationProfile = withClerk(({ clerk }) => { React.useEffect(() => { void clerk.redirectToOrganizationProfile(); @@ -180,6 +186,9 @@ export const RedirectToOrganizationProfile = withClerk(({ clerk }) => { return null; }, 'RedirectToOrganizationProfile'); +/** + * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-create-organization) instead, will be removed in the next major version. + */ export const RedirectToCreateOrganization = withClerk(({ clerk }) => { React.useEffect(() => { void clerk.redirectToCreateOrganization(); diff --git a/packages/vue/src/components/controlComponents.ts b/packages/vue/src/components/controlComponents.ts index 8b6eee4d0d5..df31eb21f51 100644 --- a/packages/vue/src/components/controlComponents.ts +++ b/packages/vue/src/components/controlComponents.ts @@ -60,6 +60,9 @@ export const RedirectToSignUp = defineComponent((props: RedirectOptions) => { return () => null; }); +/** + * @deprecated Use [`redirectToUserProfile()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-user-profile) instead, will be removed in the next major version. + */ export const RedirectToUserProfile = defineComponent(() => { useClerkLoaded(clerk => { void clerk.redirectToUserProfile(); @@ -68,6 +71,9 @@ export const RedirectToUserProfile = defineComponent(() => { return () => null; }); +/** + * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-organization-profile) instead, will be removed in the next major version. + */ export const RedirectToOrganizationProfile = defineComponent(() => { useClerkLoaded(clerk => { void clerk.redirectToOrganizationProfile(); @@ -76,6 +82,9 @@ export const RedirectToOrganizationProfile = defineComponent(() => { return () => null; }); +/** + * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/references/javascript/clerk/redirect-methods#redirect-to-create-organization) instead, will be removed in the next major version. + */ export const RedirectToCreateOrganization = defineComponent(() => { useClerkLoaded(clerk => { void clerk.redirectToCreateOrganization(); From 5cae3339ab50484cc6bc363f901d9ce00fa05e75 Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Fri, 22 Nov 2024 10:45:06 -0500 Subject: [PATCH 2/3] add changeset --- .changeset/olive-zebras-arrive.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/olive-zebras-arrive.md diff --git a/.changeset/olive-zebras-arrive.md b/.changeset/olive-zebras-arrive.md new file mode 100644 index 00000000000..c06549bf4b7 --- /dev/null +++ b/.changeset/olive-zebras-arrive.md @@ -0,0 +1,10 @@ +--- +'@clerk/clerk-react': patch +'@clerk/vue': patch +--- + +Add deprecation notices for the following components: + +- `RedirectToUserProfile` +- `RedirectToOrganizationProfile` +- `RedirectToCreateOrganization` From d0b30e2b3faabd53d1686ee93779cc95008e31d9 Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Fri, 22 Nov 2024 11:26:37 -0500 Subject: [PATCH 3/3] use deprecated helper --- packages/react/src/components/controlComponents.tsx | 4 ++++ packages/vue/src/components/controlComponents.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/react/src/components/controlComponents.tsx b/packages/react/src/components/controlComponents.tsx index ccc36f28892..0b54363fc38 100644 --- a/packages/react/src/components/controlComponents.tsx +++ b/packages/react/src/components/controlComponents.tsx @@ -1,3 +1,4 @@ +import { deprecated } from '@clerk/shared/deprecated'; import type { CheckAuthorizationWithCustomPermissions, HandleOAuthCallbackParams, @@ -169,6 +170,7 @@ export const RedirectToSignUp = withClerk(({ clerk, ...props }: WithClerkProp { React.useEffect(() => { + deprecated('RedirectToUserProfile', 'Use the `redirectToUserProfile()` method instead.'); void clerk.redirectToUserProfile(); }, []); @@ -180,6 +182,7 @@ export const RedirectToUserProfile = withClerk(({ clerk }) => { */ export const RedirectToOrganizationProfile = withClerk(({ clerk }) => { React.useEffect(() => { + deprecated('RedirectToOrganizationProfile', 'Use the `redirectToOrganizationProfile()` method instead.'); void clerk.redirectToOrganizationProfile(); }, []); @@ -191,6 +194,7 @@ export const RedirectToOrganizationProfile = withClerk(({ clerk }) => { */ export const RedirectToCreateOrganization = withClerk(({ clerk }) => { React.useEffect(() => { + deprecated('RedirectToCreateOrganization', 'Use the `redirectToCreateOrganization()` method instead.'); void clerk.redirectToCreateOrganization(); }, []); diff --git a/packages/vue/src/components/controlComponents.ts b/packages/vue/src/components/controlComponents.ts index df31eb21f51..20d99e2d40c 100644 --- a/packages/vue/src/components/controlComponents.ts +++ b/packages/vue/src/components/controlComponents.ts @@ -1,3 +1,4 @@ +import { deprecated } from '@clerk/shared/deprecated'; import type { CheckAuthorizationWithCustomPermissions, HandleOAuthCallbackParams as HandleOAuthCallbackParamsOriginal, @@ -65,6 +66,7 @@ export const RedirectToSignUp = defineComponent((props: RedirectOptions) => { */ export const RedirectToUserProfile = defineComponent(() => { useClerkLoaded(clerk => { + deprecated('RedirectToUserProfile', 'Use the `redirectToUserProfile()` method instead.'); void clerk.redirectToUserProfile(); }); @@ -76,6 +78,7 @@ export const RedirectToUserProfile = defineComponent(() => { */ export const RedirectToOrganizationProfile = defineComponent(() => { useClerkLoaded(clerk => { + deprecated('RedirectToOrganizationProfile', 'Use the `redirectToOrganizationProfile()` method instead.'); void clerk.redirectToOrganizationProfile(); }); @@ -87,6 +90,7 @@ export const RedirectToOrganizationProfile = defineComponent(() => { */ export const RedirectToCreateOrganization = defineComponent(() => { useClerkLoaded(clerk => { + deprecated('RedirectToCreateOrganization', 'Use the `redirectToCreateOrganization()` method instead.'); void clerk.redirectToCreateOrganization(); });