Packages

xstate

5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed

Your version

5.24.0

3 Nov 2025Where it was published

5.33.4 is the newest release of 5.x.

In short

1 new

Release note

Minor Changes

  • Add setup.extend() method to incrementally extend machine setup configurations with additional actions, guards, and delays. This enables composable and reusable machine setups where extended actions, guards, and delays can reference base actions, guards, and delays and support chaining multiple extensions:

    import { setup, not, and } from 'xstate';
    
    const baseSetup = setup({
      guards: {
        isAuthenticated: () => true,
        hasPermission: () => false
      }
    });
    
    const extendedSetup = baseSetup.extend({
      guards: {
        // Type-safe guard references
        isUnauthenticated: not('isAuthenticated'),
        canAccess: and(['isAuthenticated', 'hasPermission'])
      }
    });
    
    // Both base and extended guards are available
    extendedSetup.createMachine({
      on: {
        LOGIN: {
          guard: 'isAuthenticated',
          target: 'authenticated'
        },
        LOGOUT: {
          guard: 'isUnauthenticated',
          target: 'unauthenticated'
        }
      }
    });

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.