diff --git a/.changeset/light-coats-brush.md b/.changeset/light-coats-brush.md new file mode 100644 index 00000000000..210bc27e385 --- /dev/null +++ b/.changeset/light-coats-brush.md @@ -0,0 +1,7 @@ +--- +'@clerk/clerk-js': patch +'@clerk/shared': patch +'@clerk/types': patch +--- + +Deprecate the `organization.__unstable__invitationUpdate` and `organization.__unstable__membershipUpdate` methods. diff --git a/packages/clerk-js/src/core/clerk.ts b/packages/clerk-js/src/core/clerk.ts index 0668c314d67..ba89e687543 100644 --- a/packages/clerk-js/src/core/clerk.ts +++ b/packages/clerk-js/src/core/clerk.ts @@ -170,7 +170,14 @@ export default class Clerk implements ClerkInterface { #fapiClient: FapiClient; #instanceType: InstanceType; #isReady = false; + + /** + * @deprecated Although this being a private field, this is a reminder to drop it with the next major release + */ #lastOrganizationInvitation: OrganizationInvitationResource | null = null; + /** + * @deprecated Although this being a private field, this is a reminder to drop it with the next major release + */ #lastOrganizationMember: OrganizationMembershipResource | null = null; #listeners: Array<(emission: Resources) => void> = []; #options: ClerkOptions = {}; @@ -1185,12 +1192,28 @@ export default class Clerk implements ClerkInterface { this.#emit(); }; + /** + * @deprecated This method will be dropped in the next major release. + * This method is only used in another deprecated part: `invitationList` from useOrganization + */ __unstable__invitationUpdate(invitation: OrganizationInvitationResource) { + deprecated( + '__unstable__invitationUpdate', + 'We are completely dropping this method as it was introduced for internal use only', + ); this.#lastOrganizationInvitation = invitation; this.#emit(); } + /** + * @deprecated This method will be dropped in the next major release. + * This method is only used in another deprecated part: `membershipList` from useOrganization + */ __unstable__membershipUpdate(membership: OrganizationMembershipResource) { + deprecated( + '__unstable__invitationUpdate', + 'We are completely dropping this method as it was introduced for internal use only', + ); this.#lastOrganizationMember = membership; this.#emit(); } diff --git a/packages/shared/src/hooks/contexts.tsx b/packages/shared/src/hooks/contexts.tsx index d70c53f3e0f..74c0aeb90ab 100644 --- a/packages/shared/src/hooks/contexts.tsx +++ b/packages/shared/src/hooks/contexts.tsx @@ -25,7 +25,16 @@ const [SessionContext, useSessionContext] = createContextAndHook