Skip to content
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

fix(clerk-react): Missing methods and properties from IsomorphicClerk #2226

Merged
merged 7 commits into from
Nov 29, 2023

Conversation

panteliselef
Copy link
Member

@panteliselef panteliselef commented Nov 28, 2023

Description

SDK-1035

This PR aims to bring IsomorphicClerk in sync with the clerk singleton and the LoadedClerk interface.
IsomorphicClerk now extends from LoadedClerk in order to avoid missing methods without typescript errors.

Before

const { loaded, buildSignUpUrl } = useClerk();

if(loaded) buildSignUpUrl(...)
// ^ This would throw an error as `buildSignUpUrl` was not defined when IsomorphicClerk was instantiated

After

const { loaded, buildSignUpUrl } = useClerk();

if(loaded) buildSignUpUrl(...)
// Works as expected and a url is returned.

Keep in mind you still need to check if Clerk has loaded in order to

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

Copy link

changeset-bot bot commented Nov 28, 2023

🦋 Changeset detected

Latest commit: 1eee5ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@clerk/clerk-js Patch
@clerk/clerk-react Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
gatsby-plugin-clerk Patch
@clerk/nextjs Patch
@clerk/remix 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

@panteliselef panteliselef changed the title [WIP] fix(clerk-react): Missing methods and properties from IsomorphicClerk SDK-1035 fix(clerk-react): Missing methods and properties from IsomorphicClerk Nov 29, 2023
@panteliselef panteliselef changed the title SDK-1035 fix(clerk-react): Missing methods and properties from IsomorphicClerk fix(clerk-react): Missing methods and properties from IsomorphicClerk Nov 29, 2023
@panteliselef panteliselef marked this pull request as ready for review November 29, 2023 10:11
@panteliselef panteliselef requested a review from dimkl November 29, 2023 10:49
@octoper
Copy link
Member

octoper commented Nov 29, 2023

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @octoper - the snapshot version command generated the following package versions:

Package Version
@clerk/backend 1.0.1-snapshot.v24602f7
@clerk/chrome-extension 1.0.1-snapshot.v24602f7
@clerk/clerk-js 5.0.1-snapshot.v24602f7
@clerk/clerk-expo 1.0.1-snapshot.v24602f7
@clerk/fastify 1.0.1-snapshot.v24602f7
gatsby-plugin-clerk 5.0.1-snapshot.v24602f7
@clerk/localizations 2.0.1-snapshot.v24602f7
@clerk/nextjs 5.0.1-snapshot.v24602f7
@clerk/clerk-react 5.0.1-snapshot.v24602f7
@clerk/remix 4.0.1-snapshot.v24602f7
@clerk/clerk-sdk-node 5.0.1-snapshot.v24602f7
@clerk/shared 2.0.1-snapshot.v24602f7
@clerk/themes 2.0.1-snapshot.v24602f7
@clerk/types 4.0.1-snapshot.v24602f7

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/backend

npm i @clerk/[email protected] --save-exact

@clerk/chrome-extension

npm i @clerk/[email protected] --save-exact

@clerk/clerk-js

npm i @clerk/[email protected] --save-exact

@clerk/clerk-expo

npm i @clerk/[email protected] --save-exact

@clerk/fastify

npm i @clerk/[email protected] --save-exact

gatsby-plugin-clerk

npm i [email protected] --save-exact

@clerk/localizations

npm i @clerk/[email protected] --save-exact

@clerk/nextjs

npm i @clerk/[email protected] --save-exact

@clerk/clerk-react

npm i @clerk/[email protected] --save-exact

@clerk/remix

npm i @clerk/[email protected] --save-exact

@clerk/clerk-sdk-node

npm i @clerk/[email protected] --save-exact

@clerk/shared

npm i @clerk/[email protected] --save-exact

@clerk/themes

npm i @clerk/[email protected] --save-exact

@clerk/types

npm i @clerk/[email protected] --save-exact

Copy link
Contributor

⚠️ Changes detected under the ClerkJS ui directory!

Don't forget to apply the same changes under the /ui.retheme directory:
packages/clerk-js/src/ui/** ➡️ packages/clerk-js/src/ui.retheme/**

Also, you may need to update the following files:

  • packages/localizations/src/en-US.retheme.ts
  • packages/localizations/src/index.retheme.ts
  • packages/types/src/appearance.retheme.ts
  • packages/types/src/clerk.retheme.ts
  • packages/types/src/index.retheme.ts
  • packages/types/src/localization.retheme.ts

@panteliselef panteliselef force-pushed the elef/fix-missing-isomorphic-clerk branch from 0e0c835 to 1eee5ed Compare November 29, 2023 15:42
@panteliselef panteliselef added this pull request to the merge queue Nov 29, 2023
Merged via the queue into main with commit 6e54b1b Nov 29, 2023
8 checks passed
@panteliselef panteliselef deleted the elef/fix-missing-isomorphic-clerk branch November 29, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants