feat(mosaic): extract mosaic into @clerk/mosaic - #9765
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: eb7f9b4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
|
Important Review skippedToo many files! This PR contains 469 files, which is 169 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (469)
You can disable this status message by setting the Comment |
0d340bb to
3e2c67f
Compare
API Changes Report
Summary
🔴 Breaking changes index (1)Every breaking change, up front. Full diffs are in the package sections below.
@clerk/uiCurrent version: 1.33.1 Subpath
|
3e2c67f to
11bdbaf
Compare
| ### Prerequisites | ||
|
|
||
| - Node.js `>=20.9.0` or later | ||
| - A Clerk SDK that renders a `ClerkProvider` (`@clerk/react`, `@clerk/nextjs`, …) |
There was a problem hiding this comment.
not sure if it's worth mentioning, but installing a version of @clerk/mosaic that references a different version of @clerk/shared than their framework SDK package will result in the "must be rendered under ClerkProvider" error since there are two different ClerkProvider types. So they would need to make sure to install the version of their framework SDK that was published at the same time as @clerk/mosaic.
There was a problem hiding this comment.
This is very true.. Hmm, I wonder if we should let Mosaic just bundle the shared stuff it needs? It's not much. When we move exports over to the framework packages when they are stable this wont be an issue.
I'll go ahead and do that in this PR tomorrow. 😄
There was a problem hiding this comment.
I was tired yesterday when I wrote this, I had the assumption we were only using a few shared helpers that we could specifically bundle to avoid this, but ofc we are using useClerk etc inside Mosaic so that wont help.
Need to think through this some more. Keeping Mosaic and framework packages in sync would be very annoying and opposite to what we want, we want people to be able to pin Mosaic but not the main package. 🤔
There was a problem hiding this comment.
I think your original idea of just documenting this was right. This should normally not be a problem, if it is, you do want to resolve it so you don't have duplicate packages. I added a troubleshooting section to the PR with details and how to fix it if you see the error we already have in place for this.
|
|
||
| import { mosaicLightningCssTargets } from './stylex-lightningcss.config.mjs'; | ||
|
|
||
| export default defineConfig({ |
There was a problem hiding this comment.
we can review this later, but I think we need to avoid actually bundling UI components since it makes it more difficult to tree-shake unused code.
| onSuccess: async () => { | ||
| const { cp, rm } = await import('node:fs/promises'); | ||
| await cp('./dist-css/styles.css', './dist/styles.css'); | ||
| await rm('./dist-css', { recursive: true, force: true }); | ||
| await rm('./dist/styles.partial.css', { force: true }); | ||
| await rm('./dist/index.js.map', { force: true }); |
There was a problem hiding this comment.
for future investigation, this seems like we're holding the bundler wrong
0d4ce83 to
290e9a1
Compare
Co-authored-by: Dylan Staley <88163+dstaley@users.noreply.github.com>
3139494 to
51e8590
Compare
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
Description
This PR moves Mosaic into its own
@clerk/mosaicpackage.In its current form, merging this PR will also release a first version of Mosaic, which makes it publicly available. In other words, this is also an entry-point PR replacing the strategy in #9338 (for the experimental phase at least).
This PR exports
UserButtondirectly from@clerk/mosaicand lets the <1.0 version and readme indicate that it's experimental. An alternative is to export it from@clerk/mosaic/experimentalto make it extra clear, but I don't think that's necessary.When components are stable, they will move to be exported from the framework packages like
@clerk/nextjs. This package will still be the home of the components themselves after that, anduiwill move to import them from here and become a compatibility layer for non-React frameworks (is the current plan, until it changes).Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Stack created with GitHub Stacks CLI • Give Feedback 💬