prepareLayoutEngine
import { prepareLayoutEngine } from "@pibbl/core";
await prepareLayoutEngine();prepareLayoutEngine(): Promise<void> fetches and compiles the external generated
layout WASM asset. It creates no mount, instance, arena, signal subscription or
animation frame. Concurrent callers share one attempt. A ready compatible module
is reused by both pibbl and
pibblSync.
A failed fetch, HTTP response, fingerprint check or compilation rejects with asset
and phase context. The failed attempt is evicted; a later call can retry. This
operation has no cancellation argument because it warms shared immutable code.
A mount can cancel its own wait through PibblConfig.signal.
Importing the package does not fetch or compile the engine. HTML preload with
matching URL and credentials can warm the network cache independently; it does not
compile WASM. Serve the emitted .wasm asset with the application, including its
deployment base path, with application/wasm MIME type. Fingerprint verification
uses Web Crypto, so deploy over HTTPS or a trusted localhost origin. External fetch follows normal CORS requirements; CSP must
permit the fetch and WebAssembly compilation. The asynchronous entry excludes the
separate embedded binary payload.
API details from source
Section titled “API details from source”
Fetches and compiles the external layout WASM ahead of mounting. Concurrent calls share one attempt; a later call retries after failure. Creates no mount. HTML preload can independently warm the network cache.
prepareLayoutEngine: () => Promise<void>Related API: prepareLayoutEngine.
Returns
Section titled “Returns”A Promise fulfilled when the compatible compiled module is ready.
Throws
Section titled “Throws”Rejects on fetch, integrity or compilation failure, with the original cause.
See also
Section titled “See also”View source — packages/core/src/lib/pibbl.ts:15
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Prepare layout before mounting: Warm the shared layout module before creating an asynchronous canvas mount. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision a1dcf8e. ALPHA — NOT FOR PRODUCTION USE.