Packages

xstate

5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed

Your version

5.7.0

16 Feb 2024Where it was published

5.33.4 is the newest release of 5.x.

In short

2 new

Release note

Minor Changes

  • An error will now be thrown if an incompatible state value is passed to machine.resolveState({ value }).

  • You can now inspect microsteps (@xstate.microstep) and actions (@xstate.action):

    const machine = createMachine({
      initial: 'a',
      states: {
        a: {
          on: {
            event: 'b'
          }
        },
        b: {
          entry: 'someAction',
          always: 'c'
        },
        c: {}
      }
    });
    
    const actor = createActor(machine, {
      inspect: (inspEvent) => {
        if (inspEvent.type === '@xstate.microstep') {
          console.log(inspEvent.snapshot);
          // logs:
          // { value: 'a', … }
          // { value: 'b', … }
          // { value: 'c', … }
    
          console.log(inspEvent.event);
          // logs:
          // { type: 'event', … }
        } else if (inspEvent.type === '@xstate.action') {
          console.log(inspEvent.action);
          // logs:
          // { type: 'someAction', … }
        }
      }
    });
    
    actor.start();
    
    actor.send({ type: 'event' });

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.