Skip to content

fix(scxml): preserve transition phases and script snapshots - #5819

Merged
davidkpiano merged 1 commit into
nextfrom
feature/scxml-beta-contract
Oct 20, 2026
Merged

davidkpiano merged 1 commit into
nextfrom
feature/scxml-beta-contract

Conversation

@davidkpiano

@davidkpiano davidkpiano commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Why

Imported SCXML could run transition content after ancestor entry, repeat content across parallel regions, or execute scripts during snapshot.can(...). Scripts that mutate declared arrays also failed on frozen development snapshots.

What changed

  • Execute selected transition content once after exits and before entry, with the correct In(...) state configuration.
  • Preserve earlier snapshots when scripts mutate arrays or plain objects.
  • Document intentional native XState differences and add paired lifecycle coverage.

Scope

SCXML execution, a private core hook, documentation, and regression tests. Native transition semantics stay unchanged.

Blast Radius

The core hook runs only for imported SCXML machines. The Changeset covers both packages so their release stays compatible.

Verification

  • Thirteen new tests pass. Eight fail against the previous runtime.
  • pnpm test --silent --maxWorkers=1 passes all 272 files and 4,520 tests. Parallel runs hit the existing declaration setup's 30-second timeout; all 20 declaration tests also pass alone.
  • Typecheck, lint, formatting, and build pass.
  • Packed-consumer declaration and runtime checks pass. Independent review found no actionable issues.

Devin Review

@changeset-bot

changeset-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6f8d1f7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@xstate/scxml Patch
xstate Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2e8d8a6d-60d9-402b-9954-4ac521694623

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

Comment thread packages/core/src/stateUtils.ts
@davidkpiano
davidkpiano merged commit 29ead0b into next Oct 20, 2026
4 checks passed
@davidkpiano
davidkpiano deleted the feature/scxml-beta-contract branch October 20, 2026 09: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