Skip to content

Commit

Permalink
Version Packages (alpha) (#3375)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Jan 7, 2023
1 parent ec39214 commit 8dd8831
Show file tree
Hide file tree
Showing 16 changed files with 165 additions and 60 deletions.
20 changes: 19 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
]
}
99 changes: 76 additions & 23 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 => {
// ...
});
};
Expand Down Expand Up @@ -341,7 +394,7 @@
let previousState;

const service = interpret(someMachine)
.onTransition((state) => {
.onTransition(state => {
// previousState represents the last state here

// ...
Expand Down Expand Up @@ -540,7 +593,7 @@
// This will
const loggedInState = await waitFor(
loginService,
(state) => state.hasTag('loggedIn'),
state => state.hasTag('loggedIn'),
{ timeout: Infinity }
);
```
Expand Down Expand Up @@ -573,7 +626,7 @@
// ...
const loginService = interpret(loginMachine).start();

const loggedInState = await waitFor(loginService, (state) =>
const loggedInState = await waitFor(loginService, state =>
state.hasTag('loggedIn')
);

Expand Down Expand Up @@ -710,7 +763,7 @@

```js
// Persisting a state
someService.subscribe((state) => {
someService.subscribe(state => {
localStorage.setItem('some-state', JSON.stringify(state));
});

Expand Down Expand Up @@ -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
})
});
```
Expand Down Expand Up @@ -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
});
Expand All @@ -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
});
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1441,7 +1494,7 @@
context: { value: 42 },
on: {
INC: {
actions: assign({ value: (ctx) => ctx.value + 1 })
actions: assign({ value: ctx => ctx.value + 1 })
}
}
});
Expand Down Expand Up @@ -1701,7 +1754,7 @@
```js
// ...
actions: stop((context) => context.someActor);
actions: stop(context => context.someActor);
```
### Patch Changes
Expand Down Expand Up @@ -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'] }
])
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/xstate-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
15 changes: 15 additions & 0 deletions packages/xstate-fsm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/xstate-fsm/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/xstate-graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
4 changes: 2 additions & 2 deletions packages/xstate-immer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions packages/xstate-inspect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading

0 comments on commit 8dd8831

Please sign in to comment.