XState creator: statically analyze plain code instead of forcing a DSL

DavidKPiano · x · 2026-10-14

XState creator David Khourshid explains why it matters to build tooling that statically analyzes normal code rather than forcing it into a DSL, so the tools work in any codebase regardless of XState adoption.

The motivation is better type safety with less "DSL ceremony": if/else branches narrow types for context/events and carry through to actions inside transitions, which declarative guards cannot do; conditional and dynamic actions become plain JS with no helper functions needed. The analysis has come far—if transition code isn't analyzable by the tools, it's likely too complicated to work in the DSL anyway.

Related event: XState v6 Embraces Plain Functions: Author Explains the Trade-offs(2 posts)→

Original post →

More from coding & agent

coding & agent channel →