Skip to content

refactor(ui): name the Mosaic UserButton layers for their MVC roles - #9446

Open
alexcarpenter wants to merge 2 commits into
carp/account-button-controllerfrom
carp/account-button-mvc-layers
Open

refactor(ui): name the Mosaic UserButton layers for their MVC roles#9446
alexcarpenter wants to merge 2 commits into
carp/account-button-controllerfrom
carp/account-button-mvc-layers

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Aug 13, 2026

Copy link
Copy Markdown
Member

Description

useUserButtonController derives Clerk's resources into the shapes the view renders. That is a model, not a controller. The connected component is the controller: it holds the interaction state and binds the model to the view.

Before After Role
user-button.controller.tsx user-button.model.tsx derives data and intents from Clerk
user-button.tsx user-button.controller.tsx binds the model to the view
user-button.view.tsx unchanged renders

useUserButtonController becomes useUserButtonModel, UserButtonController becomes UserButtonModel, and UserButtonControllerOptions becomes UserButtonModelOptions. Comments that named the layers follow.

Renames only. No behavior, no logic, and no public export changes; UserButton is not barrel-exported on this branch yet.

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:

The hook derives Clerk's resources into the shapes the view renders. That is a
model, not a controller; the controller is the connected component that binds it
to the view.
It holds the interaction state and binds the model to the view, so it is the
controller. The filename now says so.
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview Aug 13, 2026 8:06pm
swingset Ready Ready Preview Aug 13, 2026 8:06pm

Request Review

@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 85c2429

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant