Skip to content

Commit 2406e13

Browse files
Version Packages (#5466)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent a741fe7 commit 2406e13

File tree

4 files changed

+44
-44
lines changed

4 files changed

+44
-44
lines changed

.changeset/every-mammals-live.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/three-sails-rhyme.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

packages/core/CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# xstate
22

3+
## 5.28.0
4+
5+
### Minor Changes
6+
7+
- [#4184](https://github.com/statelyai/xstate/pull/4184) [`a741fe7`](https://github.com/statelyai/xstate/commit/a741fe75901d3c4f08314e7c6d888bcb37866c04) Thanks [@davidkpiano](https://github.com/davidkpiano)! - Added routable states. States with `route: {}` and an explicit `id` can be navigated to from anywhere via a single `{ type: 'xstate.route', to: '#id' }` event.
8+
9+
```ts
10+
const machine = setup({}).createMachine({
11+
id: 'app',
12+
initial: 'home',
13+
states: {
14+
home: { id: 'home', route: {} },
15+
dashboard: {
16+
initial: 'overview',
17+
states: {
18+
overview: { id: 'overview', route: {} },
19+
settings: { id: 'settings', route: {} }
20+
}
21+
}
22+
}
23+
});
24+
25+
const actor = createActor(machine).start();
26+
27+
// Route directly to deeply nested state from anywhere
28+
actor.send({ type: 'xstate.route', to: '#settings' });
29+
```
30+
31+
Routes support guards for conditional navigation:
32+
33+
```ts
34+
settings: {
35+
id: 'settings',
36+
route: {
37+
guard: ({ context }) => context.role === 'admin'
38+
}
39+
}
40+
```
41+
42+
### Patch Changes
43+
44+
- [#5464](https://github.com/statelyai/xstate/pull/5464) [`ad809a0`](https://github.com/statelyai/xstate/commit/ad809a0a7084f57a30a47aade90b83caa2eb65d9) Thanks [@davidkpiano](https://github.com/davidkpiano)! - Fix: export types so setup() declaration emit works (fixes #5462)
45+
346
## 5.27.0
447

548
### Minor Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xstate",
3-
"version": "5.27.0",
3+
"version": "5.28.0",
44
"description": "Finite State Machines and Statecharts for the Modern Web.",
55
"main": "dist/xstate.cjs.js",
66
"module": "dist/xstate.esm.js",

0 commit comments

Comments
 (0)