feat(web): preload completed wasm and load debug modules on demand
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-09-04 11:17:27 +08:00
parent a72b984f4c
commit 2ffb965b67
6 changed files with 95 additions and 29 deletions

View File

@@ -961,7 +961,7 @@ async function initialize(): Promise<WebEngineStatus> {
await wasmModuleLoader.preloadCompleted();
const imported = await import("../vendor/blender/web_engine.js") as unknown as { default: WasmFactory };
const factory = imported.default;
const binary = await wasmModuleLoader.load("core-completed");
const binary = await wasmModuleLoader.loadDebug("debug-incremental");
const initializedModule = await factory({ wasmBinary: binary });
const initializedHandle = initializedModule._web_engine_create();
if (initializedHandle <= 0) throw new Error("WebEngine handle creation failed");