Skip to content

Conversation

oscarmarina
Copy link

Hi!

I'm closing the previous, outdated PR 4775 and have updated everything to use Vite and Vitest.

To make review and integration easier, I’ve split the work into two PRs:

  • This one adds the new @xstate/lit package.
  • The next one adds the template example that uses this package.

Main idea:
This adds compatibility for linking XState with Lit.

Motivation:
XState’s state machines provide a structured, predictable approach to complex logic, while Lit enables reactive UI updates in response to state changes. Combining both allows for robust and maintainable architectures for web components.


The implementation is stable and production-ready. If maintaining Lit-specific code isn't a priority for the team, feel free to close this PR. Thank you!

Copy link

changeset-bot bot commented Jul 27, 2025

🦋 Changeset detected

Latest commit: 567c7f7

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

This PR includes changesets to release 7 packages
Name Type
@xstate/lit Major
xstate Minor
@xstate/react Major
@xstate/solid Major
@xstate/store Minor
@xstate/svelte Major
@xstate/vue Major

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

@oscarmarina
Copy link
Author

A related PR with the templates can be found here: #5341

});
}

private get turn() {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can we rename this to canTurn?

Copy link
Member

Choose a reason for hiding this comment

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

Or turnedOff?

Copy link
Author

Choose a reason for hiding this comment

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

Changed to turnedOff, more descriptive and clearer logic 👌

@davidkpiano davidkpiano requested a review from Andarist July 29, 2025 12:08
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.

2 participants