Skip to content

Commit 75c5014

Browse files
Version Packages (#121)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 34a9a26 commit 75c5014

6 files changed

Lines changed: 42 additions & 50 deletions

File tree

.changeset/brave-cats-listen.md

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

.changeset/curly-effects-invoke.md

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

.changeset/initial-entry-builders.md

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

.changeset/live-machine-inspection.md

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

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# @typeonce/effect-machine
22

3+
## 0.13.0
4+
5+
### Minor Changes
6+
7+
- 0ca9134: Upgrade the exact Effect peer dependency and companion Effect packages to `4.0.0-rc.109`.
8+
- aa4947f: Require every `Machine.invoke` `effect` source to be a factory evaluated when its owning state is entered. This gives lifecycle callbacks immediate output and failure inference while making Effect construction timing explicit.
9+
10+
Wrap previously direct Effects in a zero-argument function:
11+
12+
```ts
13+
Machine.invoke({
14+
id: "load",
15+
effect: () => load,
16+
onDone: ({ output, target }) => target.none()
17+
})
18+
```
19+
20+
- 34a9a26: Add typed declared-initial entry to compound and parallel transition targets.
21+
22+
Use `target.full.opened.initial()`, `initial(value)`, or `initial.from(input)` to enter the initial configuration declared by `Machine.defineStates`; the same operation is available through compatible `local` and `branch` target scopes. Schema-valued implicit children are constructed by `initialize: ({ builder }) => ...`, including fluent completion of every valued parallel region. Missing initializers are reported at `handle(...)`, and `.from` validation remains a typed `MachineSchemaDecodeError` during planning.
23+
24+
State handler `initial` and its `StateInitial*` utility types have been replaced by `initialize` and `StateInitialize*`. Migrate compound initializers from `initial: () => new Child(...)` to `initialize: ({ builder }) => builder(new Child(...))`, and parallel initializers from returned value records to chained region builders.
25+
26+
- c8728e5: Add live, root-scoped machine inspection through `Machine.prepare(machine).inspection` and `AtomMachine.inspection(machineAtom)`.
27+
28+
The hot Effect `Stream` observes ordered creation, initialization, mailbox delivery and processing, state changes, emissions, Effect and timer activities, and termination for a prepared root and all locally owned descendants:
29+
30+
```ts
31+
const prepared = yield * Machine.prepare(machine)
32+
33+
yield *
34+
prepared.inspection.pipe(
35+
Stream.runForEach((event) => Console.log(event.sequence, event.subject.id, event._tag)),
36+
Effect.forkScoped({ startImmediately: true })
37+
)
38+
39+
const ref = yield * prepared.start
40+
```
41+
42+
Inspection is non-replayed, never fails, and completes with the root. Its session ids and ordering are local to one prepared ownership tree; distributed identity and delivery remain an Effect Cluster concern.
43+
344
## 0.12.0
445

546
### Minor Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@typeonce/effect-machine",
3-
"version": "0.12.0",
3+
"version": "0.13.0",
44
"description": "Schema-first state machines and statecharts for Effect",
55
"author": "Sandro Maglione",
66
"repository": {

0 commit comments

Comments
 (0)