Skip to content

Debug and automate XState typegen #456

Closed

Description

@presleyp

As a developer, I want my XState machines to be easy to write and strongly typed, so I can code quickly and have fewer bugs.

XState typegen reduces the amount of boilerplate needed while increasing type safety by generating lots of type information for you. It can runs automatically if you have the XState VSCode plugin installed, but there is also a CLI which #435 will add a script for, so you can run it with yarn typegen. However, it's important that the generated types stay up to date, so we should have CI run typegen before checking for TypeScript errors.

Additionally, typegen is not working correctly in #435 and I'm still having to use some boilerplate. I'm breaking this ticket out in the interest of reducing conflicts by holding onto that PR for too long. I've asked for help on the Stately Discord and was asked to make a repro so this ticket entails:

  • make a sandbox and try to reproduce my typegen errors
  • debug
  • add a CI job

Activity

  1. misskniss commented on Apr 26, 2022

    @misskniss

    Closing this after a convo with Presley.

  2. added and removed
    siteArea: frontend dashboard
    on Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions