Skip to content

Version Packages - #238

Merged
SandroMaglione merged 1 commit into
mainfrom
changeset-release/main
Oct 22, 2026
Merged

SandroMaglione merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@typeonce/effect-machine@0.42.0

Minor Changes

  • 4e9d412: Deliver send and stop writes made while an atom machine is still starting. Writes to MachineAtom.send, MachineAtom.stop, ChildMachineAtom.send and ChildMachineAtom.stop before readiness are now held and delivered in write order once the machine is ready, instead of being dropped. The write result stays waiting until delivery and fails with the startup error if startup fails. Writes after the machine stopped still fail with StoppedError, and child writes still fail with ChildNotActiveError when the owning state is inactive.

    NotReadyError is removed from AtomMachine and from the send and stop failure types. Remove any handling of it.

    Add AtomMachine.MachineAtom.Any and AtomMachine.ChildMachineAtom.Any for code that accepts any bridge, including bridges for machines without events, and the MachineAtom.State, MachineAtom.Event and ChildMachineAtom.State extractors:

    type Bridge = AtomMachine.MachineAtom.Any;
    type State = AtomMachine.MachineAtom.State<typeof CounterMachineAtom>;
    type Event = AtomMachine.MachineAtom.Event<typeof CounterMachineAtom>;
  • 36b1c0a: ChildAlreadyExistsError now appears in a machine's error type only for invocations whose child id you choose: logic invocations with an address and Machine.child invocations. Effect, Stream, and timer invocations run under runtime-owned ids and cannot collide, so a machine that only invokes them no longer carries ChildAlreadyExistsError in Machine.Error. Invocation ids within one state must be distinct; a repeated source without distinct ids or a reused id is now a type error and is rejected when the machine is constructed.

    A parent that invokes a fixed child through children now needs onFailure exactly when the child's own error type is reachable. Remove onFailure: { none: true } handlers that only swallowed ChildAlreadyExistsError; they are now rejected as unreachable, like an unreachable onDone.

    Constraint failures now explain themselves instead of reporting never. Starting, resuming, preparing, or planning a machine with a required parent reports Machine declares a required parent and cannot run as a root, and an unreachable onDone, onFailure, onElement, or onSnapshot names the channel and source, for example Invocation 'forever' never completes, so onDone is unreachable.

  • 71d41b9: Bind started machines to the caller's Scope.

    Machine.start, Machine.resume, and prepared.start now require Scope.Scope, like Effect.forkScoped. Closing that scope is equivalent to ref.stop: active invocations are interrupted, owned children stop, the snapshot becomes stopped, and later sends fail with StoppedError. A machine that stops or completes earlier releases its place in the scope, so long-lived scopes do not accumulate finalizers. For prepared.start, the scope that first evaluates it owns the machine. AtomMachine is unaffected.

    Wrap programs that start machines in Effect.scoped, or own a scope explicitly when a machine must outlive the caller:

    const program = Effect.scoped(
      Effect.gen(function* () {
        const ref = yield* Machine.start(machine);
        yield* ref.send(Events.Go());
      })
    );
    
    const detached = Effect.gen(function* () {
      const scope = yield* Scope.make();
      return yield* Machine.start(machine).pipe(Scope.provide(scope));
    });
  • 5eda754: Reading an AtomMachine bridge on the server no longer starts the machine. Every bridge atom now has an Effect Atom server value, so Atom.getServerValue and the server render of @effect/atom-react hooks return the machine's planned startup state without running startup commands, invocations, or services.

    result serves Success(state) and snapshot serves Success({ status: "active", state }), both waiting, where state is the state Machine.planInitial settles into with the bridge's input. select, selectSnapshot, matches, can, and family projections serve the same projection of that state. child(Child) serves the planned child state when the planned parent state invokes Child, and Option.none() otherwise. ref, send, and stop serve Initial, as does every atom of a bridge whose startup state cannot be planned synchronously. Resumed bridges serve their resumed snapshot.

  • edebb70: A transition that combines target and update can now enter a choice state. The owner is updated first, so the choice resolver reads the new value through containingState, ancestors, or root before the chosen branch is entered. With a choice target, data constructs only the owner value:

    Idle: {
      on: { Bump: { target: "Route", update: "root", data: ({ root }) => ({ count: root.count + 1 }) } }
    }

    A declared branch group can declare the same pair and select it with select.route({ update: { data } }). Every branch the choice can reach, including through nested choices, must stay below the updated owner: an escaping branch is a type error such as Choice 'Route' branch 'out' targets 'Outside' outside the updated owner 'Flow', and handle rejects it at construction.

@typeonce/effect-machine-react@0.42.0

Minor Changes

  • 5eda754: MachineState no longer suspends. Server rendering and hydration render the machine's planned startup snapshot, and the same tree then receives live snapshots, so hydrated form inputs keep their DOM nodes, typed text, and focus. Remove Suspense boundaries that only wrapped MachineState for its first paint.

    Add the optional pending prop, rendered until the machine has a snapshot. Once a snapshot has rendered, MachineState keeps it while the machine is still starting, for example while a bound runtime layer builds after hydration:

    <MachineState machine={machine} path="Editing" pending={<Spinner />}>
      {(editing) => <input value={editing.value.email} onChange={onChange} />}
    </MachineState>

Patch Changes

  • Updated dependencies [4e9d412]
  • Updated dependencies [36b1c0a]
  • Updated dependencies [71d41b9]
  • Updated dependencies [5eda754]
  • Updated dependencies [edebb70]
    • @typeonce/effect-machine@0.42.0

@typeonce/oxlint-plugin-effect-machine@0.42.0

Minor Changes

  • 14e1f39: Add the recommended effect-machine/no-conditional-none-branch rule.

    A { none: true } branch accepts its event, so Machine.can and AtomMachine.can return true when a resolver selects it. The rule reports a resolver that selects a none branch conditionally without declinable: true. When the event must be refused, for example to disable a control, decline it instead:

    Submitted: {
      branches: "submit",
      declinable: true,
      resolve: ({ state, select, decline }) => state.complete ? select.review() : decline()
    }

@typeonce/effect-machine-devtools@0.42.0

Patch Changes

  • Updated dependencies [4e9d412]
  • Updated dependencies [36b1c0a]
  • Updated dependencies [71d41b9]
  • Updated dependencies [5eda754]
  • Updated dependencies [edebb70]
    • @typeonce/effect-machine@0.42.0

@github-actions
github-actions Bot force-pushed the changeset-release/main branch 4 times, most recently from 8d4d3a0 to 95a2c6f Compare October 22, 2026 10:48
@github-actions
github-actions Bot force-pushed the changeset-release/main branch from 95a2c6f to 1ea34a3 Compare October 22, 2026 10:57
@SandroMaglione
SandroMaglione merged commit c42696f into main Oct 22, 2026
9 checks passed
@SandroMaglione
SandroMaglione deleted the changeset-release/main branch October 22, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant