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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "xstateVersion": "6.0.0-alpha.71",
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:313"
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:100"
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:302"
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. Implement
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
- Events addressed to the root actor do not reach `sendEvent` during
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
@@ -1,4 +1,4 @@
1
- # XState 6.0.0-alpha.71
1
+ # XState 6.0.0-alpha.72
2
2
 
3
3
  These docs match the installed xstate package. Start with the [quick start](quick-start.md) or the [agent guide](agents.md).
4
4
  For differences from v5, read the [migration guide](xstate-v5-to-v6.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xstate",
3
- "version": "6.0.0-alpha.71",
3
+ "version": "6.0.0-alpha.72",
4
4
  "description": "Finite State Machines and Statecharts for the Modern Web.",
5
5
  "main": "dist/xstate.cjs.js",
6
6
  "bin": {