Skip to content

prepareLayoutEngine

Read as Markdown

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.

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.

A Promise fulfilled when the compatible compiled module is ready.

Rejects on fetch, integrity or compilation failure, with the original cause.

pibbl

View source — packages/core/src/lib/pibbl.ts:15

Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

Documentation built with @pibbl/core 0.0.2, revision a1dcf8e. ALPHA — NOT FOR PRODUCTION USE.