Major Changes
-
3cbcc3f: Serialized output no longer uses field names that start with
$or_. Stores such as Convex reject both prefixes, and MongoDB restricts$-prefixed field names, so persisted snapshots,systemTransitionsnapshots and effect descriptors could not be stored without rewriting them.Before After Where { $actor: address, incarnation }{ '@actor': address, incarnation }SerializedActorRef: persisted context,systemTransitionsnapshots, effect descriptors,sendTotargets, dead letters,@xstate/effectactortoJSON()_nextTimerIdnextTimerIdPersisted snapshots, systemTransitionsnapshots_nextActorIdsnextActorIdsPersisted snapshots, systemTransitionsnapshots_stateInputsstateInputssystemTransitionsnapshots (persisted snapshots already usedstateInputs){ $error: name, message }{ '@error': name, message }systemTransitionsnapshots,@xstate/testtraces{ $stateNode: id },{ $systemMapper: key }{ '@stateNode': id },{ '@systemMapper': key }systemTransitionsnapshots// Before { $actor: 'order/worker', incarnation: 'a:1' } // After { '@actor': 'order/worker', incarnation: 'a:1' }
snapshot.toJSON()no longer includes the private_nextTimerIdand_nextActorIdscounters.Snapshots written by
6.0.0-beta.1with the old field names still restore:restoreActor,restoreMachineSnapshotandsystemTransitionread both shapes. New snapshots use only the new names. Schemas that validate persisted snapshots (for example withmachineVersions) must use the new names.
Minor Changes
- bddb8a6: Export
sendAndAwaitfrom the main@xstate/effectentrypoint.@xstate/effect/teststill re-exports it for compatibility. Document its one-event acknowledgment boundary: the transition and immediate effects, without awaiting child replies or background work.
Patch Changes
-
d56483f:
createEffectActornow shows observers each step in the order thatcreateActoruses. The events that a transition emits come first. Then an active step givesnext, adonestep givesnextand thencomplete, and anerrorstep giveserror.joinresolves, and theemitted(actor)stream ends, after the events of the final transition.A
stop()that anonlistener or an observer calls synchronously while the actor delivers a step now runs when that step ends, as increateActor. Astop()from anywhere else still stops the actor at once. If the step ends the actor withdoneorerror, itssendAndAwaitreceipt now succeeds with that snapshot, also when a listener stopped the actor during the step. -
389a4a2: Preserve registered Effect action keys in transition descriptors so consumers can identify enqueued actions.