From 26aabae404e98e5afd39085726d692a4e00b41ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:00:13 -0400 Subject: [PATCH] Version Packages (#5050) Co-authored-by: github-actions[bot] --- .changeset/mean-news-sell.md | 11 ---- .changeset/mean-peaches-decide.md | 24 --------- .changeset/pretty-chicken-lie.md | 5 -- .changeset/two-hounds-march.md | 63 ----------------------- packages/core/CHANGELOG.md | 76 ++++++++++++++++++++++++++++ packages/core/package.json | 2 +- packages/xstate-graph/package.json | 4 +- packages/xstate-immer/package.json | 4 +- packages/xstate-inspect/package.json | 4 +- packages/xstate-react/package.json | 4 +- packages/xstate-solid/package.json | 4 +- packages/xstate-store/CHANGELOG.md | 25 +++++++++ packages/xstate-store/package.json | 4 +- packages/xstate-svelte/package.json | 4 +- packages/xstate-vue/package.json | 4 +- 15 files changed, 118 insertions(+), 120 deletions(-) delete mode 100644 .changeset/mean-news-sell.md delete mode 100644 .changeset/mean-peaches-decide.md delete mode 100644 .changeset/pretty-chicken-lie.md delete mode 100644 .changeset/two-hounds-march.md diff --git a/.changeset/mean-news-sell.md b/.changeset/mean-news-sell.md deleted file mode 100644 index 3af9c6151f..0000000000 --- a/.changeset/mean-news-sell.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'xstate': patch ---- - -The `CallbackLogicFunction` type (previously `InvokeCallback`) is now exported. This is the callback function that you pass into `fromCallback(callbackLogicFn)` to create an actor from a callback function. - -```ts -import { type CallbackLogicFunction } from 'xstate'; - -// ... -``` diff --git a/.changeset/mean-peaches-decide.md b/.changeset/mean-peaches-decide.md deleted file mode 100644 index fe108bbfe4..0000000000 --- a/.changeset/mean-peaches-decide.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -'@xstate/store': minor ---- - -You can now use the xstate/store package with SolidJS. - -Import `useSelector` from `@xstate/store/solid`. Select the data you want via `useSelector(…)` and send events using `store.send(eventObject)`: - -```tsx -import { donutStore } from './donutStore.ts'; -import { useSelector } from '@xstate/store/solid'; - -function DonutCounter() { - const donutCount = useSelector(donutStore, (state) => state.context.donuts); - - return ( -
- -
- ); -} -``` diff --git a/.changeset/pretty-chicken-lie.md b/.changeset/pretty-chicken-lie.md deleted file mode 100644 index bad30100d7..0000000000 --- a/.changeset/pretty-chicken-lie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'xstate': minor ---- - -`waitFor()` now accepts a `{signal: AbortSignal}` in `WaitForOptions` diff --git a/.changeset/two-hounds-march.md b/.changeset/two-hounds-march.md deleted file mode 100644 index 324d18d3f0..0000000000 --- a/.changeset/two-hounds-march.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -'xstate': minor ---- - -The state value typings for setup state machine actors (`setup({}).createMachine({ ... })`) have been improved to represent the actual expected state values. - -```ts -const machine = setup({}).createMachine({ - initial: 'green', - states: { - green: {}, - yellow: {}, - red: { - initial: 'walk', - states: { - walk: {}, - wait: {}, - stop: {} - } - }, - emergency: { - type: 'parallel', - states: { - main: { - initial: 'blinking', - states: { - blinking: {} - } - }, - cross: { - initial: 'blinking', - states: { - blinking: {} - } - } - } - } - } -}); - -const actor = createActor(machine).start(); - -const stateValue = actor.getSnapshot().value; - -if (stateValue === 'green') { - // ... -} else if (stateValue === 'yellow') { - // ... -} else if ('red' in stateValue) { - stateValue; - // { - // red: "walk" | "wait" | "stop"; - // } -} else { - stateValue; - // { - // emergency: { - // main: "blinking"; - // cross: "blinking"; - // }; - // } -} -``` diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 60e1de1707..5d3d612d54 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,81 @@ # xstate +## 5.18.0 + +### Minor Changes + +- [#5042](https://github.com/statelyai/xstate/pull/5042) [`54c9d9e6a4`](https://github.com/statelyai/xstate/commit/54c9d9e6a49ab8af8b58d700ed967536f9c06fb4) Thanks [@boneskull](https://github.com/boneskull)! - `waitFor()` now accepts a `{signal: AbortSignal}` in `WaitForOptions` + +- [#5006](https://github.com/statelyai/xstate/pull/5006) [`1ab974547f`](https://github.com/statelyai/xstate/commit/1ab974547f2e1f1b656279f144f6b88a4419d87e) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The state value typings for setup state machine actors (`setup({}).createMachine({ ... })`) have been improved to represent the actual expected state values. + + ```ts + const machine = setup({}).createMachine({ + initial: 'green', + states: { + green: {}, + yellow: {}, + red: { + initial: 'walk', + states: { + walk: {}, + wait: {}, + stop: {} + } + }, + emergency: { + type: 'parallel', + states: { + main: { + initial: 'blinking', + states: { + blinking: {} + } + }, + cross: { + initial: 'blinking', + states: { + blinking: {} + } + } + } + } + } + }); + + const actor = createActor(machine).start(); + + const stateValue = actor.getSnapshot().value; + + if (stateValue === 'green') { + // ... + } else if (stateValue === 'yellow') { + // ... + } else if ('red' in stateValue) { + stateValue; + // { + // red: "walk" | "wait" | "stop"; + // } + } else { + stateValue; + // { + // emergency: { + // main: "blinking"; + // cross: "blinking"; + // }; + // } + } + ``` + +### Patch Changes + +- [#5054](https://github.com/statelyai/xstate/pull/5054) [`853f6daa0b`](https://github.com/statelyai/xstate/commit/853f6daa0b58bab6ea4153043f9efcfb18d18172) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `CallbackLogicFunction` type (previously `InvokeCallback`) is now exported. This is the callback function that you pass into `fromCallback(callbackLogicFn)` to create an actor from a callback function. + + ```ts + import { type CallbackLogicFunction } from 'xstate'; + + // ... + ``` + ## 5.17.4 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index df456a4e06..fbeb3ec7cc 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "xstate", - "version": "5.17.4", + "version": "5.18.0", "description": "Finite State Machines and Statecharts for the Modern Web.", "main": "dist/xstate.cjs.js", "module": "dist/xstate.esm.js", diff --git a/packages/xstate-graph/package.json b/packages/xstate-graph/package.json index dc64e7c4c6..0f898001c2 100644 --- a/packages/xstate-graph/package.json +++ b/packages/xstate-graph/package.json @@ -40,10 +40,10 @@ "url": "https://github.com/statelyai/xstate/issues" }, "peerDependencies": { - "xstate": "^5.17.4" + "xstate": "^5.18.0" }, "devDependencies": { - "xstate": "5.17.4" + "xstate": "5.18.0" }, "dependencies": {} } diff --git a/packages/xstate-immer/package.json b/packages/xstate-immer/package.json index 9397b1f70f..faed20ce2f 100644 --- a/packages/xstate-immer/package.json +++ b/packages/xstate-immer/package.json @@ -41,10 +41,10 @@ "dependencies": {}, "peerDependencies": { "immer": "^9.0.6 || ^10", - "xstate": "^5.17.4" + "xstate": "^5.18.0" }, "devDependencies": { "immer": "^10.0.2", - "xstate": "5.17.4" + "xstate": "5.18.0" } } diff --git a/packages/xstate-inspect/package.json b/packages/xstate-inspect/package.json index 7dc89f31e1..375fbbde13 100644 --- a/packages/xstate-inspect/package.json +++ b/packages/xstate-inspect/package.json @@ -53,12 +53,12 @@ "devDependencies": { "@types/ws": "^8.2.2", "ws": "^8.4.0", - "xstate": "5.17.4" + "xstate": "5.18.0" }, "peerDependencies": { "@types/ws": "^8.0.0", "ws": "^8.0.0", - "xstate": "^5.17.4" + "xstate": "^5.18.0" }, "peerDependenciesMeta": { "@types/ws": { diff --git a/packages/xstate-react/package.json b/packages/xstate-react/package.json index e547c0a6cf..c26144d5bd 100644 --- a/packages/xstate-react/package.json +++ b/packages/xstate-react/package.json @@ -55,7 +55,7 @@ }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "xstate": "^5.17.4" + "xstate": "^5.18.0" }, "peerDependenciesMeta": { "xstate": { @@ -74,6 +74,6 @@ "react": "^18.0.0", "react-dom": "^18.0.0", "rxjs": "^7.8.0", - "xstate": "5.17.4" + "xstate": "5.18.0" } } diff --git a/packages/xstate-solid/package.json b/packages/xstate-solid/package.json index d0f2b83c09..3f8e53c2d7 100644 --- a/packages/xstate-solid/package.json +++ b/packages/xstate-solid/package.json @@ -43,7 +43,7 @@ }, "peerDependencies": { "solid-js": "^1.6.0", - "xstate": "^5.17.4" + "xstate": "^5.18.0" }, "peerDependenciesMeta": { "xstate": { @@ -53,6 +53,6 @@ "devDependencies": { "solid-js": "^1.7.6", "solid-testing-library": "^0.3.0", - "xstate": "5.17.4" + "xstate": "5.18.0" } } diff --git a/packages/xstate-store/CHANGELOG.md b/packages/xstate-store/CHANGELOG.md index 559d431d29..3b43758e8b 100644 --- a/packages/xstate-store/CHANGELOG.md +++ b/packages/xstate-store/CHANGELOG.md @@ -1,5 +1,30 @@ # @xstate/store +## 2.3.0 + +### Minor Changes + +- [#5056](https://github.com/statelyai/xstate/pull/5056) [`8c35da9a72`](https://github.com/statelyai/xstate/commit/8c35da9a72bf067a275335d0391ce9ab85ed8a12) Thanks [@steveadams](https://github.com/steveadams)! - You can now use the xstate/store package with SolidJS. + + Import `useSelector` from `@xstate/store/solid`. Select the data you want via `useSelector(…)` and send events using `store.send(eventObject)`: + + ```tsx + import { donutStore } from './donutStore.ts'; + import { useSelector } from '@xstate/store/solid'; + + function DonutCounter() { + const donutCount = useSelector(donutStore, (state) => state.context.donuts); + + return ( +
+ +
+ ); + } + ``` + ## 2.2.1 ### Patch Changes diff --git a/packages/xstate-store/package.json b/packages/xstate-store/package.json index b9393eeb6f..243fec592b 100644 --- a/packages/xstate-store/package.json +++ b/packages/xstate-store/package.json @@ -1,6 +1,6 @@ { "name": "@xstate/store", - "version": "2.2.1", + "version": "2.3.0", "description": "Simple stores", "keywords": [ "store", @@ -64,7 +64,7 @@ "react-dom": "^18.0.0", "solid-js": "^1.7.6", "solid-testing-library": "^0.3.0", - "xstate": "^5.17.4" + "xstate": "^5.18.0" }, "peerDependencies": { "react": "^18.2.0", diff --git a/packages/xstate-svelte/package.json b/packages/xstate-svelte/package.json index 2e36bd6225..1570e01da4 100644 --- a/packages/xstate-svelte/package.json +++ b/packages/xstate-svelte/package.json @@ -45,7 +45,7 @@ }, "peerDependencies": { "svelte": "^3.24.1 || ^4", - "xstate": "^5.17.4" + "xstate": "^5.18.0" }, "peerDependenciesMeta": { "xstate": { @@ -58,6 +58,6 @@ "svelte": "^3.55.1", "svelte-check": "^3.2.0", "svelte-preprocess": "^5.0.0", - "xstate": "5.17.4" + "xstate": "5.18.0" } } diff --git a/packages/xstate-vue/package.json b/packages/xstate-vue/package.json index f4cdfe992a..8c9f224ceb 100644 --- a/packages/xstate-vue/package.json +++ b/packages/xstate-vue/package.json @@ -54,7 +54,7 @@ }, "peerDependencies": { "vue": "^3.0.0", - "xstate": "^5.17.4" + "xstate": "^5.18.0" }, "peerDependenciesMeta": { "xstate": { @@ -65,6 +65,6 @@ "@testing-library/vue": "^6.6.1", "@vue/compiler-sfc": "^3.0.11", "vue": "^3.0.11", - "xstate": "5.17.4" + "xstate": "5.18.0" } }