# xstate/release
XState @xstate/codemod@0.1.0-beta.1
importance: highmigrationfeatureprerelease
This prerelease expands the XState codemod with migration transforms and reports for v5-to-v6 changes, including action shapes, lifecycle event keys, and ignored machine implementations. It also adds JSON migration reporting and commands to record and compare machine behavior, alongside updates for xstate@6.0.0-beta.1.
affected
XState users migrating machines from v5 to v6 can use the new transforms and behavior-comparison commands to automate supported changes and identify manual work.
action
For v5-to-v6 migrations, try the new `baseline`, `migrate --json`, and `verify` workflow and review any reported manual sites.
release_signals
+Added `migrate --json` to emit a JSON report, including manual migration sites and details; exits with code 2 when manual migration is needed.
+Added report transforms for suffixed lifecycle events, unsupported action/transition shapes, second `createMachine` arguments, and v5 inspection event type strings.
+Added `lower-actions` to rewrite supported v5 action and guard patterns into v6 functions, and to convert object-literal machine implementations and `fromPromise(fn)`.
+Expanded `types-to-schemas` to convert per-key `types` declarations and derive event schemas from same-file type aliases.
+Added `baseline` and `verify` commands to record v5 behavior traces and replay them against v6, with input support and simulated time/random values.
migration_steps1 steps
- 01Use `baseline` to record a v5 behavior trace, run `migrate --json`, address reported `manualSites`, then use `verify` to compare the migrated module against the baseline.
code_snippet
// before
on: { INC: { target: 'active', guard: 'canInc', actions: assign({ count: ({ context }) => context.count + 1 }) } }
// after
on: {
INC: (args) => {
if (!args.guards.canInc(args)) return;
return { target: 'active', context: { count: args.context.count + 1 } };
}
}# community_signal
How useful is this release to your stack?
—
net score
Sign in with GitHub to cast your vote.
Sign in with GitHub to vote
You’ll return to this release, then choose your vote.