@napi-rs/cli 3.9.1 → 3.10.0

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/README.md CHANGED
@@ -56,10 +56,23 @@ runtime down while the environment can still call into JavaScript. A registered
56
56
  `AsyncRuntime` backend quiesces there and its cancelled tasks reject their
57
57
  promises; the built-in Tokio runtime only _starts_ draining, so with it a
58
58
  promise whose task is still running can still be left pending. Settle in-flight
59
- work before disposing if that matters. Concurrent calls share one
60
- promise, successful disposal is idempotent, and a failed cleanup phase can be
61
- retried by calling the same function again. Do not call addon exports after
62
- disposal completes.
59
+ work before disposing if that matters.
60
+
61
+ The same preparation runs on a direct `Context.destroy()`. `destroy()` disables
62
+ JavaScript calls before it runs its cleanup hooks, and the threadsafe function's
63
+ hook then drops whatever is still queued, so every generated loader shadows
64
+ `destroy` on the emnapi context it creates: an embedder, a test harness, or
65
+ emnapi's own `beforeExit` auto-destroy gets the barrier too, instead of silently
66
+ discarding the settlements. Prefer the dispose symbol when you can yield — only
67
+ `dispose()` waits for settlements queued from another thread. A `destroy()` that
68
+ re-enters from a promise hook while the barrier is still running is a no-op,
69
+ because the frame that started the barrier destroys the moment it returns; a
70
+ `dispose()` that re-enters the same way joins the disposal already running,
71
+ since its frame yields for the settlement drain before it destroys.
72
+
73
+ Concurrent calls share one promise, successful disposal is idempotent, and a
74
+ failed cleanup phase can be retried by calling the same function again. Do not
75
+ call addon exports after disposal completes.
63
76
 
64
77
  See [WASI targets and loaders](./docs/wasi.md) for threaded, threadless,
65
78
  browser, and workerd packaging behavior.