Skip to content

Version Packages (alpha) - #5674

Merged
davidkpiano merged 1 commit into
nextfrom
changeset-release/next
Aug 23, 2026
Merged

Version Packages (alpha)#5674
davidkpiano merged 1 commit into
nextfrom
changeset-release/next

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 23, 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 next, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

next is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on next.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

xstate@6.0.0-alpha.47

Minor Changes

  • 72938f8: Guard and delay source functions are now contextually typed from schemas — in setup({ ... }), .extend({ ... }), and createMachine({ ... }) — so inline functions get typed context and event without hand annotations:

    const s = setup({
      schemas: {
        context: z.object({ count: z.number() }),
        events: { INC: z.object({ by: z.number() }) }
      },
      guards: {
        // context: { count: number }, event: { type: 'INC'; by: number }
        isPositive: ({ context }) => context.count > 0,
        // additional params after the args object are free-form
        isAbove: ({ context }, threshold: number) => context.count > threshold
      },
      delays: {
        backoff: ({ context }) => context.count * 100
      }
    });

    Guard sources receive the transition args object first ({ context, event, self, parent, value, children }), followed by any caller-supplied params — matching how the runtime invokes referenced guards. Delay sources receive { context, event, stateNode }.

    Additionally, enq.stop(...), enq.listen(...), and enq.subscribeTo(...) now accept any ActorRef (such as values typed with ActorRefFrom<typeof machine>), instead of requiring the full actor instance type returned by enq.spawn(...).

Patch Changes

  • 6ecc2df: Document durable timer semantics for event-journal hosts.

  • fc7454f: Restoring an externally migrated live snapshot now treats its machine property as a runtime association rather than persisted version metadata. Persisted snapshots continue validating their nested { id, version } identity and legacy top-level version together.

    getNextTransitions(snapshot) returns an empty array for completed or errored snapshots.

    Setup-created machines whose input schema accepts undefined no longer require a meaningless input property when other actor options are provided, including after machine.provide(...).

    Durable adapters can implement enqueueRootEvent when the host owns only the execution root's mailbox, without overriding delivery for co-located actors:

    const durable = createDurable(machine, {
      enqueueRootEvent: (_source, event) => host.enqueue(event),
      executeAction,
      waitForEvent
    });

    Implement sendEvent only when the host owns routing for every target; use deliverEvent for co-located delivery. Durable replay guidance now explicitly covers inline entry and exit callbacks.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@github-actions
github-actions Bot force-pushed the changeset-release/next branch from a9ab989 to 06f6f55 Compare August 23, 2026 03:49
@github-actions
github-actions Bot force-pushed the changeset-release/next branch from 06f6f55 to 0b3a884 Compare August 23, 2026 03:50
@davidkpiano
davidkpiano merged commit 1e099f7 into next Aug 23, 2026
1 check passed
@davidkpiano
davidkpiano deleted the changeset-release/next branch August 23, 2026 12:55
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