IFClite TypeScript API
    Preparing search index...

    Function prewarmSharedWasmModule

    • Start the shared fetch+compile BEFORE a file is opened, so the binary is already downloaded and compiled by the time a load wants it.

      Without this the binary (~1.3 MB over the wire) is fetched lazily, on the click that opens a model: nothing overlaps the user's think time, and on a slow link the whole download sits in front of first geometry (measured 2.5 s on a ~4 Mbit connection, for a 225 KB model).

      Fire-and-forget by design (the returned promise never rejects): a prewarm failure must never surface to the user or poison the load path. compileSharedWasmModule already evicts a failed URL so the real load retries, and every consumer falls back to its own init() when no shared module is available. Callers decide when to call this (idle, intent) and whether the connection can afford it.

      wasmUrl MUST match the URL the subsequent load resolves — the memo is keyed on it, so prewarming one binary and loading another downloads both. Vite/webpack consumers (the viewer included) pass none and share the default resolution, which is the intended usage.

      Parameters

      • OptionalwasmUrl: string

      Returns Promise<boolean>