From 0a2f6f8cc48258fca60df2f193790b2d94a9d0f6 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Thu, 8 Oct 2026 06:22:41 +0200 Subject: wasm add resources tracking --- src/z/App/main.js | 2 +- src/z/App/root.zig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/z/App') diff --git a/src/z/App/main.js b/src/z/App/main.js index 34df302..5e0c176 100644 --- a/src/z/App/main.js +++ b/src/z/App/main.js @@ -18,7 +18,7 @@ const imports = { } } -WebAssembly.instantiateStreaming(fetch("index.wasm"), imports).then( +const wasm_ready = WebAssembly.instantiateStreaming(fetch("index.wasm"), imports).then( ({ instance, module }) => { window.wasm = { exports: instance.exports, diff --git a/src/z/App/root.zig b/src/z/App/root.zig index a3d0916..42ef26f 100644 --- a/src/z/App/root.zig +++ b/src/z/App/root.zig @@ -8,6 +8,7 @@ pub const Options = struct { globals: []const Global, components: []const Component, body: h.Element, + theme: []const u8, pub const Global = struct { name: []const u8, @@ -56,6 +57,7 @@ pub fn App(comptime options: Options) type { .name = "viewport", .content = "width=device-width, initial-scale=1.0", }, .void), + .native(.style, .{}, .content(options.theme)), })), .native(.body, .{}, .children(&.{ .native(.script, .{}, .content(@embedFile("object-store.js"))), -- cgit v1.2.3-70-g09d2