-
Notifications
You must be signed in to change notification settings - Fork 401
fix(chrome-extension): Bundle @clerk/shared to properly tree-shake #4899
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(chrome-extension): Bundle @clerk/shared to properly tree-shake #4899
Conversation
🦋 Changeset detectedLatest commit: 8c6f91f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 ↗︎
|
|
!snapshot |
|
Hey @LekoArts - 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@2.1.8-snapshot.v20250115120857 --save-exact
npm i @clerk/backend@1.22.1-snapshot.v20250115120857 --save-exact
npm i @clerk/chrome-extension@2.1.12-snapshot.v20250115120857 --save-exact
npm i @clerk/clerk-js@5.44.1-snapshot.v20250115120857 --save-exact
npm i @clerk/clerk-expo@2.6.11-snapshot.v20250115120857 --save-exact
npm i @clerk/express@1.3.35-snapshot.v20250115120857 --save-exact
npm i @clerk/fastify@2.1.8-snapshot.v20250115120857 --save-exact
npm i @clerk/nextjs@6.9.11-snapshot.v20250115120857 --save-exact
npm i @clerk/nuxt@1.0.4-snapshot.v20250115120857 --save-exact
npm i @clerk/react-router@0.1.9-snapshot.v20250115120857 --save-exact
npm i @clerk/remix@4.4.10-snapshot.v20250115120857 --save-exact
npm i @clerk/tanstack-start@0.8.9-snapshot.v20250115120857 --save-exact
npm i @clerk/testing@1.4.8-snapshot.v20250115120857 --save-exact
npm i @clerk/vue@1.0.3-snapshot.v20250115120857 --save-exact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Description
If you look at https://unpkg.com/browse/@clerk/chrome-extension@2.1.11/dist/esm/index.js you'll see that we end up with:
The unused
import '@clerk/shared/loadClerkJsScript';is problematic because inside is "remotely hosted code" that the Chrome extension store is flagging. In #4551 build flags were added and they work. But the unused imports are not removed during bundling.So the fix is to also mark
@clerk/sharednot external and bundle it. Then tsup seems to be able to remove those unused imports.Fixes #4886
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change