feat(headless): add useRender hook alongside renderElement#9231
Conversation
Introduces a base-ui-style useRender hook: a render prop that accepts a
React element (render={<Link/>}) or a function, with internal ref merging
and state-to-data-attribute mapping. renderElement stays exported for the
phased migration. Migrates Mosaic Box, Heading, Text and the dialog
trigger/popup primitives onto the hook.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 3445cc3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen 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 |
|
Warning Review limit reached
Next review available in: 33 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Comment |
@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/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
Why
renderElement(function) →useRender(hook). Wins:1. render-as-element. Today every override must be a function wrapper. Now pass the element directly.
2. ref merging moves inside. Drop the per-call-site
useMergeRefs.3. Mosaic: one path, no cast.
Also aligns with base-ui (swingset already uses real base-ui
useRender).Scope
PR1 of a phased series. Adds
useRender(ownutils/use-render.tsx), keepsrenderElementexported for the rest of the migration. Migrates MosaicBox/Heading/Text+dialog-trigger/dialog-popupas representative patterns. Follow-ups convert remaining ~60 primitives by family; final PR deletesrenderElement.Reuses Clerk's
mergeProps+useMergeRefs(@floating-ui/react, already a dep). No new runtime dep, no base-ui engine vendored.Empty changeset:
@clerk/headlessprivate, migrated Mosaic parts not in@clerk/uipublic exports (matches #9208).Verified
@clerk/headlesstypecheck + 601 tests pass.@clerk/uitype-check clean.