╭ changed ────────╮ │src/main_wasm.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────╮ │1 const std = @import("std"); │ │2 const ui = @import("./ui.zig"); │ │3 -const pg = @import("./page.zig"); │ │3 +const web = @import("./web.zig"); │ │4 const xitui = @import("xit").xitui;│ │5 const inp = xitui.input; │ │6 │ ╰──────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │10 │ │11 fn updateHtml() !void { │ │12 const root_ptr = if (root) |*root_value| root_value else return error.NotStarted;│ │13 - const html = try ui.generateHtml(allocator, root_ptr); │ │13 + const html = try web.generateHtml(allocator, root_ptr); │ │14 defer allocator.free(html); │ │15 setHtml(html); │ │16 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │18 // the page is allocated into this arena via parseFromSliceLeaky. it has │ │19 // to outlive `root`, because `root` holds slices into the parsed strings.│ │20 var page_arena: ?std.heap.ArenaAllocator = null; │ │21 -var page: ?pg.Page = null; │ │21 +var page: ?ui.Page = null; │ │22 │ │23 fn start(json: []const u8, max_width: u32) !void { │ │24 if (page_arena) |*a| a.deinit(); │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │26 │ │27 // alloc_always so the parsed strings live entirely inside the arena │ │28 // and don't borrow from the caller's json buffer. │ │29 - page = try std.json.parseFromSliceLeaky(pg.Page, (page_arena orelse unreachable).allocator(), json, .{│ │29 + page = try std.json.parseFromSliceLeaky(ui.Page, (page_arena orelse unreachable).allocator(), json, .{│ │30 .allocate = .alloc_always, │ │31 }); │ │32 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯