Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function ensureWasmBuilt

    • Ensure a CURRENT compiled WASM module exists so the WASM-vs-TS parity tests run against the real backend.

      The parity harness (wasm-vs-typescript.test.ts) skips every case via it.skipIf(!wasmFilesExist) when the artifacts are absent — which means a dev box that never ran make build-wasm gets a fully-green suite that has verified NOTHING about the compiled backend (the only guard against Rust↔TS drift). A build that is merely STALE is worse still: it does not skip, it is loaded — and the shared loader (src/tests/helpers/wasm-artifact.ts) aborts every suite that loads it with "missing required export <kernel>". To avoid both traps:

      • if the artifacts are missing OR out of date (see missingWasmExports below) and a Rust/wasm-pack toolchain is present, build them automatically (mirrors the auto fixture-generation above);
      • if no toolchain is available, emit a LOUD warning naming what will actually happen — a missing build skips the parity harness, a stale one runs and fails;
      • if LUXAR_REQUIRE_WASM_TESTS=1 (CI), a missing/stale/unbuildable module is a hard failure.

      Returns void