Skip to content

Commit

Permalink
Merge pull request #2836 from statelyai/changeset-release/main
Browse files Browse the repository at this point in the history
Version Packages
  • Loading branch information
davidkpiano authored Dec 30, 2021
2 parents 4999395 + 46da2c4 commit c8b1802
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 95 deletions.
32 changes: 0 additions & 32 deletions .changeset/breezy-needles-burn.md

This file was deleted.

14 changes: 0 additions & 14 deletions .changeset/chilled-dryers-dream.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/famous-dryers-build.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/gentle-meals-teach.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/green-carpets-report.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/perfect-paws-explode.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tame-ants-eat.md

This file was deleted.

57 changes: 40 additions & 17 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# xstate

## 4.27.0

### Minor Changes

- [#2800](https://github.com/statelyai/xstate/pull/2800) [`759a90155`](https://github.com/statelyai/xstate/commit/759a9015512bbf532d7044afe6a889c04dc7edf6) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `sendTo(actorRef, event)` action creator has been introduced. It allows you to specify the recipient actor ref of an event first, so that the event can be strongly typed against the events allowed to be received by the actor ref:

```ts
// ...
entry: sendTo(
(ctx) => ctx.someActorRef,
{ type: 'EVENT_FOR_ACTOR' }
),
// ...
```

### Patch Changes

- [#2804](https://github.com/statelyai/xstate/pull/2804) [`f3caecf5a`](https://github.com/statelyai/xstate/commit/f3caecf5ad384cfe2a843c26333aaa46a77ece68) Thanks [@davidkpiano](https://github.com/davidkpiano)! - The `state.can(...)` method no longer unnecessarily executes `assign()` actions and instead determines if a given event will change the state by reading transition data before evaluating actions.

* [#2856](https://github.com/statelyai/xstate/pull/2856) [`49c2e9094`](https://github.com/statelyai/xstate/commit/49c2e90945d369e2dfb2e4fc376b3f46714dce09) Thanks [@Andarist](https://github.com/Andarist)! - Fixed an issue with stopped children sometimes starting their own child actors. This could happen when the child was stopped synchronously (for example by its parent) when transitioning to an invoking state.

- [#2895](https://github.com/statelyai/xstate/pull/2895) [`df5ffce14`](https://github.com/statelyai/xstate/commit/df5ffce14908d0aa8056a56001039dfd260be1a4) Thanks [@Andarist](https://github.com/Andarist)! - Fixed an issue with some exit handlers being executed more than once when stopping a machine.

## 4.26.1

### Patch Changes
Expand Down Expand Up @@ -106,10 +129,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 @@ -285,11 +308,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 @@ -298,11 +321,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 @@ -501,7 +524,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 @@ -581,7 +604,7 @@
context: { value: 42 },
on: {
INC: {
actions: assign({ value: (ctx) => ctx.value + 1 })
actions: assign({ value: ctx => ctx.value + 1 })
}
}
});
Expand Down Expand Up @@ -841,7 +864,7 @@
```js
// ...
actions: stop((context) => context.someActor);
actions: stop(context => context.someActor);
```
### Patch Changes
Expand Down Expand Up @@ -1079,10 +1102,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": "4.26.1",
"version": "4.27.0",
"description": "Finite State Machines and Statecharts for the Modern Web.",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/xstate-fsm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @xstate/fsm

## 1.6.3

### Patch Changes

- [#2474](https://github.com/davidkpiano/xstate/pull/2474) Thanks [@annaghi](https://github.com/annaghi)! - Use CommonJS files as `package.json#main` (instead of UMD files) as this plays better with native ESM loader in node (and by extension fixes compatibility issues with projects like [SvelteKit](https://kit.svelte.dev/)).

## 1.6.2

### Patch 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": "1.6.2",
"version": "1.6.3",
"description": "XState for finite state machines",
"keywords": [
"state",
Expand Down
35 changes: 35 additions & 0 deletions packages/xstate-inspect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# @xstate/inspect

## 0.6.0

### Minor Changes

- [#2640](https://github.com/statelyai/xstate/pull/2640) [`c73dfd655`](https://github.com/statelyai/xstate/commit/c73dfd655525546e59f00d0be88b80ab71239427) Thanks [@davidkpiano](https://github.com/davidkpiano)! - A serializer can now be specified as an option for `inspect(...)` in the `.serialize` property. It should be a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#the_replacer_parameter):

```js
// ...

inspect({
// ...
serialize: (key, value) => {
if (value instanceof Map) {
return 'map';
}

return value;
}
});

// ...

// Will be inspected as:
// {
// type: 'EVENT_WITH_MAP',
// map: 'map'
// }
someService.send({
type: 'EVENT_WITH_MAP',
map: new Map()
});
```

* [#2894](https://github.com/statelyai/xstate/pull/2894) [`8435c5b84`](https://github.com/statelyai/xstate/commit/8435c5b841e318c5d35dfea65242246dfb4b34f8) Thanks [@Andarist](https://github.com/Andarist)! - The package has been upgraded to be compatible with `[email protected]`. The WS server created server-side has to be of a compatible version now.

## 0.5.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/xstate-inspect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xstate/inspect",
"version": "0.5.2",
"version": "0.6.0",
"description": "XState inspection utilities",
"keywords": [
"state",
Expand Down
2 changes: 1 addition & 1 deletion packages/xstate-scxml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"xml-js": "^1.6.11",
"xstate": "^4.26.1"
"xstate": "^4.27.0"
},
"devDependencies": {
"@scion-scxml/test-framework": "^2.0.15",
Expand Down

0 comments on commit c8b1802

Please sign in to comment.