@napi-rs/cli 3.8.3 → 3.8.4
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 +7 -4
- package/dist/cli.js +501 -15
- package/dist/index.cjs +501 -15
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +501 -15
- package/package.json +1 -1
- package/src/api/__tests__/__snapshots__/templates.spec.ts.md +768 -9
- package/src/api/__tests__/__snapshots__/templates.spec.ts.snap +0 -0
- package/src/api/__tests__/templates.spec.ts +85 -1
- package/src/api/templates/load-wasi-template.ts +499 -13
package/README.md
CHANGED
|
@@ -50,10 +50,13 @@ if (dispose) {
|
|
|
50
50
|
The symbol is present only when the loaded binding is WASI. Browser WASI
|
|
51
51
|
loaders expose it on their default export. Disposal releases the instance: it
|
|
52
52
|
destroys the emnapi context and then terminates the workers owned by that
|
|
53
|
-
binding.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
binding. Before that, the loader calls the binary's
|
|
54
|
+
`napi_prepare_wasm_env_cleanup` preparation hook, which shuts the addon's async
|
|
55
|
+
runtime down while the environment can still call into JavaScript. A registered
|
|
56
|
+
`AsyncRuntime` backend quiesces there and its cancelled tasks reject their
|
|
57
|
+
promises; the built-in Tokio runtime only _starts_ draining, so with it a
|
|
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
|
|
57
60
|
promise, successful disposal is idempotent, and a failed cleanup phase can be
|
|
58
61
|
retried by calling the same function again. Do not call addon exports after
|
|
59
62
|
disposal completes.
|