diff --git a/.changeset/blue-ladybugs-retire.md b/.changeset/blue-ladybugs-retire.md deleted file mode 100644 index 26e62273da..0000000000 --- a/.changeset/blue-ladybugs-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'xstate': patch ---- - -The return type of `spawn(machine)` will now be `Actor, TEvent>`, which is a supertype of `Interpreter<...>`. diff --git a/.changeset/chatty-wombats-worry.md b/.changeset/chatty-wombats-worry.md deleted file mode 100644 index b4bfd5bf43..0000000000 --- a/.changeset/chatty-wombats-worry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'xstate': patch ---- - -Exit actions will now be properly called when an invoked machine reaches its final state. See [#1109](https://github.com/davidkpiano/xstate/issues/1109) for more details. diff --git a/.changeset/cyan-pants-walk.md b/.changeset/cyan-pants-walk.md deleted file mode 100644 index e2cc0a975d..0000000000 --- a/.changeset/cyan-pants-walk.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'xstate': minor ---- - -Expressions can now be used in the `stop()` action creator: - -```js -// ... -actions: stop((context) => context.someActor); -``` diff --git a/.changeset/funny-spiders-push.md b/.changeset/funny-spiders-push.md deleted file mode 100644 index 87808e40d8..0000000000 --- a/.changeset/funny-spiders-push.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'xstate': patch ---- - -The `state.children` property now properly shows all spawned and invoked actors. See [#795](https://github.com/davidkpiano/xstate/issues/795) for more details. diff --git a/.changeset/khaki-rivers-move.md b/.changeset/khaki-rivers-move.md deleted file mode 100644 index 22f49699b4..0000000000 --- a/.changeset/khaki-rivers-move.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xstate/react': patch ---- - -The `send` function returned from the `useService()` now can take two arguments (an event type and payload), to match the behavior of `@xstate/react` version 0.x. diff --git a/.changeset/lemon-rings-kick.md b/.changeset/lemon-rings-kick.md deleted file mode 100644 index be590016ca..0000000000 --- a/.changeset/lemon-rings-kick.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@xstate/react': patch ---- - -The `send` value returned from the `useService()` hook will now accept a payload, which matches the signature of the `send` value returned from the `useMachine()` hook: - -```js -const [state, send] = useService(someService); - -// ... - -// this is OK: -send('ADD', { value: 3 }); - -// which is equivalent to: -send({ type: 'ADD', value: 3 }); -``` diff --git a/.changeset/light-colts-kiss.md b/.changeset/light-colts-kiss.md deleted file mode 100644 index 4dbaa30a6d..0000000000 --- a/.changeset/light-colts-kiss.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xstate/react': patch ---- - -Fixed an issue with internal `setState` in `useService` being called with 2 arguments instead of 1. diff --git a/.changeset/poor-flowers-end.md b/.changeset/poor-flowers-end.md deleted file mode 100644 index e89e3aa154..0000000000 --- a/.changeset/poor-flowers-end.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'xstate': patch ---- - -Added `status` property on the `Interpreter` - this can be used to differentiate not started, running and stopped interpreters. This property is best compared to values on the new `InterpreterStatus` export. diff --git a/.changeset/thin-papayas-wait.md b/.changeset/thin-papayas-wait.md deleted file mode 100644 index dbdb86ad7a..0000000000 --- a/.changeset/thin-papayas-wait.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xstate/inspect': minor ---- - -The `@xstate/inspect` package is now built with Rollup which has fixed an issue with TypeScript compiler inserting references to `this` in the top-level scope of the output modules and thus making it harder for some tools (like Rollup) to re-bundle dist files as `this` in modules (as they are always in strict mode) is `undefined`. diff --git a/.changeset/thin-teachers-approve.md b/.changeset/thin-teachers-approve.md deleted file mode 100644 index 14643a73e2..0000000000 --- a/.changeset/thin-teachers-approve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@xstate/react': patch ---- - -Fixed issue with `useService` returning an initial state for services in their final states. diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index d591739b26..20f9a37941 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,26 @@ # xstate +## 4.14.0 + +### Minor Changes + +- [`119db8fb`](https://github.com/davidkpiano/xstate/commit/119db8fbccd08f899e1275a502d8c4c51b5a130e) [#1577](https://github.com/davidkpiano/xstate/pull/1577) Thanks [@davidkpiano](https://github.com/davidkpiano)! - Expressions can now be used in the `stop()` action creator: + + ```js + // ... + actions: stop(context => context.someActor); + ``` + +### Patch Changes + +- [`8c78e120`](https://github.com/davidkpiano/xstate/commit/8c78e1205a729d933e30db01cd4260d82352a9be) [#1570](https://github.com/davidkpiano/xstate/pull/1570) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The return type of `spawn(machine)` will now be `Actor, TEvent>`, which is a supertype of `Interpreter<...>`. + +* [`602687c2`](https://github.com/davidkpiano/xstate/commit/602687c235c56cca552c2d5a9d78adf224f522d8) [#1566](https://github.com/davidkpiano/xstate/pull/1566) Thanks [@davidkpiano](https://github.com/davidkpiano)! - Exit actions will now be properly called when an invoked machine reaches its final state. See [#1109](https://github.com/davidkpiano/xstate/issues/1109) for more details. + +- [`6e44d02a`](https://github.com/davidkpiano/xstate/commit/6e44d02ad03af4041046120dd6c975e3b5b3772a) [#1553](https://github.com/davidkpiano/xstate/pull/1553) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `state.children` property now properly shows all spawned and invoked actors. See [#795](https://github.com/davidkpiano/xstate/issues/795) for more details. + +* [`72b0880e`](https://github.com/davidkpiano/xstate/commit/72b0880e6444ae009adca72088872bb5c0760ce3) [#1504](https://github.com/davidkpiano/xstate/pull/1504) Thanks [@Andarist](https://github.com/Andarist)! - Added `status` property on the `Interpreter` - this can be used to differentiate not started, running and stopped interpreters. This property is best compared to values on the new `InterpreterStatus` export. + ## 4.13.0 ### Minor Changes diff --git a/packages/core/package.json b/packages/core/package.json index cf9f9f70b4..19464dc958 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "xstate", - "version": "4.13.0", + "version": "4.14.0", "description": "Finite State Machines and Statecharts for the Modern Web.", "main": "lib/index.js", "module": "es/index.js", diff --git a/packages/xstate-inspect/CHANGELOG.md b/packages/xstate-inspect/CHANGELOG.md new file mode 100644 index 0000000000..7bac910d32 --- /dev/null +++ b/packages/xstate-inspect/CHANGELOG.md @@ -0,0 +1,8 @@ +# @xstate/inspect + +## 0.2.0 +### Minor Changes + + + +- [`1725333a`](https://github.com/davidkpiano/xstate/commit/1725333a6edcc5c1e178228aa869c907d3907be5) [#1599](https://github.com/davidkpiano/xstate/pull/1599) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `@xstate/inspect` package is now built with Rollup which has fixed an issue with TypeScript compiler inserting references to `this` in the top-level scope of the output modules and thus making it harder for some tools (like Rollup) to re-bundle dist files as `this` in modules (as they are always in strict mode) is `undefined`. diff --git a/packages/xstate-inspect/package.json b/packages/xstate-inspect/package.json index b2e3d7e50f..edd78f550b 100644 --- a/packages/xstate-inspect/package.json +++ b/packages/xstate-inspect/package.json @@ -1,6 +1,6 @@ { "name": "@xstate/inspect", - "version": "0.1.1", + "version": "0.2.0", "description": "XState inspection utilities", "keywords": [ "state", diff --git a/packages/xstate-react/CHANGELOG.md b/packages/xstate-react/CHANGELOG.md index 13b8167ee3..fbd8a26641 100644 --- a/packages/xstate-react/CHANGELOG.md +++ b/packages/xstate-react/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 1.0.2 + +### Patch Changes + +- [`c7927083`](https://github.com/davidkpiano/xstate/commit/c7927083a651e3c51952ade2ffda793df0391bf6) [#1516](https://github.com/davidkpiano/xstate/pull/1516) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `send` function returned from the `useService()` now can take two arguments (an event type and payload), to match the behavior of `@xstate/react` version 0.x. + +* [`db77623a`](https://github.com/davidkpiano/xstate/commit/db77623a48955d762cffa9b624f438220add5eed) [#1516](https://github.com/davidkpiano/xstate/pull/1516) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `send` value returned from the `useService()` hook will now accept a payload, which matches the signature of the `send` value returned from the `useMachine()` hook: + + ```js + const [state, send] = useService(someService); + + // ... + + // this is OK: + send('ADD', { value: 3 }); + + // which is equivalent to: + send({ type: 'ADD', value: 3 }); + ``` + +- [`93f6db02`](https://github.com/davidkpiano/xstate/commit/93f6db02a2d56ec997198ddef0af3d7730bb79bb) [#1594](https://github.com/davidkpiano/xstate/pull/1594) Thanks [@Andarist](https://github.com/Andarist)! - Fixed an issue with internal `setState` in `useService` being called with 2 arguments instead of 1. + +* [`72b0880e`](https://github.com/davidkpiano/xstate/commit/72b0880e6444ae009adca72088872bb5c0760ce3) [#1504](https://github.com/davidkpiano/xstate/pull/1504) Thanks [@Andarist](https://github.com/Andarist)! - Fixed issue with `useService` returning an initial state for services in their final states. + ## 1.0.1 ### Patch Changes @@ -25,7 +49,7 @@ All notable changes to this project will be documented in this file. - The `useActor` hook now takes a second argument: `getSnapshot` which is a function that should return the last emitted value: ```js - const [state, send] = useActor(someActor, (actor) => actor.current); + const [state, send] = useActor(someActor, actor => actor.current); ``` ## [1.0.0-rc.6] diff --git a/packages/xstate-react/package.json b/packages/xstate-react/package.json index d7c9e481b1..33642ec3d3 100644 --- a/packages/xstate-react/package.json +++ b/packages/xstate-react/package.json @@ -1,6 +1,6 @@ { "name": "@xstate/react", - "version": "1.0.1", + "version": "1.0.2", "description": "XState tools for React", "keywords": [ "state", diff --git a/packages/xstate-scxml/package.json b/packages/xstate-scxml/package.json index 8f622b1525..d9c273301d 100644 --- a/packages/xstate-scxml/package.json +++ b/packages/xstate-scxml/package.json @@ -35,7 +35,7 @@ }, "dependencies": { "xml-js": "^1.6.11", - "xstate": "^4.13.0" + "xstate": "^4.14.0" }, "devDependencies": { "@scion-scxml/test-framework": "^2.0.15", diff --git a/packages/xstate-viz/example/package.json b/packages/xstate-viz/example/package.json index 304c77383a..0fa719ee52 100644 --- a/packages/xstate-viz/example/package.json +++ b/packages/xstate-viz/example/package.json @@ -9,7 +9,7 @@ "build": "parcel build index.html" }, "dependencies": { - "@xstate/react": "^1.0.0", + "@xstate/react": "^1.0.2", "react-app-polyfill": "^1.0.0" }, "devDependencies": {