Open calvinrp opened 3 weeks ago
Adds options to jco transpile and jco types:
jco transpile
jco types
.addOption(new Option('--async-mode [mode]', 'use async imports and exports').choices(['sync', 'jspi', 'asyncify']).preset('sync')) .option('--default-async-imports', 'default async component imports from WASI interfaces') .option('--default-async-exports', 'default async component exports from WASI interfaces') .option('--async-imports <imports...>', 'async component imports (examples: "wasi:io/poll@0.2.0#poll", "wasi:io/poll#[method]pollable.block")') .option('--async-exports <exports...>', 'async component exports (examples: "wasi:cli/run@#run", "handle")')
Which treats the specified imports and exports as async using either JSPI or Asyncify.
async
JSPI
Asyncify
JSPI is behind a feature flag in Chrome, Deno and NodeJS. Can run via:
DENO_V8_FLAGS="--experimental-wasm-jspi" deno
node --experimental-wasm-jspi
From my understanding, Asyncify does not support reentrancy (so it throws an error) but JSPI does.
Adds options to
jco transpile
andjco types
:Which treats the specified imports and exports as
async
using eitherJSPI
orAsyncify
.JSPI is behind a feature flag in Chrome, Deno and NodeJS. Can run via:
From my understanding,
Asyncify
does not support reentrancy (so it throws an error) but JSPI does.