@eco-incorp/sauce/compiler exports the compiler’s compile behind a readiness check, ready() for a browser, and resolveSdkModule/resolveSdkPackage, which serve the SDK’s SauceScript libraries (@sauce/token, @sauce/router) and ABIs to a compile. It re-exports the compiler’s option, result and account manifest types. The compiler’s own options and results are documented under @eco-incorp/sauce-compiler.
@eco-incorp/sauce/compiler:AccountEntry,AccountManifest,AccountRole,CompileOptions,CompileResult,ResolveModule,ResolvePackage,SauceTarget,WasmSource
@eco-incorp/sauce.
compile
Function · @eco-incorp/sauce/compiler
Compile a SauceScript program to Sauce bytecode - the compiler’s own compile, after a check
that its wasm is initialized. Synchronous in every environment once ready() has resolved, and
in Node without it. A failure is the compiler’s own error, its message (and a string stack)
plain text, its diagnostics as the compiler gave them.
ready
Function · @eco-incorp/sauce/compiler, @eco-incorp/sauce
Initialize the compiler’s WebAssembly where the environment needs it, once.
In a browser, with no source, the wasm is fetched from beside the compiler’s own module - the new URL("sauce_wasm_bg.wasm", import.meta.url) a bundler rewrites to an asset URL. Pass the
bytes (an ArrayBuffer or typed array) or a URL where that does not apply. In Node this resolves
at once and ignores source. Safe to call repeatedly and concurrently; a failed attempt is not
remembered, so calling again retries.
