Uh oh!
There was an error while loading. Please reload this page.
feat(headless): remove renderElement, consolidate into useRender - #9233
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
renderElement has no callers left after the primitive migration. Move the shared prop types (RenderProp, ComponentProps, DefaultProps, StateAttributesMapping) and mergeProps into use-render.tsx, repoint the utils barrel there, and delete render-element.tsx. The mergeProps unit tests and the ComponentProps type test are ported alongside.
653e0f8 to
bb86c57Compare@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/vuecommit: |
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
📝 WalkthroughWalkthroughThe render-related types and Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
Stacked on #9232. Merge that first.
Final PR of the
renderElement→useRendermigration. After PR2,renderElementhad zero callers, so this removes it.What changed
render-element.tsxwas doing double duty: it held the deadrenderElementfunction and the shared building blocks every primitive still uses (the prop types +mergeProps). So this is a move-then-delete, not a bare delete:RenderProp,ComponentProps,DefaultProps,StateAttributesMapping, andmergePropsintouse-render.tsx(its sole consumer now).utilsbarrel to re-export them from./use-render. Public barrel surface is unchanged exceptrenderElementis gone (nothing imported it).render-element.tsx,render-element.test.tsx,render-element.test-d.ts.mergePropsdescribe block intouse-render.test.tsxand theComponentPropstype test intouse-render.test-d.tsso no coverage is lost. TherenderElement-specific behavioral tests are dropped with the function (their behavior is already covered by theuseRendercases from PR1).Verification
grep renderElement/grep render-elementacrosspackages/headless/src+packages/ui/src→ zero matches.pnpm --filter @clerk/headless typecheck→ clean.pnpm --filter @clerk/headless exec eslint src→ exit 0, zero warnings.pnpm --filter @clerk/headless test→ 591 passed, 1 skipped.Empty changeset (
@clerk/headlessis private).The two remaining
useMergeRefsimports (tooltip-arrow.tsx,popover-arrow.tsx) are correct — those parts renderFloatingArrowdirectly and never usedrenderElement.