6.0.0-alpha.3Pre-release
Added 1
- Expose machine.schemas as a public runtime-readable schema contract
Changed 1
- Serialize function implementations as portable code expressions in guards, actions, delays, and inline machine config
Minor Changes
-
#44
0a883adThanks @pull! - Exposemachine.schemasas 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
d95287bThanks @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
$unserializablemarkers.