Skip to content

feat(clerk-js): Add bundleless ESM build #5964

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

dstaley
Copy link
Member

@dstaley dstaley commented May 19, 2025

Description

(This PR is technically a draft; the pr.pkg.new workflow doesn't run on draft PRs.)

This experimental PR adds support for building a "bundleless" version of clerk-js, specifically the ESM build. More details to come if this experiment proves successful!

Checklist

  • pnpm test runs as expected.
  • pnpm 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:

Copy link

changeset-bot bot commented May 19, 2025

⚠️ No Changeset found

Latest commit: 8d463e2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 8:53pm

@dstaley dstaley marked this pull request as ready for review May 19, 2025 20:58
@@ -23,7 +23,7 @@
"author": "Clerk",
"main": "dist/clerk.js",
"jsdelivr": "dist/clerk.browser.js",
"module": "dist/clerk.mjs",
"module": "dist/esm/index.mjs",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a breaking change in some cases ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would only break if someone was importing directly from dist/. The only reason this is in a folder is because Rslib will, for some reason, run on all files in the input folder. So it would emit index.browser.js which was confusing. Not a strong suggestion that we do it this way, just wanted to get it working for experimental purposes!

@dstaley dstaley closed this May 19, 2025
@dstaley dstaley reopened this May 19, 2025
Copy link

pkg-pr-new bot commented May 19, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@5964

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@5964

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@5964

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@5964

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@5964

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@5964

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@5964

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@5964

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@5964

@clerk/express

npm i https://pkg.pr.new/@clerk/express@5964

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@5964

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@5964

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@5964

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@5964

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@5964

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@5964

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@5964

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@5964

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@5964

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@5964

@clerk/types

npm i https://pkg.pr.new/@clerk/types@5964

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@5964

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@5964

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@5964

commit: 8d463e2

@dstaley
Copy link
Member Author

dstaley commented Jun 4, 2025

currently blocked by web-infra-dev/rslib#1007 and web-infra-dev/rslib#882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants