xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
4.38.3 is the newest release of 4.x.
In short
7 fixed
Release note
Patch Changes
Fixed an issue with event type being inferred from too many places within
createMachinecall and possibly ending up asany/AnyEventObjectfor the entire machine.Fixed compatibility with esoteric Mini Program environment where
globalobject was available butglobal.consolewasn't.Fixed an issue with interpreters started using a persisted state not being "resolved" in full. This could cause some things, such as
aftertransitions, not being executed correctly after starting an interpreter like this.Fixed a TS inference issue causing some functions to infer the constraint type for the event type even though a
StateMachinepassed to the function was parametrized with a concrete type for the event. More information can be found here.Fixed compatibility of
Interpreterwith older versions of TypeScript. This ensures that our interpreters can correctly be consumed by functions expectingActorRefinterface (like for exampleuseSelector).InterpreterFromandActorRefFromtypes used on machines with typegen data should now correctly return types with final/resolved typegen data. The "final" type here means a type that already encodes the information that all required implementations have been provided. Before this change this wouldn't typecheck correctly:const machine = createMachine({ // this encodes that we still expect `myAction` to be provided tsTypes: {} as Typegen0 }); const service: InterpreterFrom<typeof machine> = machine.withConfig({ actions: { myAction: () => {} } });State that is persisted and restored from
machine.resolveState(state)will now have the correctstate.machinevalue, so thatstate.can(...)and other methods will work as expected. See #3096 for more details.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.