chore(astro,clerk-react,shared,nextjs): Migrate functions that can be reused across JavaScript SDKs#3849
Conversation
🦋 Changeset detectedLatest commit: 090f0e7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
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 |
d0eebdd to
2ef2052
Compare
panteliselef
left a comment
There was a problem hiding this comment.
If this is not urgent, I can review early next week 😊
Definitely not urgent, and thanks! |
@panteliselef that'd be awesome if that's the case. So we can just set the default |
LekoArts
left a comment
There was a problem hiding this comment.
Looks good! Some smaller requests
a313653 to
2fab204
Compare
| const errorThrower = buildErrorThrower({ packageName: '@clerk/shared' }); | ||
|
|
||
| /** | ||
| * Sets the package name for error messages during ClerkJS script loading. | ||
| * | ||
| * @example | ||
| * setClerkJsLoadingErrorPackage('@clerk/clerk-react'); | ||
| */ | ||
| export function setClerkJsLoadingErrorPackageName(packageName: string) { | ||
| errorThrower.setPackageName({ packageName }); | ||
| } |
There was a problem hiding this comment.
This one is only used inside loadClerkJsScript. I named it like that and not export another setErrorThrowerOptions to avoid confusion. We might also need to add this to frontend SDK spec @LekoArts
I also thought of sharing this errorThrower across SDKs but that would mess with existing error throwers in next and react.
chore(shared): Add deriveState to published files chore(shared): Add deriveState to published files
test(astro): Test script loader version test(astro): Add main script loader test
…f clerk-js script attribute is undefined
…rkJS script loading fails
b09d148 to
33c28b6
Compare
|
!snapshot |
|
Hey @wobsoriano - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@1.0.11-snapshot.v090f0e7 --save-exact
npm i @clerk/backend@1.6.2-snapshot.v090f0e7 --save-exact
npm i @clerk/chrome-extension@1.1.13-snapshot.v090f0e7 --save-exact
npm i @clerk/clerk-js@5.14.0-snapshot.v090f0e7 --save-exact
npm i @clerk/elements@0.12.4-snapshot.v090f0e7 --save-exact
npm i @clerk/clerk-expo@2.1.0-snapshot.v090f0e7 --save-exact
npm i @clerk/express@0.0.27-snapshot.v090f0e7 --save-exact
npm i @clerk/fastify@1.0.29-snapshot.v090f0e7 --save-exact
npm i @clerk/localizations@2.5.7-snapshot.v090f0e7 --save-exact
npm i @clerk/nextjs@5.3.0-snapshot.v090f0e7 --save-exact
npm i @clerk/clerk-react@5.4.0-snapshot.v090f0e7 --save-exact
npm i @clerk/remix@4.2.13-snapshot.v090f0e7 --save-exact
npm i @clerk/clerk-sdk-node@5.0.26-snapshot.v090f0e7 --save-exact
npm i @clerk/shared@2.5.0-snapshot.v090f0e7 --save-exact
npm i @clerk/tanstack-start@0.2.0-snapshot.v090f0e7 --save-exact
npm i @clerk/testing@1.2.9-snapshot.v090f0e7 --save-exact
npm i @clerk/themes@2.1.19-snapshot.v090f0e7 --save-exact
npm i @clerk/types@4.13.0-snapshot.v090f0e7 --save-exact |
Description
See previous PR here.
This PR aims to migrate ClerkJS script loader functions to the shared package so it can be reused across official and community SDKs.
New functions exported in
@clerk/shared:loadClerkJsScript- Hotloads the Clerk JS script.deriveState- Renders initial auth state from SSR if availableversionSelectorCloses ECO-4
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change