Release Notes

Minor Changes

  • #44 0a883ad Thanks @pull! - Expose machine.schemas as a public runtime-readable schema contract.

    const machine = createMachine({
      schemas: {
        context: z.object({ count: z.number() }),
        events: {
          inc: z.object({ by: z.number() })
        }
      },
      context: { count: 0 }
    });
    
    machine.schemas?.events?.inc;
    

Patch Changes

  • #44 d95287b Thanks @pull! - Serialize function implementations as portable code expressions.

    Functions in guards, actions, delays, and inline machine config now serialize as:

    { '@type': 'code', lang: 'ts', expr: '() => true' }
    

    Values that cannot be represented as code or JSON still serialize with explicit $unserializable markers.