Refactor clerkjs init#4709
Conversation
🦋 Changeset detectedLatest commit: 6a3d41e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f2a8e47 to
6f99df5
Compare
40730fd to
3b1a755
Compare
9089dc3 to
bf524a4
Compare
bf524a4 to
c7bce11
Compare
0864042 to
c7bce11
Compare
c7bce11 to
f0f9423
Compare
b8abd7d to
20531d0
Compare
20531d0 to
4446ecf
Compare
| const initEnvironmentPromise = Environment.getInstance() | ||
| .fetch({ touch: shouldTouchEnv }) | ||
| .then(res => { | ||
| this.updateEnvironment(res); | ||
| }); |
There was a problem hiding this comment.
Can we also make this a function and call it like we do with initClient()? It's a bit inconsistent now and a bit confusing to read.
There was a problem hiding this comment.
No because we don't want to run two promises, we want to wait for the first one to resolve.
|
|
||
| await Promise.all([initEnvironmentPromise, initClient()]).catch(async e => { | ||
| // limit the changes for this specific error for now | ||
| if (isClerkAPIResponseError(e) && e.errors[0].code === 'requires_captcha') { |
There was a problem hiding this comment.
This could be a util under @clerk/shared/error, as it is used in numerous places. We already have similar utils, like is4xxError etc.
4446ecf to
cf1deea
Compare
|
!snapshot |
|
Hey @nikosdouvlis - 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.5.5-snapshot.v20241206140722 --save-exact
npm i @clerk/backend@1.20.0-snapshot.v20241206140722 --save-exact
npm i @clerk/chrome-extension@2.0.6-snapshot.v20241206140722 --save-exact
npm i @clerk/clerk-js@5.40.0-snapshot.v20241206140722 --save-exact
npm i @clerk/elements@0.21.1-snapshot.v20241206140722 --save-exact
npm i @clerk/clerk-expo@2.4.2-snapshot.v20241206140722 --save-exact
npm i @clerk/expo-passkeys@0.0.14-snapshot.v20241206140722 --save-exact
npm i @clerk/express@1.3.23-snapshot.v20241206140722 --save-exact
npm i @clerk/fastify@2.0.25-snapshot.v20241206140722 --save-exact
npm i @clerk/localizations@3.8.0-snapshot.v20241206140722 --save-exact
npm i @clerk/nextjs@6.8.0-snapshot.v20241206140722 --save-exact
npm i @clerk/nuxt@0.0.10-snapshot.v20241206140722 --save-exact
npm i @clerk/clerk-react@5.19.0-snapshot.v20241206140722 --save-exact
npm i @clerk/remix@4.3.3-snapshot.v20241206140722 --save-exact
npm i @clerk/clerk-sdk-node@5.0.74-snapshot.v20241206140722 --save-exact
npm i @clerk/shared@2.19.1-snapshot.v20241206140722 --save-exact
npm i @clerk/tanstack-start@0.6.3-snapshot.v20241206140722 --save-exact
npm i @clerk/testing@1.3.35-snapshot.v20241206140722 --save-exact
npm i @clerk/themes@2.1.53-snapshot.v20241206140722 --save-exact
npm i @clerk/types@4.39.0-snapshot.v20241206140722 --save-exact
npm i @clerk/ui@0.2.1-snapshot.v20241206140722 --save-exact
npm i @clerk/vue@0.0.14-snapshot.v20241206140722 --save-exact |
Description
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change