Skip to content

refactor(mosaic): split compound components into client leaves and namespace parts - #10795

Merged
alexcarpenter merged 1 commit into
mainfrom
carp/mosaic-rsc-compound-namespaces
Nov 17, 2026
Merged

alexcarpenter merged 1 commit into
mainfrom
carp/mosaic-rsc-compound-namespaces

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Description

Prepares compound components for React Server Components; #10806 builds on this to make them render from RSC.

Each of the 25 compound components now follows the Base UI layout:

  • <name>.tsx is a 'use client' leaf with prefixed exports (PanelRoot, PanelTitle, ...).
  • <name>.parts.ts re-exports them under the part names (Root, Title, ...).
  • index.ts does export * as Panel from './panel.parts'.

The 12 published compound indexes (avatar, banner, data-list, empty-state, entity, item, panel, profile, radio, section, segmented-control, table) keep 'use client', so published behavior is unchanged. X.Part usage and the XProps types are unchanged. Each compound is now a module namespace object instead of a plain object, so its parts are read-only.

Other changes:

  • Panel.Title passes [ref, panelTitleRef] to useRender instead of a conditional ref. The forward-ref-parts rule now checks it because it is exported, and it could not trace the conditional. Behavior is unchanged: the old ref was only null inside a profile page, where enabled is false and useRender returns null without rendering an element.

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:

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 17, 2026 7:42pm UTC
swingset Ready Ready Preview Nov 17, 2026 7:42pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7bfa7a4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

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

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

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Mosaic component modules replace compound component objects with individually named part exports. New part modules expose those exports under shorter names, and component entry points export those modules as namespaces. Client directives are added to component modules and selected entry points. Tests now import components through their directory entry points. PanelTitle changes the refs passed to useRender, and the Profile ResizeObserver test double no longer uses type casts.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: austincalvelage

Merge Risk: Minimal · up to 7bfa7

This refactor reorganizes how the Mosaic compound components are exported while keeping the X.Part usage and prop types the same. No concrete merge-blocking risk was found. The standard build and tests should still be run before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: compound components are split into 'use client' leaf files and namespace parts modules. The raw summary confirms this across the 25 compound components, including the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states that 25 compound components were refactored into a Base UI-style layout: a 'use client' leaf file with prefixed exports, a .parts.ts file that re-exports under part names, and a…
Full details: Title check

Explanation

The title names the main change: compound components are split into 'use client' leaf files and namespace parts modules. The raw summary confirms this across the 25 compound components, including the new .parts.ts re-exports, the removed compound objects, and the index.ts namespace exports. The title is specific and accurate, and it does not describe anything absent from the changeset.

Full details: Description check

Explanation

The description states that 25 compound components were refactored into a Base UI-style layout: a 'use client' leaf file with prefixed exports, a .parts.ts file that re-exports under part names, and an index.ts that exports a namespace. It also explains which published indexes keep 'use client', that X.Part usage and XProps types are unchanged, and that Panel.Title now passes [ref, panelTitleRef] to useRender. This matches the raw summary's changes across the component files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 89199fa and 7bfa7a4.

Files selected for processing: 19

  • packages/mosaic/src/components/avatar/index.ts
  • packages/mosaic/src/components/banner/index.ts
  • packages/mosaic/src/components/combobox/combobox.parts.ts
  • packages/mosaic/src/components/combobox/combobox.tsx
  • packages/mosaic/src/components/combobox/index.ts
  • packages/mosaic/src/components/data-list/index.ts
  • packages/mosaic/src/components/empty-state/index.ts
  • packages/mosaic/src/components/entity/index.ts
  • packages/mosaic/src/components/field/field.parts.ts
  • packages/mosaic/src/components/field/field.tsx
  • packages/mosaic/src/components/input-group/input-group.tsx
  • packages/mosaic/src/components/item/index.ts
  • packages/mosaic/src/components/menu/menu.tsx
  • packages/mosaic/src/components/panel/index.ts
  • packages/mosaic/src/components/profile/index.ts
  • packages/mosaic/src/components/radio/index.ts
  • packages/mosaic/src/components/section/index.ts
  • packages/mosaic/src/components/segmented-control/index.ts
  • packages/mosaic/src/components/table/index.ts
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Files with no reviewable changes: 1

  • packages/mosaic/src/components/combobox/combobox.tsx

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@blacksmith-sh

blacksmith-sh Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Matches Compounds render and work the same in Swingset

The UserProfile page's row menu and the Dialog story open the same way on both commits; the captures are byte-identical.

Merge-base

Profile row menu

This PR 7bfa7a43

Profile row menu

Merge-baseThis PR 7bfa7a43
Dialog openDialog open

Also checked · 3 match

Matches Published entries keep 'use client' and the same parts
Matches Compound parts are now read-only
Matches Panel.Title ref still reaches the title

Proof on 7bfa7a43 · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

Base automatically changed from devin/mosaic-component-exports to main November 16, 2026 21:58
@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10795

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10795

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10795

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10795

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10795

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10795

@clerk/localizations

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

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10795

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10795

@clerk/upgrade

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

@clerk/vue

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

commit: 7bfa7a4

@alexcarpenter
alexcarpenter merged commit dd89672 into main Nov 17, 2026
59 of 60 checks passed
@alexcarpenter
alexcarpenter deleted the carp/mosaic-rsc-compound-namespaces branch November 17, 2026 19:59

This branch was successfully deployed

2 active deployments
Preview – swingset — 7bfa7a43 Deployed Nov 17, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 7bfa7a43 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants