╭ changed ────────╮ │src/main_wasm.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────╮ │1 const std = @import("std"); │ │2 const ui = @import("./ui.zig"); │ │3 +const pg = @import("./page.zig"); │ │4 const xitui = @import("xit").xitui;│ │5 const inp = xitui.input; │ │6 │ ╰──────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │14 defer allocator.free(html); │ │15 setHtml(html); │ │16 } │ │17 + │ │18 +// TODO: receive the Page as json from the host and parse it back into │ │19 +// a Page so initRoot can render real data. for now we initialize with │ │20 +// an empty page just so the wasm build compiles. │ │21 +var page_maybe: ?pg.Page = null; │ │22 │ │23 fn start() !void { │ │18 - var next_root = try ui.initRoot(allocator); │ │24 + const page = page_maybe orelse pg.Page{ .user_repo = pg.UserRepoPage.empty() };│ │25 + │ │26 + var next_root = try ui.initRoot(allocator, &page); │ │27 errdefer next_root.deinit(); │ │28 │ │29 if (root) |*old_root| old_root.deinit(); │ ╰───────────────────────────────────────────────────────────────────────────────────────╯