Packages

xstate

5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed

Your version

4.13.0

27 Aug 2020Where it was published

4.38.3 is the newest release of 4.x.

In short

4 fixed

Release note

Minor Changes

  • Fix type ExtractStateValue so that it generates a type actually describing a State.value

Patch Changes

  • Improved TypeScript type-checking performance a little bit by using distributive conditional type within TransitionsConfigArray declarations instead of a mapped type. Kudos to @amcasey, some discussion around this can be found here

  • Fixed an issue with not being able to run XState in Web Workers due to assuming that window or global object is available in the executing environment, but none of those are actually available in the Web Workers context.

  • Fixed an issue with spawned actors being spawned multiple times when they got spawned in an initial state of a child machine that is invoked in the initial state of a parent machine.

    Illustrating example for curious readers.

    const child = createMachine({
      initial: 'bar',
      context: {},
      states: {
        bar: {
          entry: assign({
            promise: () => {
              return spawn(() => Promise.resolve('answer'));
            }
          })
        }
      }
    });
    
    const parent = createMachine({
      initial: 'foo',
      states: {
        foo: {
          invoke: {
            src: child,
            onDone: 'end'
          }
        },
        end: { type: 'final' }
      }
    });
    
    interpret(parent).start();

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.