github statelyai/xstate xstate@5.0.0-beta.35

latest releases: xstate@5.13.1, @xstate/store@0.0.5, @xstate/graph@2.0.0...
pre-release7 months ago

Major Changes

  • #4363 3513280db Thanks @Andarist! - Removed the ability to target deep descendants with the initial property.

  • #4363 3513280db Thanks @Andarist! - Removed the ability to target multiple descendants with the initial property.

  • #4216 04cad53e0 Thanks @Andarist! - Removed the ability to define delayed transitions using an array. Only object variant is supported now:

    createMachine({
      initial: 'a',
      states: {
        a: {
          after: {
            10000: 'b',
            noon: 'c'
          }
        }
        // ...
      }
    });
  • #3921 0ca1b860c Thanks @davidkpiano! - Spawned actors that have a referenced source (not inline) can be deeply persisted and restored:

    const machine = createMachine({
      context: ({ spawn }) => ({
        // This will be persisted
        ref: spawn('reducer', { id: 'child' })
    
        // This cannot be persisted:
        // ref: spawn(fromTransition((s) => s, { count: 42 }), { id: 'child' })
      })
    }).provide({
      actors: {
        reducer: fromTransition((s) => s, { count: 42 })
      }
    });

Minor Changes

  • #4358 03ac5c013 Thanks @Andarist! - xstate.done.state.* events will now be generated recursively for all parallel states on the ancestors path.

Patch Changes

  • #4361 1a00b5a54 Thanks @Andarist! - Fixed a runtime crash related to machines with their root state's type being final (createMachine({ type: 'final' })).

  • #4357 84c46c1ae Thanks @Andarist! - Fixed an issue with not all actions of initial transitions resolving to the initial state of the machine itself being executed.

  • #4356 81b6edafd Thanks @Andarist! - Fixed an issue with actions of initial transitions being called too many times.

Don't miss a new xstate release

NewReleases is sending notifications on new releases.