Skip to content

@xstate/codemod@0.1.0-alpha.3

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Oct 14:34
· 15 commits to main since this release
862798a

Minor Changes

  • d2c518b: Public names are consistent before the beta. The old names are not kept as aliases.

    Before After
    serializeMachine(machine) machineToJSON(machine) (returns MachineJSON)
    createMachineFromConfig(json, sources) machineFromJSON(json, sources)
    createLogic createStepLogic
    LogicActorLogic, LogicActorRef, LogicSnapshot StepActorLogic, StepActorRef, StepSnapshot
    LogicConfig, LogicArgs, LogicEnqueue, LogicFunction StepLogicConfig, StepLogicArgs, StepLogicEnqueue, StepLogicFunction
    LogicPatch, LogicEffectState StepPatch, StepEffectState
    LogicEffect ExecutableEffect
    EffectDescriptor, getEffectDescriptor ExecutableEffectDescriptor, describeExecutableEffect
    checkStateIn(snapshot, value) snapshot.matches(value)
    state node contextSchema state node schemas: { context }
    StrictSetupStateTargetsFlag, StrictSetupStateTargetsMarker StrictSetupStateTargetsMarker, StrictSetupStateMarkers

    machineConfigToJSON(config) is unchanged and now returns MachineJSON.

    Removed exports: listenerLogic, subscriptionLogic (use createListenerLogic()/createSubscriptionLogic()), __unsafe_getAllOwnEventDescriptors (use getAllOwnEvents from xstate/graph), toObserver, pathToStateValue, SpecialTargets, and the devTools actor option type.

    The report-removed-apis codemod reports toObserver, pathToStateValue and SpecialTargets, and its stateIn hint suggests snapshot.matches(...).

    - import { createLogic, serializeMachine } from 'xstate';
    + import { createStepLogic, machineToJSON } from 'xstate';