diff --git a/.changeset/pre.json b/.changeset/pre.json index 1e3a1f93c0..7e7fb5b5eb 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -19,7 +19,9 @@ "changesets": [ "bright-needles-visit", "chatty-monkeys-nail", + "clean-pens-buy", "cold-steaks-drop", + "cool-pets-love", "curvy-feet-guess", "dirty-birds-sniff", "eight-guests-wait", @@ -29,34 +31,50 @@ "five-ravens-own", "flat-clouds-greet", "giant-moons-glow", + "gold-buses-thank", "good-comics-collect", + "green-brooms-laugh", "hip-ways-rush", "hungry-rice-dream", + "lovely-badgers-return", "lucky-bikes-accept", "lucky-bulldogs-march", "lucky-vans-compare", + "modern-ducks-agree", "nervous-bananas-cover", "olive-geese-punch", "orange-gorillas-share", "orange-lemons-kick", + "perfect-ants-count", "plenty-dragons-lie", "popular-months-confess", "pretty-beans-pretend", + "purple-buses-hug", + "quick-lizards-burn", + "quick-lizards-thrive", "quiet-peaches-joke", "rare-phones-whisper", "rotten-rivers-wonder", "rotten-schools-march", + "seven-ligers-end", "shiny-apes-press", + "shy-gifts-shake", "shy-walls-develop", "sixty-hornets-allow", "slow-apples-dance", + "slow-carrots-confess", "small-papayas-wait", + "smooth-rocks-hang", + "soft-jeans-join", "tall-nails-drive", "tasty-terms-remain", "thin-ads-obey", "thin-dryers-argue", "tricky-spoons-lay", + "twelve-dingos-fold", + "twenty-fishes-fix", "wise-wombats-invite", - "witty-hounds-invent" + "witty-hounds-invent", + "young-chefs-prove" ] } diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 926eba659f..1df4d436ce 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,58 @@ # xstate +## 5.0.0-alpha.1 + +### Major Changes + +- [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `interpreter.onStop(...)` method has been removed. Use an observer instead via `interpreter.subscribe({ complete() { ... } })` instead. + +* [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `.send(...)` method on `interpreter.send(...)` now requires the first argument (the event to send) to be an _object_; that is, either: + + - an event object (e.g. `{ type: 'someEvent' }`) + - an SCXML event object. + + The second argument (payload) is no longer supported, and should instead be included within the object: + + ```diff + -actor.send('SOME_EVENT') + +actor.send({ type: 'SOME_EVENT' }) + + -actor.send('EVENT', { some: 'payload' }) + +actor.send({ type: 'EVENT', some: 'payload' }) + ``` + +- [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - Reading the initial state from an actor via `actor.initialState` is removed. Use `actor.getInitialState()` instead. + +* [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `matchState(...)` helper function is removed. + +- [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `strict: true` option for machine config has been removed. + +* [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `interpreter.onError(...)` method has been removed. Use `interpreter.subscribe({ error(err) => { ... } })` instead. + +- [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - `Interpreter['off']` method has been removed. + +* [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - `.nextState` method has been removed from the `Interpreter`. `State#can` can be used to check if sending a particular event would lead to a state change. + +- [#3187](https://github.com/statelyai/xstate/pull/3187) [`c800dec47`](https://github.com/statelyai/xstate/commit/c800dec472da9fa9427fdb4b081406fadf68c6ad) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `createModel()` function has been removed in favor of relying on strong types in the machine configuration. + +* [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - `sync` option has been removed from `invoke` and `spawn`. + +### Minor Changes + +- [#3727](https://github.com/statelyai/xstate/pull/3727) [`5fb3c683d`](https://github.com/statelyai/xstate/commit/5fb3c683d9a9bdc06637b3a13a5b575059aebadd) Thanks [@Andarist](https://github.com/Andarist)! - `exports` field has been added to the `package.json` manifest. It limits what files can be imported from a package - it's no longer possible to import from files that are not considered to be a part of the public API. + +### Patch Changes + +- [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - Fixed an issue with inline actions not being correctly executed when there was an equally named action provided through the `implementations` argument. + +* [#3487](https://github.com/statelyai/xstate/pull/3487) [`1b6e3dfb8`](https://github.com/statelyai/xstate/commit/1b6e3dfb89bda2dde3f6d28a3404cbe4f5114ade) Thanks [@Andarist](https://github.com/Andarist), [@davidkpiano](https://github.com/davidkpiano)! - Make it impossible to exit a root state. For example, this means that root-level transitions specified as external transitions will no longer restart root-level invocations. See [#3072](https://github.com/statelyai/xstate/issues/3072) for more details. + +- [#3389](https://github.com/statelyai/xstate/pull/3389) [`aa8f5d5fd`](https://github.com/statelyai/xstate/commit/aa8f5d5fdd3b87e0cef7b4ba2d315a0c9260810d) Thanks [@Andarist](https://github.com/Andarist)! - Fixed the declared signature of one of the `StateMachine`'s methods to avoid using a private name `this`. This makes it possible to emit correct `.d.ts` for the associated file. + +* [#3374](https://github.com/statelyai/xstate/pull/3374) [`a990f0ed1`](https://github.com/statelyai/xstate/commit/a990f0ed19e3b69cbfaa7d36c1b5bcf4c36daea4) Thanks [@Andarist](https://github.com/Andarist)! - Fixed an issue with actors not being reinstantiated correctly when an actor with the same ID was first stopped and then invoked/spawned again in the same microstep. + +- [#3390](https://github.com/statelyai/xstate/pull/3390) [`7abc41759`](https://github.com/statelyai/xstate/commit/7abc417592ff9ec239c82410d0ec17dc93f6ba00) Thanks [@Andarist](https://github.com/Andarist)! - Added back UMD builds. Please note that XState now comes with multiple entrypoints and you might need to load all of them (`XState`, `XStateActions`, `XStateGuards`, etc.). It's also worth mentioning that those bundles don't reference each other so they don't actually share any code and some code might be duplicated between them. + ## 4.33.1 ### Patch Changes @@ -150,10 +203,10 @@ And creating your own custom dev tools adapter is a function that takes in the `service`: ```js - const myCustomDevTools = (service) => { + const myCustomDevTools = service => { console.log('Got a service!'); - service.subscribe((state) => { + service.subscribe(state => { // ... }); }; @@ -341,7 +394,7 @@ let previousState; const service = interpret(someMachine) - .onTransition((state) => { + .onTransition(state => { // previousState represents the last state here // ... @@ -540,7 +593,7 @@ // This will const loggedInState = await waitFor( loginService, - (state) => state.hasTag('loggedIn'), + state => state.hasTag('loggedIn'), { timeout: Infinity } ); ``` @@ -573,7 +626,7 @@ // ... const loginService = interpret(loginMachine).start(); - const loggedInState = await waitFor(loginService, (state) => + const loggedInState = await waitFor(loginService, state => state.hasTag('loggedIn') ); @@ -710,7 +763,7 @@ ```js // Persisting a state - someService.subscribe((state) => { + someService.subscribe(state => { localStorage.setItem('some-state', JSON.stringify(state)); }); @@ -966,10 +1019,10 @@ model.createMachine({ // `ctx` was of type `any` - entry: (ctx) => {}, + entry: ctx => {}, exit: assign({ // `ctx` was of type `unknown` - foo: (ctx) => 42 + foo: ctx => 42 }) }); ``` @@ -1145,11 +1198,11 @@ const machine = createMachine({ context: { count: 0 }, entry: [ - (ctx) => console.log(ctx.count), // 0 - assign({ count: (ctx) => ctx.count + 1 }), - (ctx) => console.log(ctx.count), // 1 - assign({ count: (ctx) => ctx.count + 1 }), - (ctx) => console.log(ctx.count) // 2 + ctx => console.log(ctx.count), // 0 + assign({ count: ctx => ctx.count + 1 }), + ctx => console.log(ctx.count), // 1 + assign({ count: ctx => ctx.count + 1 }), + ctx => console.log(ctx.count) // 2 ], preserveActionOrder: true }); @@ -1158,11 +1211,11 @@ const machine = createMachine({ context: { count: 0 }, entry: [ - (ctx) => console.log(ctx.count), // 2 - assign({ count: (ctx) => ctx.count + 1 }), - (ctx) => console.log(ctx.count), // 2 - assign({ count: (ctx) => ctx.count + 1 }), - (ctx) => console.log(ctx.count) // 2 + ctx => console.log(ctx.count), // 2 + assign({ count: ctx => ctx.count + 1 }), + ctx => console.log(ctx.count), // 2 + assign({ count: ctx => ctx.count + 1 }), + ctx => console.log(ctx.count) // 2 ] // preserveActionOrder: false }); @@ -1361,7 +1414,7 @@ }); const service = interpret(machine) - .onTransition((state) => { + .onTransition(state => { // Read promise value synchronously const resolvedValue = state.context.promiseRef?.getSnapshot(); // => undefined (if promise not resolved yet) @@ -1441,7 +1494,7 @@ context: { value: 42 }, on: { INC: { - actions: assign({ value: (ctx) => ctx.value + 1 }) + actions: assign({ value: ctx => ctx.value + 1 }) } } }); @@ -1701,7 +1754,7 @@ ```js // ... - actions: stop((context) => context.someActor); + actions: stop(context => context.someActor); ``` ### Patch Changes @@ -1939,10 +1992,10 @@ ```js entry: [ choose([ - { cond: (ctx) => ctx > 100, actions: raise('TOGGLE') }, + { cond: ctx => ctx > 100, actions: raise('TOGGLE') }, { cond: 'hasMagicBottle', - actions: [assign((ctx) => ({ counter: ctx.counter + 1 }))] + actions: [assign(ctx => ({ counter: ctx.counter + 1 }))] }, { actions: ['fallbackAction'] } ]) diff --git a/packages/core/package.json b/packages/core/package.json index e9254824be..3edebaba09 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "xstate", - "version": "5.0.0-alpha.0", + "version": "5.0.0-alpha.1", "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-analytics/package.json b/packages/xstate-analytics/package.json index b29844baf7..536782e8d4 100644 --- a/packages/xstate-analytics/package.json +++ b/packages/xstate-analytics/package.json @@ -36,10 +36,10 @@ "url": "https://github.com/statelyai/xstate/issues" }, "peerDependencies": { - "xstate": "^5.0.0-alpha.0" + "xstate": "^5.0.0-alpha.1" }, "devDependencies": { - "xstate": "5.0.0-alpha.0" + "xstate": "5.0.0-alpha.1" }, "dependencies": {} } diff --git a/packages/xstate-fsm/CHANGELOG.md b/packages/xstate-fsm/CHANGELOG.md index 0fc6ee4331..64250dd5a3 100644 --- a/packages/xstate-fsm/CHANGELOG.md +++ b/packages/xstate-fsm/CHANGELOG.md @@ -1,5 +1,20 @@ # @xstate/fsm +## 3.0.0-alpha.0 + +### Major Changes + +- [#3455](https://github.com/statelyai/xstate/pull/3455) [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `.send(...)` method on `interpreter.send(...)` now requires the first argument (the event to send) to be an _object_, e.g. `{ type: 'someEvent' }`. + + ```diff + -actor.send('SOME_EVENT') + +actor.send({ type: 'SOME_EVENT' }) + ``` + +### Minor Changes + +- [#3727](https://github.com/statelyai/xstate/pull/3727) [`5fb3c683d`](https://github.com/statelyai/xstate/commit/5fb3c683d9a9bdc06637b3a13a5b575059aebadd) Thanks [@Andarist](https://github.com/Andarist)! - `exports` field has been added to the `package.json` manifest. It limits what files can be imported from a package - it's no longer possible to import from files that are not considered to be a part of the public API. + ## 2.0.0 ### Major Changes diff --git a/packages/xstate-fsm/package.json b/packages/xstate-fsm/package.json index 39b8c93624..05b3566582 100644 --- a/packages/xstate-fsm/package.json +++ b/packages/xstate-fsm/package.json @@ -1,6 +1,6 @@ { "name": "@xstate/fsm", - "version": "2.0.0", + "version": "3.0.0-alpha.0", "description": "XState for finite state machines", "keywords": [ "state", diff --git a/packages/xstate-graph/package.json b/packages/xstate-graph/package.json index f2cde7c58a..5b50df8642 100644 --- a/packages/xstate-graph/package.json +++ b/packages/xstate-graph/package.json @@ -35,10 +35,10 @@ "url": "https://github.com/statelyai/xstate/issues" }, "peerDependencies": { - "xstate": "^5.0.0-alpha.0" + "xstate": "^5.0.0-alpha.1" }, "devDependencies": { - "xstate": "5.0.0-alpha.0" + "xstate": "5.0.0-alpha.1" }, "dependencies": {} } diff --git a/packages/xstate-immer/package.json b/packages/xstate-immer/package.json index ce9ac31689..89de73906e 100644 --- a/packages/xstate-immer/package.json +++ b/packages/xstate-immer/package.json @@ -36,12 +36,12 @@ "dependencies": {}, "peerDependencies": { "immer": "^9.0.6", - "xstate": "^5.0.0-alpha.0" + "xstate": "^5.0.0-alpha.1" }, "devDependencies": { "immer": "^9.0.6", "lerna-alias": "3.0.3-0", "typescript": "^4.6.3", - "xstate": "5.0.0-alpha.0" + "xstate": "5.0.0-alpha.1" } } diff --git a/packages/xstate-inspect/package.json b/packages/xstate-inspect/package.json index 5801b3fc89..7b9aa04b8e 100644 --- a/packages/xstate-inspect/package.json +++ b/packages/xstate-inspect/package.json @@ -39,12 +39,12 @@ "@types/ws": "^8.2.2", "typescript": "^4.6.3", "ws": "^8.4.0", - "xstate": "5.0.0-alpha.0" + "xstate": "5.0.0-alpha.1" }, "peerDependencies": { "@types/ws": "^8.0.0", "ws": "^8.0.0", - "xstate": "^5.0.0-alpha.0" + "xstate": "^5.0.0-alpha.1" }, "peerDependenciesMeta": { "@types/ws": { diff --git a/packages/xstate-react/CHANGELOG.md b/packages/xstate-react/CHANGELOG.md index 5f7080b1a2..26457ff53a 100644 --- a/packages/xstate-react/CHANGELOG.md +++ b/packages/xstate-react/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 4.0.0-alpha.1 + +### Minor Changes + +- [#3727](https://github.com/statelyai/xstate/pull/3727) [`5fb3c683d`](https://github.com/statelyai/xstate/commit/5fb3c683d9a9bdc06637b3a13a5b575059aebadd) Thanks [@Andarist](https://github.com/Andarist)! - `exports` field has been added to the `package.json` manifest. It limits what files can be imported from a package - it's no longer possible to import from files that are not considered to be a part of the public API. + +### Patch Changes + +- Updated dependencies [[`5fb3c683d`](https://github.com/statelyai/xstate/commit/5fb3c683d9a9bdc06637b3a13a5b575059aebadd), [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0)]: + - @xstate/fsm@3.0.0-alpha.0 + ## 3.0.1 ### Patch Changes @@ -124,7 +135,7 @@ Previously, guards could not reference external props, because they would not be updated when the props changed. For instance: ```tsx - const Modal = (props) => { + const Modal = props => { useMachine(modalMachine, { guards: { isModalOpen: () => props.isOpen @@ -138,7 +149,7 @@ This is not true of actions/services. This will work as expected: ```tsx - const Modal = (props) => { + const Modal = props => { useMachine(modalMachine, { actions: { consoleLogModalOpen: () => { @@ -295,7 +306,7 @@ import { useSelector } from '@xstate/react'; const App = ({ someActor }) => { - const count = useSelector(someActor, (state) => state.context.count); + const count = useSelector(someActor, state => state.context.count); // ... }; @@ -416,7 +427,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 1414c2fc6f..613da15fb2 100644 --- a/packages/xstate-react/package.json +++ b/packages/xstate-react/package.json @@ -1,6 +1,6 @@ { "name": "@xstate/react", - "version": "4.0.0-alpha.0", + "version": "4.0.0-alpha.1", "description": "XState tools for React", "keywords": [ "state", @@ -43,9 +43,9 @@ "url": "https://github.com/statelyai/xstate/issues" }, "peerDependencies": { - "@xstate/fsm": "^2.0.0", + "@xstate/fsm": "^3.0.0-alpha.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "xstate": "^5.0.0-alpha.0" + "xstate": "^5.0.0-alpha.1" }, "peerDependenciesMeta": { "@xstate/fsm": { @@ -65,12 +65,12 @@ "@types/react": "^17.0.43", "@types/react-dom": "^17.0.14", "@types/use-sync-external-store": "^0.0.3", - "@xstate/fsm": "2.0.0", + "@xstate/fsm": "3.0.0-alpha.0", "jsdom": "^14.0.0", "jsdom-global": "^3.0.2", "react": "^18.0.0", "react-dom": "^18.0.0", - "xstate": "5.0.0-alpha.0" + "xstate": "5.0.0-alpha.1" }, "preconstruct": { "entrypoints": [ diff --git a/packages/xstate-scxml/package.json b/packages/xstate-scxml/package.json index b5a91a32af..5acbe3c757 100644 --- a/packages/xstate-scxml/package.json +++ b/packages/xstate-scxml/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "xml-js": "^1.6.11", - "xstate": "^5.0.0-alpha.0" + "xstate": "^5.0.0-alpha.1" }, "devDependencies": { "@scion-scxml/test-framework": "^2.0.15" diff --git a/packages/xstate-svelte/package.json b/packages/xstate-svelte/package.json index 4d6ae8e41a..222a847ae5 100644 --- a/packages/xstate-svelte/package.json +++ b/packages/xstate-svelte/package.json @@ -44,9 +44,9 @@ "url": "https://github.com/statelyai/xstate/issues" }, "peerDependencies": { - "@xstate/fsm": "^2.0.0", + "@xstate/fsm": "^3.0.0-alpha.0", "svelte": "^3.24.1", - "xstate": "^5.0.0-alpha.0" + "xstate": "^5.0.0-alpha.1" }, "peerDependenciesMeta": { "@xstate/fsm": { @@ -60,13 +60,13 @@ "@testing-library/svelte": "^3.0.0", "@tsconfig/svelte": "^1.0.8", "@types/jest": "^24.0.23", - "@xstate/fsm": "2.0.0", + "@xstate/fsm": "3.0.0-alpha.0", "svelte": "^3.24.1", "svelte-check": "^2.4.5", "svelte-jester": "^1.1.2", "svelte-preprocess": "^4.10.6", "typescript": "^4.6.3", - "xstate": "5.0.0-alpha.0" + "xstate": "5.0.0-alpha.1" }, "preconstruct": { "entrypoints": [ diff --git a/packages/xstate-test/package.json b/packages/xstate-test/package.json index 24ec56c271..d681f17039 100644 --- a/packages/xstate-test/package.json +++ b/packages/xstate-test/package.json @@ -44,11 +44,11 @@ "url": "https://github.com/statelyai/xstate/issues" }, "peerDependencies": { - "xstate": "^5.0.0-alpha.0" + "xstate": "^5.0.0-alpha.1" }, "devDependencies": { "strip-ansi": "^5.2.0", - "xstate": "5.0.0-alpha.0" + "xstate": "5.0.0-alpha.1" }, "dependencies": { "@xstate/graph": "^2.0.0-alpha.0" diff --git a/packages/xstate-vue/CHANGELOG.md b/packages/xstate-vue/CHANGELOG.md index 329927fe8d..7bca0d7100 100644 --- a/packages/xstate-vue/CHANGELOG.md +++ b/packages/xstate-vue/CHANGELOG.md @@ -1,5 +1,16 @@ # @xstate/vue +## 3.0.0-alpha.1 + +### Minor Changes + +- [#3727](https://github.com/statelyai/xstate/pull/3727) [`5fb3c683d`](https://github.com/statelyai/xstate/commit/5fb3c683d9a9bdc06637b3a13a5b575059aebadd) Thanks [@Andarist](https://github.com/Andarist)! - `exports` field has been added to the `package.json` manifest. It limits what files can be imported from a package - it's no longer possible to import from files that are not considered to be a part of the public API. + +### Patch Changes + +- Updated dependencies [[`5fb3c683d`](https://github.com/statelyai/xstate/commit/5fb3c683d9a9bdc06637b3a13a5b575059aebadd), [`ec39214c8`](https://github.com/statelyai/xstate/commit/ec39214c8eba11d75f6af72bae51ddb65ce003a0)]: + - @xstate/fsm@3.0.0-alpha.0 + ## 3.0.0-alpha.0 ### Major Changes @@ -133,10 +144,7 @@ export default { props: ['someActor'], setup(props) { - const count = useSelector( - props.someActor, - (state) => state.context.count - ); + const count = useSelector(props.someActor, state => state.context.count); // ... return { count }; } @@ -171,7 +179,7 @@ export default defineComponent({ setup() { const state = ref(); - const service = useInterpret(machine, {}, (nextState) => { + const service = useInterpret(machine, {}, nextState => { state.value = nextState.value; }); return { service, state }; diff --git a/packages/xstate-vue/package.json b/packages/xstate-vue/package.json index 5164704920..4b2bfd09fb 100644 --- a/packages/xstate-vue/package.json +++ b/packages/xstate-vue/package.json @@ -1,6 +1,6 @@ { "name": "@xstate/vue", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.1", "description": "XState tools for Vue", "keywords": [ "state", @@ -42,9 +42,9 @@ "url": "https://github.com/statelyai/xstate/issues" }, "peerDependencies": { - "@xstate/fsm": "^2.0.0", + "@xstate/fsm": "^3.0.0-alpha.0", "vue": "^3.0.0", - "xstate": "^5.0.0-alpha.0" + "xstate": "^5.0.0-alpha.1" }, "peerDependenciesMeta": { "@xstate/fsm": { @@ -58,9 +58,9 @@ "@testing-library/jest-dom": "^5.11.9", "@testing-library/vue": "^6.4.0", "@vue/compiler-sfc": "^3.0.11", - "@xstate/fsm": "2.0.0", + "@xstate/fsm": "3.0.0-alpha.0", "vue": "^3.0.11", - "xstate": "5.0.0-alpha.0" + "xstate": "5.0.0-alpha.1" }, "preconstruct": { "entrypoints": [