Skip to content

refactor(shared,ui): move the sign-up form field rules into shared - #10868

Open
austincalvelage wants to merge 5 commits into
austin/shared-clerk-signal-hookfrom
austin/shared-sign-up-form-fields
Open

austincalvelage wants to merge 5 commits into
austin/shared-clerk-signal-hookfrom
austin/shared-sign-up-form-fields

Conversation

@austincalvelage

@austincalvelage austincalvelage commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Description

The existing sign-up form and Mosaic need the same rules for deciding which fields to show and require. This moves those rules and their tests to shared. The existing form keeps its imports through re-exports in ui.

minimizeFieldsForExistingSignup now accepts ExistingSignUpInput, which describes the profile fields and verification statuses it reads. Mosaic can pass its sign-up data without constructing a full SignUpResource.

The blocked-request parser also moves to shared so both UIs can read the details of a blocked request from the same Clerk error. ui re-exports the parser from its existing path.

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 17, 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 18, 2026 12:28am UTC
mosaic-docs Error Error Nov 18, 2026 12:28am UTC
swingset Ready Ready Preview Nov 18, 2026 12:28am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ac874b0

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 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 256b496 and ac874b0.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The PR adds shared types and helpers for sign-up field selection, identifier requirements, and existing sign-up field minimization. The UI helper now re-exports FieldKey from the shared module and retains FormState<T>. The tests import the shared helpers from their new module. The PR also adds shared action-blocked detail extraction helpers, which the UI utility re-exports.

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

<fixed_issue_severity>

Suggested reviewers: alexcarpenter, zourzouvillys

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: moving the sign-up form field rules from the ui package into shared. The raw summary confirms that signUpFormFields.ts was added in shared and the rules were removed f…
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 the change moves sign-up form field rules and the blocked-request parser from ui to shared, keeps ui imports working through re-exports, and adds ExistingSignUpInput so Mosaic c…
Full details: Title check

Explanation

The title names the main change: moving the sign-up form field rules from the ui package into shared. The raw summary confirms that signUpFormFields.ts was added in shared and the rules were removed from signUpFormHelpers.ts in ui. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description states the change moves sign-up form field rules and the blocked-request parser from ui to shared, keeps ui imports working through re-exports, and adds ExistingSignUpInput so Mosaic can pass sign-up data. This matches the changeset, which removes the rules from signUpFormHelpers.ts and adds signUpFormFields.ts and actionBlocked.ts in shared. The checklist is unchecked for pnpm test and pnpm build, but the check only requires the description to relate to the changes.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Library detection encountered an error. Review will continue without library-specific context.

The configuration directory could not be loaded. This review used the available YAML and UI settings; directory instructions and checks were not evaluated.

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 53afeda and 256b496.

Files selected for processing: 3

  • packages/shared/src/internal/clerk-js/actionBlocked.ts
  • packages/shared/src/internal/clerk-js/signUpFormFields.ts
  • packages/ui/src/utils/actionBlocked.ts
Linked repositories identified

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

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

@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@10868

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

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

@clerk/expo-native-components

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: ac874b0

determineActiveFields and its helpers move from ui's signUpFormHelpers to
@clerk/shared/internal/clerk-js/signUpFormFields, so Mosaic uses the same
rules. ui's signUpFormHelpers re-exports them and keeps FormState, its only
ui-specific type.
@blacksmith-sh

blacksmith-sh Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Matches Sign-up form fields unchanged after move

Sign-up form has the same fields and required flags before and after under three instance settings, and the old and moved rule functions agree on every input tried.

Merge-baseThis PR 256b4968
Staging instanceStaging instance
Email or phoneEmail or phone
Username first factorUsername first factor

5.7M inputs compared

Also checked · 1 match

Matches Blocked-request card unchanged after move

Proof on 256b4968 (from 53afeda5) · Did Proof get it right? Yes · No

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

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-11-18T00:30:20.262Z

Summary

Metric Count
Packages analyzed 20
Packages with changes 1
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 2

@clerk/shared

Current version: 4.46.0
Recommended bump: MINOR → 4.47.0

Subpath ./internal/clerk-js/actionBlocked

🟢 Additions (1)

Added: ./internal/clerk-js/actionBlocked

New subpath export ./internal/clerk-js/actionBlocked (3 exported members)

Subpath ./internal/clerk-js/signUpFormFields

🟢 Additions (1)

Added: ./internal/clerk-js/signUpFormFields

New subpath export ./internal/clerk-js/signUpFormFields (11 exported members)


Report generated by Break Check

Last ran on ac874b0.

…ngSignup

It now takes the fields it reads instead of the legacy SignUpResource, so
Mosaic can pass the SignUpFuture resource.

This branch was successfully deployed

2 active deployments
Preview – swingset — ac874b05 Deployed Nov 18, 2026 by vercel[bot]
Preview – clerk-js-sandbox — ac874b05 Deployed Nov 18, 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.

1 participant