xstate 6.0.0-alpha.71 → 6.0.0-alpha.72
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.
- package/dist/declarations/src/durable/index.d.ts +16 -7
- package/dist/xstate-durable.cjs.js +9 -12
- package/dist/xstate-durable.development.cjs.js +9 -12
- package/dist/xstate-durable.development.esm.js +9 -12
- package/dist/xstate-durable.esm.js +9 -12
- package/dist/xstate-durable.umd.min.js +1 -1
- package/dist/xstate-durable.umd.min.js.map +1 -1
- package/docs/api-stability.json +4 -4
- package/docs/durable-execution.md +10 -2
- package/docs/index.md +1 -1
- package/package.json +1 -1
package/docs/api-stability.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"xstateVersion": "6.0.0-alpha.
|
|
3
|
+
"xstateVersion": "6.0.0-alpha.72",
|
|
4
4
|
"entries": [
|
|
5
5
|
{
|
|
6
6
|
"entry": "packages/core/src/index.ts",
|
|
@@ -2759,7 +2759,7 @@
|
|
|
2759
2759
|
"name": "createDurable",
|
|
2760
2760
|
"stability": "experimental",
|
|
2761
2761
|
"deprecated": false,
|
|
2762
|
-
"location": "packages/core/src/durable/index.ts:
|
|
2762
|
+
"location": "packages/core/src/durable/index.ts:322"
|
|
2763
2763
|
},
|
|
2764
2764
|
{
|
|
2765
2765
|
"name": "DurableEffect",
|
|
@@ -2783,7 +2783,7 @@
|
|
|
2783
2783
|
"name": "DurableExecutionAdapter",
|
|
2784
2784
|
"stability": "experimental",
|
|
2785
2785
|
"deprecated": false,
|
|
2786
|
-
"location": "packages/core/src/durable/index.ts:
|
|
2786
|
+
"location": "packages/core/src/durable/index.ts:99"
|
|
2787
2787
|
},
|
|
2788
2788
|
{
|
|
2789
2789
|
"name": "DurableExecutionCancelledError",
|
|
@@ -2795,7 +2795,7 @@
|
|
|
2795
2795
|
"name": "DurableExecutionOptions",
|
|
2796
2796
|
"stability": "experimental",
|
|
2797
2797
|
"deprecated": false,
|
|
2798
|
-
"location": "packages/core/src/durable/index.ts:
|
|
2798
|
+
"location": "packages/core/src/durable/index.ts:303"
|
|
2799
2799
|
},
|
|
2800
2800
|
{
|
|
2801
2801
|
"name": "DurableExecutionResumeError",
|
|
@@ -41,7 +41,8 @@ Runtime operations you omit keep their local behavior — spawned machine
|
|
|
41
41
|
children run in this process, for example.
|
|
42
42
|
|
|
43
43
|
`enqueueRootEvent` is the narrow hook most co-located hosts need: it receives
|
|
44
|
-
events sent to the execution root while the loop is parked
|
|
44
|
+
events sent to the execution root while the loop is parked, or at any time
|
|
45
|
+
when `captureRootEvents` is `false`. Implement
|
|
45
46
|
`sendEvent` only when the host owns routing for every target. That override
|
|
46
47
|
replaces local delivery completely; call `deliverEvent(source, target, event)`
|
|
47
48
|
for co-located targets instead of `target.send(event)`, which re-enters the
|
|
@@ -327,7 +328,7 @@ that routes locally must call `deliverEvent`. When a remote runtime can
|
|
|
327
328
|
deliver the same completion more than once (retries, replays), the host is
|
|
328
329
|
responsible for deduplicating before handing it to the execution.
|
|
329
330
|
|
|
330
|
-
|
|
331
|
+
By default, events addressed to the root actor do not reach `sendEvent` during
|
|
331
332
|
`executeEffects`: the execution captures and retains them, and
|
|
332
333
|
`waitForEvent()` hands them out — in capture order — before deferring to the
|
|
333
334
|
adapter. While the loop is parked in the adapter's wait, a root-addressed
|
|
@@ -336,6 +337,13 @@ the broader routing override, and belongs in the host's mailbox. Producing one
|
|
|
336
337
|
without either hook throws, since delivering it locally to the inert root
|
|
337
338
|
would silently lose it.
|
|
338
339
|
|
|
340
|
+
For a live host with a FIFO mailbox, pass `{ captureRootEvents: false }` as
|
|
341
|
+
the third argument to `createDurable`. Root events then reach the adapter's
|
|
342
|
+
`sendEvent` or `enqueueRootEvent` during effect execution too. Put them in the
|
|
343
|
+
same mailbox as external events so a later child event cannot overtake an
|
|
344
|
+
earlier queued event. The host owns ordering and handling events from failed
|
|
345
|
+
batches in this mode; they are delivered without waiting for batch success.
|
|
346
|
+
|
|
339
347
|
Lifecycle operations do host bookkeeping and then call the local helper. They
|
|
340
348
|
never compute transitions: calling `transition()` or `executeEffects()` inside
|
|
341
349
|
`startActor`, `stopActor` or `terminateActor` produces a snapshot the drive
|
package/docs/index.md
CHANGED