Repository navigation
Version Packages (alpha) - #5813
Merged
Merged
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
github-actions
Bot
force-pushed
the
changeset-release/next
branch
4 times, most recently
from
October 19, 2026 20:49
56bac38 to
d6810a3
Compare
github-actions
Bot
force-pushed
the
changeset-release/next
branch
from
October 19, 2026 21:29
d6810a3 to
957b907
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.
nextis currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exitonnext.Releases
xstate@6.0.0-alpha.70
Major Changes
ceeebb0:
ActorRefFrom<T>accepts actor logic only, andActorRefFromLogic<T>is removed. ReplaceActorRefFromLogic<T>withActorRefFrom<T>. Pass the logic type instead of a promise, an actor ref, or a function returning logic:ActorRefFrom<typeof machine>refs return the fully typed machine snapshot fromgetSnapshot(), includingcontext,valueandmatches('#id').ceeebb0: State keys cannot contain an unescaped
., which separates path segments. Creating a machine with such a key throwsState key "foo.bar" contains "." — nest the states or escape it as "foo\\.bar".To use a literal dot, write the key escaped. The escaped form is then the key everywhere: state values, implicit ids,matches(...), targets and persisted snapshots. It never collides with a nestedfoo→bar.Two implicit state ids can no longer coincide, and any duplicate state id now throws.
39d3b5c:
#targets,snapshot.matches('#…')and@xstate.stateInguards resolve by exact state id. The text after#is a state's whole id, either its explicitidor its implicit id (the path from the root, prefixed by the machineid). It is no longer split into an id followed by a relative path. Dots in explicit ids are matched as written, without escaping.An unknown id throws when the machine is created. When the old id-plus-path form resolves, the error names the target's id:
Typed
#targets andmatches('#…')accept only whole ids.ceeebb0: The root
xstateentry no longer exports type-level helpers:TODO,IsAny,IsNever,Equals,Cast,Compute,Prop,HomomorphicOmit,LowInfer,DoNotInfer,SingleOrArray,MaybeLazyandAnyFunction. Define equivalents in your own code if you used them.ConditionalRequired,IsNotNeverandNonReducibleUnknownremain exported because emitted declarations reference them, and are marked@experimental.ActorOptionsno longer has the undocumentedparentoption. Create child actors withinvoke,spawn(...)orenq.spawn(...).ceeebb0: Implicit state and invoke ids no longer use the
(machine)placeholder.., prefixed by the machineidwhen there is one:shop.checkout.paymentforid: 'shop', andcheckout.paymentwithout an id (previously(machine).checkout.payment).machine.idand the root state's id are''for a machine without anid.#cannot reference that root; give the machine anidto target it as#shop.<stateId>:<index>:loading:0,loading:1,shop.checkout:0. A root invoke is:0, orshop:0with a machine id (previously0.(machine).loading). Anonymous spawned actors keepx:<n>, and generated spawn ids skip ids already held by an invoke.idthat equals another state's id throws when the machine is created.the machineinstead ofmachine '(machine)'.Persisted snapshots that reference
(machine).…state ids or0.(machine).…child ids do not restore; migrate them withmachineVersions.ceeebb0: Children invoked with inline logic no longer get a synthetic source name (
xstate.invoke.<index>.<stateId>). Their persisted entries omitsrc, and restoring resolves them through the invoke definition with the same id among the restored active states. Restoring fails with a descriptive error when no active state, or more than one, invokes that id. Children invoked with a registered name (src: 'fetchUser') keep persisting that key, and remote children still require one.Snapshots persisted by earlier alphas that carry
src: 'xstate.invoke.…'no longer restore; remove thatsrcor migrate them withmachineVersions.ceeebb0: Bare string transition values throw when the machine is created, in every build. This matches the types and
machineFromJSON, which already rejected them. It coverson,after,always,onDone,onError,onTimeout, and invokeonDone/onError/onSnapshot/onTimeout.initialstays a string key, andxstate/fsmstill accepts string targets.xstate-codemod migrate(thestring-targetstransform) rewrites these.ceeebb0:
invokerequiresinputwhen the invoked actor logic requires input, matchingcreateActor(logic, { input })andenq.spawn(logic, { input }). This applies to logic values, registered source names andsrcfunctions, increateMachine,setup(...).createMachineandsetup(...).createStateConfig. Logic whose input type acceptsundefined(noschemas.input, or an optional input schema) can still omit it.enq.spawn(logic)without required input now reportsExpected 2 argumentsinstead of a mismatch against the source-name overload.ceeebb0: A machine that declares
versionmust also declareid, because persisted snapshots record the machine as{ id, version }.createMachine,setup(...).createMachineandMachineJSONreport a missingidas a type error, and creating such a machine throwsMachine with version '2' must declare an id.Machines without aversionkeepidoptional.Patch Changes
ceeebb0:
#transition targets type-check against implicit state ids as well as explicit ones:target: '#checkout.payment', or'#shop.checkout.payment'for a machine withid: 'shop'. Unknown ids are still type errors. At runtime, a#target can name a whole implicit id below a state with an explicit id, such as'#wizard.step'whenwizardhasid: 'flow'.ceeebb0:
enq.spawn(...)returns an inert actor ref while a transition is only evaluated, such as bysnapshot.can(event)or when resolving conflicting transitions in parallel states. The ref has theid(and, when the parent is known, theaddress) the real spawn would get, anundefinedsessionId, a stablegetSnapshot(), a no-opsend(), andtoJSON()returning{ $actor: address }. Previously it was a bare{ id }object.ceeebb0:
createActor(machine, { snapshot })reports a persisted snapshot that cannot represent a state as an'error'snapshot with anInvalidSnapshotError, instead of starting an unusable actor. This covers snapshots that are not objects, have novalueor an invalid one (not a state name or an object of state values, or several active children of a non-parallel state), and values naming states the machine does not have. Unknown fields are still ignored.73b2edf: Fix several v6 alpha transition, typing, and inspection issues:
enqcalls intry/catch, and avoid reevaluating ordinary effect-only transitions during selection.unknownoranyinput.causewhen graph transition evaluation fails. Supply representative payloads through the graph traversaleventsoption when transition functions require them.05f1e0f: Ship version-matched XState v6 documentation with the xstate package. Start with README.md or docs/index.md after installation for v6 examples and migration guidance.
8773a22: Require payload samples for known event types with required fields in
getShortestPaths,getSimplePaths, andgetAdjacencyMap. Use aneventsmap to explore multiple payloads while retaining default payload-free events, invoke completions, errors, and delays:Each map entry also accepts a snapshot callback returning nonempty payload cases. Event arrays and callbacks returning events still replace defaults, but their types must cover every required payload event. Fixed-sequence replay with
getPathsFromEventsrequires only the supplied events. Coverage remains sample-based.Unconfigured wildcard descriptors retain their default samples alongside concrete event cases. Use an event array to restrict traversal to supplied concrete events.
@xstate/effect@1.0.0-alpha.9
Major Changes
ceeebb0:
taggedState(...)tags a root parallel state with the machineidinstead of'(machine)', or with''when the machine has no id.TaggedStateandStateTagtype the tag the same way.@xstate/test@2.0.0-alpha.4
Major Changes
5b6df81:
@xstate/test/effect-schemanow requires stable Effect 4 (effect@^4.0.0).fromEffectSchema()builds fast-check arbitraries from the schema's AST. It supports primitives, literals, enums, unions, arrays, tuples, structs with optional properties, records with string keys, and refinements. Unsupported nodes such asSchema.Datethrow an error naming the node. Passoverrideto supply an arbitrary for them:5b6df81: The
@xstate/testentry point no longer exports the internal typesPropertyExecutionConfigandPropertyTargetObservation.The
vitestpeer dependency now accepts Vitest 3 and Vitest 4.@xstate/codemod@0.1.0-alpha.4
Minor Changes
39d3b5c: Added the
report-id-path-targetstransform. It reports, without rewriting,#a.btargets andmatches('#a.b')orstateIn('#a.b')arguments that are not whole state ids of the machine config that contains them (references outside a machine config are always reported), since v6 resolves#targets by exact id only.Patch Changes
xstate-codemod migraterenamesActorRefFromLogicimports and usages toActorRefFrom.@xstate/react@7.0.0-alpha.6
Patch Changes
5b6df81:
xstateis now a required peer dependency of@xstate/react,@xstate/vue,@xstate/svelte, and@xstate/solid. Package managers now warn whenxstateis missing instead of letting the adapter fail at runtime.useActorRef(),useActor(), anduseMachine()in@xstate/reactno longer write implementations provided on a later render onto the machine passed on the first render. A module-level machine shared by several components keeps its own implementations:@xstate/scxml@1.0.0-alpha.3
Patch Changes
done.invoke.<id>anddone.state.<id>transitions now matchxstate.done.actorandxstate.done.stateevents by theiractorIdandstateId. Behavior is unchanged for SCXML documents.namecreates a machine without anid(machine.idis'') instead of one named(machine), matchingcreateMachine. The_namesystem variable is''for such documents.@xstate/solid@3.0.0-alpha.3
Patch Changes
5b6df81:
xstateis now a required peer dependency of@xstate/react,@xstate/vue,@xstate/svelte, and@xstate/solid. Package managers now warn whenxstateis missing instead of letting the adapter fail at runtime.useActorRef(),useActor(), anduseMachine()in@xstate/reactno longer write implementations provided on a later render onto the machine passed on the first render. A module-level machine shared by several components keeps its own implementations:@xstate/svelte@6.0.0-alpha.4
Patch Changes
5b6df81:
xstateis now a required peer dependency of@xstate/react,@xstate/vue,@xstate/svelte, and@xstate/solid. Package managers now warn whenxstateis missing instead of letting the adapter fail at runtime.useActorRef(),useActor(), anduseMachine()in@xstate/reactno longer write implementations provided on a later render onto the machine passed on the first render. A module-level machine shared by several components keeps its own implementations:@xstate/vue@6.0.0-alpha.4
Patch Changes
5b6df81:
xstateis now a required peer dependency of@xstate/react,@xstate/vue,@xstate/svelte, and@xstate/solid. Package managers now warn whenxstateis missing instead of letting the adapter fail at runtime.useActorRef(),useActor(), anduseMachine()in@xstate/reactno longer write implementations provided on a later render onto the machine passed on the first render. A module-level machine shared by several components keeps its own implementations: