kit: implement server components dev server (#14025)

This commit is contained in:
dave caruso
2024-09-27 20:53:39 -07:00
committed by GitHub
parent d09df1af47
commit 514d37b3d2
82 changed files with 3812 additions and 5964 deletions

View File

@@ -48,6 +48,9 @@ pub const Index = packed struct(u32) {
pub const invalid = Index{ .value = std.math.maxInt(Int) };
pub const runtime = Index{ .value = 0 };
pub const kit_server_data = Index{ .value = 1 };
pub const kit_client_data = Index{ .value = 2 };
pub const Int = u32;
pub inline fn source(num: anytype) Index {
@@ -229,6 +232,8 @@ pub const Ref = packed struct(u64) {
*const std.ArrayList(js_ast.Symbol) => symbol_table.items,
*std.ArrayList(js_ast.Symbol) => symbol_table.items,
[]js_ast.Symbol => symbol_table,
*js_ast.Symbol.Map => return symbol_table.get(ref) orelse
unreachable, // ref must exist within symbol table
else => |T| @compileError("Unsupported type to Ref.getSymbol: " ++ @typeName(T)),
};
return &resolved_symbol_table[ref.innerIndex()];