Skip to content

Commit

Permalink
add changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Apr 4, 2022
1 parent 8823744 commit 360e854
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-oranges-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/react': patch
---

In v2 we have changed signatures of `useMachine` and `useInterpret`. Instead of accepting a list of generics they now only support a single generic: `TMachine`. This change, erroneously, was only introduced to types targeting [email protected] but the types targeting previous TS releases were still using the older signatures. This has now been fixed and users of older TS versions should now be able to leverage typegen with `@xstate/react`.
5 changes: 5 additions & 0 deletions .changeset/five-bikes-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/react': major
---

This package now accepts React 18 as a peer dep and the implementation has been rewritten to use [`use-sync-external-store`](https://www.npmjs.com/package/use-sync-external-store) package. This doesn't break compatibility with older versions of React since we are using the shim to keep compatibility with those older versions.
5 changes: 5 additions & 0 deletions .changeset/hungry-dryers-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'xstate': patch
---

Fixed issues with not disposing some cached internal values when stopping interpreters. This could lead to issues when starting such an interpreter again.
5 changes: 5 additions & 0 deletions .changeset/khaki-spoons-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/react': patch
---

`useMachine` for `xstate` now correctly rerenders with the initial state when the internal service is being restarted. This might happen during Fast Refresh and now you shouldn't be able to observe this stale state that didn't match the actual state of the service.
7 changes: 7 additions & 0 deletions .changeset/lovely-walls-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@xstate/react': major
---

`asEffect` and `asLayoutEffect` action creators were removed. They were not fitting the React model that well and could lead to issues as their existence suggested that they are easy to use.

To execute actions at those exact times you can always either just call your stuff directly from those effects or send events to the machine from those effects and execute explicit actions in response to said events.
5 changes: 5 additions & 0 deletions .changeset/moody-bobcats-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/fsm': major
---

`.start()` (when called without any argument) now always starts from the initial state of the machine. This matches the behavior of XState itself.
5 changes: 5 additions & 0 deletions .changeset/nervous-pets-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/react': patch
---

`useMachine` for `@xstate/fsm` now starts the service in an effect. This avoids side-effects in render and improves the compatibility with `StrictMode`.
5 changes: 5 additions & 0 deletions .changeset/rude-laws-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/react': major
---

The signatures of `useMachine` and `useService` integrating with `@xstate/fsm` were changed. They now only accept a single generic each (`TMachine` and `TService` respectively). This has been done to match their signatures with the related hooks that integrate with `xstate` itself.
5 changes: 5 additions & 0 deletions .changeset/thin-fishes-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/fsm': patch
---

A bunch of TypeScript helpers has been added: `AnyMachine`, `AnyService`, `ContextFrom`, `EventFrom`, `StateFrom` and `ServiceFrom`.
5 changes: 5 additions & 0 deletions .changeset/twenty-balloons-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/react': patch
---

Implementations given to `useMachine` targeting `@xstate/fsm` are now updated in a layout effect. This avoid some stale closure problems for actions that are executed in response to events sent from layout effects.

0 comments on commit 360e854

Please sign in to comment.