Repository navigation
refactor(mosaic): type machine state names and check targets in setup machines - #10511
alexcarpenter wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: b94f92f 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 |
|
No actionable comments were generated in the recent review.
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
Description
Types machine state names in the Mosaic machine lib. Runtime behavior does not change.
setup().createMachine,TStatesis inferred from thestateskeys, sosnapshot.valueis the union of state names instead ofstring, andinitialplus every transition target are checked against those names.StateMachine,Snapshot,ActorandCreateActorOptionstake aTStatesparam, threaded throughcreateActor,mockActor,useMachine,useActoranduseSelector. It defaults tostringeverywhere, so callers that pass explicit type arguments still compile.initialand targets are wrapped inNoInfer, so a barecreateMachine({ initial: 'a', states: { a: { on: { NEXT: 'b' } }, b: {} } })no longer infersTStatesfrominitialand rejects the valid target'b'.TStates, which removes twoas stringcasts increate-actor.ts(suppression count 8 → 6).No existing machine needed changes to typecheck. The machine lib is not part of
@clerk/mosaic's public exports, so this has an empty changeset.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change