diff --git a/.changeset/sweet-sheep-arrive.md b/.changeset/sweet-sheep-arrive.md deleted file mode 100644 index 2a0a9882c4..0000000000 --- a/.changeset/sweet-sheep-arrive.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'xstate': minor ---- - -`fromPromise` now passes a signal into its creator function. - -```ts -const logic = fromPromise(({ signal }) => - fetch('https://api.example.com', { signal }) -); -``` - -This will be called whenever the state transitions before the promise is resolved. This is useful for cancelling the promise if the state changes. diff --git a/.changeset/twenty-parrots-add.md b/.changeset/twenty-parrots-add.md deleted file mode 100644 index 3361b9851a..0000000000 --- a/.changeset/twenty-parrots-add.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'xstate': patch ---- - -XState will now warn when calling built-in actions like `assign`, `sendTo`, `raise`, `emit`, etc. directly inside of a custom action. See https://stately.ai/docs/actions#built-in-actions for more details. - -```ts -const machine = createMachine({ - entry: () => { - // Will warn: - // "Custom actions should not call \`assign()\` directly, as it is not imperative. See https://stately.ai/docs/actions#built-in-actions for more details." - assign({ - // ... - }); - } -}); -``` diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 2dda0fdeeb..63c6d4d017 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,35 @@ # xstate +## 5.13.0 + +### Minor Changes + +- [#4832](https://github.com/statelyai/xstate/pull/4832) [`148d8fcef`](https://github.com/statelyai/xstate/commit/148d8fcef7f7467d05bbd427942a3668cb46afe7) Thanks [@cevr](https://github.com/cevr)! - `fromPromise` now passes a signal into its creator function. + + ```ts + const logic = fromPromise(({ signal }) => + fetch('https://api.example.com', { signal }) + ); + ``` + + This will be called whenever the state transitions before the promise is resolved. This is useful for cancelling the promise if the state changes. + +### Patch Changes + +- [#4876](https://github.com/statelyai/xstate/pull/4876) [`3f6a73b56`](https://github.com/statelyai/xstate/commit/3f6a73b56cb82b43897bc9d583483e0256dbc05c) Thanks [@davidkpiano](https://github.com/davidkpiano)! - XState will now warn when calling built-in actions like `assign`, `sendTo`, `raise`, `emit`, etc. directly inside of a custom action. See https://stately.ai/docs/actions#built-in-actions for more details. + + ```ts + const machine = createMachine({ + entry: () => { + // Will warn: + // "Custom actions should not call \`assign()\` directly, as it is not imperative. See https://stately.ai/docs/actions#built-in-actions for more details." + assign({ + // ... + }); + } + }); + ``` + ## 5.12.0 ### Minor Changes diff --git a/packages/core/package.json b/packages/core/package.json index fc6eecbf69..b1a7fae6d2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "xstate", - "version": "5.12.0", + "version": "5.13.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 1a284470f1..f9d7d34761 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.12.0" + "xstate": "^5.13.0" }, "devDependencies": { - "xstate": "5.12.0" + "xstate": "5.13.0" }, "dependencies": {} } diff --git a/packages/xstate-immer/package.json b/packages/xstate-immer/package.json index 928bceebc7..22c22820eb 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.12.0" + "xstate": "^5.13.0" }, "devDependencies": { "immer": "^10.0.2", - "xstate": "5.12.0" + "xstate": "5.13.0" } } diff --git a/packages/xstate-inspect/package.json b/packages/xstate-inspect/package.json index 13acee0af8..0e0fae77ac 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.12.0" + "xstate": "5.13.0" }, "peerDependencies": { "@types/ws": "^8.0.0", "ws": "^8.0.0", - "xstate": "^5.12.0" + "xstate": "^5.13.0" }, "peerDependenciesMeta": { "@types/ws": { diff --git a/packages/xstate-react/package.json b/packages/xstate-react/package.json index 5efa8a86ec..96bd05aca1 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.12.0" + "xstate": "^5.13.0" }, "peerDependenciesMeta": { "xstate": { @@ -76,6 +76,6 @@ "jsdom-global": "^3.0.2", "react": "^18.0.0", "react-dom": "^18.0.0", - "xstate": "5.12.0" + "xstate": "5.13.0" } } diff --git a/packages/xstate-solid/package.json b/packages/xstate-solid/package.json index 37ce66e1a1..648a7ffe39 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.12.0" + "xstate": "^5.13.0" }, "peerDependenciesMeta": { "xstate": { @@ -53,6 +53,6 @@ "devDependencies": { "solid-js": "^1.7.6", "solid-testing-library": "^0.3.0", - "xstate": "5.12.0" + "xstate": "5.13.0" } } diff --git a/packages/xstate-svelte/package.json b/packages/xstate-svelte/package.json index a4cd767b20..9c598d2203 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.12.0" + "xstate": "^5.13.0" }, "peerDependenciesMeta": { "xstate": { @@ -60,6 +60,6 @@ "svelte-check": "^3.2.0", "svelte-jester": "^2.3.2", "svelte-preprocess": "^5.0.0", - "xstate": "5.12.0" + "xstate": "5.13.0" } } diff --git a/packages/xstate-test/package.json b/packages/xstate-test/package.json index da460f360a..0ebd4a050a 100644 --- a/packages/xstate-test/package.json +++ b/packages/xstate-test/package.json @@ -46,11 +46,11 @@ "url": "https://github.com/statelyai/xstate/issues" }, "peerDependencies": { - "xstate": "^5.12.0" + "xstate": "^5.13.0" }, "devDependencies": { "strip-ansi": "^5.2.0", - "xstate": "5.12.0" + "xstate": "5.13.0" }, "dependencies": { "@xstate/graph": "2.0.0-beta.6" diff --git a/packages/xstate-vue/package.json b/packages/xstate-vue/package.json index 925bd94676..f5d28f6536 100644 --- a/packages/xstate-vue/package.json +++ b/packages/xstate-vue/package.json @@ -54,7 +54,7 @@ }, "peerDependencies": { "vue": "^3.0.0", - "xstate": "^5.12.0" + "xstate": "^5.13.0" }, "peerDependenciesMeta": { "xstate": { @@ -66,6 +66,6 @@ "@testing-library/vue": "^6.6.1", "@vue/compiler-sfc": "^3.0.11", "vue": "^3.0.11", - "xstate": "5.12.0" + "xstate": "5.13.0" } }