fix dev server regressions from 1.2.5's hmr rewrite (#18109)

Co-authored-by: Zack Radisic <zack@theradisic.com>
Co-authored-by: zackradisic <56137411+zackradisic@users.noreply.github.com>
This commit is contained in:
chloe caruso
2025-03-14 21:24:14 -07:00
committed by GitHub
parent 45e01cdaf2
commit d1c77f5061
28 changed files with 875 additions and 378 deletions

View File

@@ -894,7 +894,9 @@ pub fn withoutTrailingSlashWindowsPath(input: string) []const u8 {
path.len -= 1;
}
bun.assert(!isWindowsAbsolutePathMissingDriveLetter(u8, path));
if (Environment.isDebug)
bun.debugAssert(!std.fs.path.isAbsolute(path) or
!isWindowsAbsolutePathMissingDriveLetter(u8, path));
return path;
}
@@ -4382,6 +4384,7 @@ pub fn indexOfNeedsURLEncode(slice: []const u8) ?u32 {
if (remaining[0] >= 127 or
remaining[0] < 0x20 or
remaining[0] == '%' or
remaining[0] == '\\' or
remaining[0] == '"' or
remaining[0] == '#' or
@@ -4402,6 +4405,7 @@ pub fn indexOfNeedsURLEncode(slice: []const u8) ?u32 {
@as(AsciiVectorU1, @bitCast(vec > max_16_ascii)) |
@as(AsciiVectorU1, @bitCast((vec < min_16_ascii))) |
@as(AsciiVectorU1, @bitCast(vec == @as(AsciiVector, @splat('%')))) |
@as(AsciiVectorU1, @bitCast(vec == @as(AsciiVector, @splat('\\')))) |
@as(AsciiVectorU1, @bitCast(vec == @as(AsciiVector, @splat('"')))) |
@as(AsciiVectorU1, @bitCast(vec == @as(AsciiVector, @splat('#')))) |
@as(AsciiVectorU1, @bitCast(vec == @as(AsciiVector, @splat('?')))) |
@@ -4425,6 +4429,7 @@ pub fn indexOfNeedsURLEncode(slice: []const u8) ?u32 {
const char = char_.*;
if (char > 127 or char < 0x20 or
char == '\\' or
char == '%' or
char == '"' or
char == '#' or
char == '?' or