Skip to content

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

Merged
panteliselef merged 7 commits into
mainfrom
elef/fix-missing-isomorphic-clerk
Nov 29, 2023
Merged

fix(clerk-react): Missing methods and properties from IsomorphicClerk#2226
panteliselef merged 7 commits into
mainfrom
elef/fix-missing-isomorphic-clerk

Conversation

@panteliselef

@panteliselef panteliselef commented Nov 28, 2023

Copy link
Copy Markdown
Contributor

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

@changeset-bot

changeset-bot Bot commented Nov 28, 2023

Copy link
Copy Markdown

🦋 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

octoper commented Nov 29, 2023

Copy link
Copy Markdown
Contributor

!snapshot

@clerk-cookie

Copy link
Copy Markdown
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/backend@1.0.1-snapshot.v24602f7 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@1.0.1-snapshot.v24602f7 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.0.1-snapshot.v24602f7 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@1.0.1-snapshot.v24602f7 --save-exact

@clerk/fastify

npm i @clerk/fastify@1.0.1-snapshot.v24602f7 --save-exact

gatsby-plugin-clerk

npm i gatsby-plugin-clerk@5.0.1-snapshot.v24602f7 --save-exact

@clerk/localizations

npm i @clerk/localizations@2.0.1-snapshot.v24602f7 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@5.0.1-snapshot.v24602f7 --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.0.1-snapshot.v24602f7 --save-exact

@clerk/remix

npm i @clerk/remix@4.0.1-snapshot.v24602f7 --save-exact

@clerk/clerk-sdk-node

npm i @clerk/clerk-sdk-node@5.0.1-snapshot.v24602f7 --save-exact

@clerk/shared

npm i @clerk/shared@2.0.1-snapshot.v24602f7 --save-exact

@clerk/themes

npm i @clerk/themes@2.0.1-snapshot.v24602f7 --save-exact

@clerk/types

npm i @clerk/types@4.0.1-snapshot.v24602f7 --save-exact

@github-actions

Copy link
Copy Markdown
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
@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