@typeonce/effect-machine 0.26.2 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -318,6 +318,25 @@ machine.
318
318
  Do not start a promise inside a transition callback. A transition has no
319
319
  lifetime in which to own that work. A state does.
320
320
 
321
+ Give every invocation declared by one state a unique lifecycle ID. Give every
322
+ logic or child process that can be active at the same time a unique runtime
323
+ address as well:
324
+
325
+ ```ts
326
+ Loading: {
327
+ invoke: (from) => [
328
+ from.effect("load-document", loadDocument),
329
+ from.timer("load-timeout", "10 seconds")
330
+ ]
331
+ }
332
+ ```
333
+
334
+ Invocation outcomes are routed by state path and lifecycle ID, and overlapping
335
+ children cannot own the same runtime address. If work is sequential, represent
336
+ the sequence with separate states and transition from the first outcome. Do
337
+ not depend on one child completing quickly enough for another declaration to
338
+ reuse its identity.
339
+
321
340
  ### Choose state-owned or process-owned children
322
341
 
323
342
  Use `from.child(...)` when the child belongs to one state and must stop when
@@ -8,6 +8,14 @@ Read the [Effect Machine agent guide](./agent-guide.md) for statechart modeling
8
8
  and [Effect Atom and React patterns](./effect-atom-react.md) for integration
9
9
  patterns.
10
10
 
11
+ Run the recommended rules from
12
+ [`@typeonce/oxlint-plugin-effect-machine`](../../oxlint-plugin/README.md) before
13
+ the manual review. They catch provable duplicate invocation identities,
14
+ asynchronous work, browser access, nondeterminism, and redundant resolvers in
15
+ direct same-module machine definitions. Continue with this review for
16
+ cross-module ownership and architectural questions that syntax alone cannot
17
+ answer.
18
+
11
19
  ## Review the responsibility boundaries
12
20
 
13
21
  Use this split when deciding where code belongs:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typeonce/effect-machine",
3
- "version": "0.26.2",
3
+ "version": "0.27.1",
4
4
  "description": "Schema-first state machines and statecharts for Effect",
5
5
  "author": "Sandro Maglione",
6
6
  "repository": {