Merge branch 'zack/ssg-3' of github.com:oven-sh/bun into zack/ssg-3

This commit is contained in:
Zack Radisic
2025-09-12 16:36:03 -07:00
6 changed files with 11 additions and 11 deletions

View File

@@ -2946,12 +2946,12 @@ pub fn handleRenderRedirect(
var params: FrameworkRouter.MatchedParams = undefined;
if (dev.router.matchSlow(render_path, &params)) |route_index| {
// Found a matching route, bundle it and handle the request
dev.ensureRouteIsBundled(
dev.getOrPutRouteBundle(.{ .framework = route_index }) catch bun.outOfMemory(),
try dev.ensureRouteIsBundled(
dev.getOrPutRouteBundle(.{ .framework = route_index }) catch |err| bun.handleOom(err),
.server_handler,
.{ .saved = saved_request },
resp,
) catch bun.outOfMemory();
);
return;
}

View File

@@ -213,7 +213,7 @@ pub const Entry = struct {
// On the server, escape special characters for JSON
var remaining = utf8_input;
while (remaining.len > 0) {
if (std.mem.indexOfAny(u8, remaining, "\"\\\n\r\t")) |index| {
if (bun.strings.indexOfAny(remaining, "\"\\\n\r\t")) |index| {
// Write everything before the special character
if (index > 0) {
try writer.appendSlice(remaining[0..index]);

View File

@@ -110,7 +110,7 @@ pub fn putBakeSourceProvider(this: *SavedSourceMap, opaque_source_provider: *Bak
}
pub fn putDevServerSourceProvider(this: *SavedSourceMap, opaque_source_provider: *DevServerSourceProvider, path: []const u8) void {
this.putValue(path, Value.init(opaque_source_provider)) catch bun.outOfMemory();
this.putValue(path, Value.init(opaque_source_provider)) catch |err| bun.handleOom(err);
}
pub fn removeDevServerSourceProvider(this: *SavedSourceMap, opaque_source_provider: *anyopaque, path: []const u8) void {
@@ -315,7 +315,7 @@ fn getWithContent(
if (parse.map) |map| {
map.ref();
// The mutex is not locked. We have to check the hash table again.
this.putValue(path, Value.init(map)) catch bun.outOfMemory();
this.putValue(path, Value.init(map)) catch |err| bun.handleOom(err);
return parse;
}

View File

@@ -1917,7 +1917,7 @@ pub fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool,
const resp = this.resp;
this.detachResponse();
const new_request_ctx = server.request_pool_allocator.tryGet() catch bun.outOfMemory();
const new_request_ctx = server.request_pool_allocator.tryGet() catch |err| bun.handleOom(err);
new_request_ctx.* = .{
.allocator = server.allocator,
.resp = resp,
@@ -1936,7 +1936,7 @@ pub fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool,
.request_context = AnyRequestContext.init(new_request_ctx),
.https = ssl_enabled,
.signal = if (signal) |s| s.ref() else null,
.body = server.vm.initRequestBodyValue(body) catch bun.outOfMemory(),
.body = server.vm.initRequestBodyValue(body) catch |err| bun.handleOom(err),
.url = url,
});

View File

@@ -551,7 +551,7 @@ pub fn constructRender(
globalThis: *jsc.JSGlobalObject,
callframe: *jsc.CallFrame,
) bun.JSError!JSValue {
const arguments = callframe.arguments_old(2);
const arguments = callframe.argumentsAsArray(2);
const vm = globalThis.bunVM();
// Check if dev server async local_storage is set
@@ -566,7 +566,7 @@ pub fn constructRender(
return globalThis.throwInvalidArguments("Response.render() requires at least a path argument", .{});
}
const path_arg = arguments.ptr[0];
const path_arg = arguments[0];
if (!path_arg.isString()) {
return globalThis.throwInvalidArguments("Response.render() path must be a string", .{});
}

View File

@@ -68,7 +68,7 @@
"node-gyp": "10.0.1",
"nodemailer": "6.9.3",
"p-queue": "8.1.0",
"peechy": "^0.4.310",
"peechy": "0.4.310",
"pg": "8.11.1",
"pg-connection-string": "2.6.1",
"pg-gateway": "0.3.0-beta.4",