Rename global variables

This commit is contained in:
2026-08-03 12:01:40 +01:00
parent 87948340b0
commit 78e86b3999
78 changed files with 431 additions and 408 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
function removeController(controller) {
const idx = global.HMR_CONTROLLERS.findIndex((c) => c.controller == controller);
const idx = global.BUNEXT_HMR_CONTROLLERS.findIndex((c) => c.controller == controller);
if (typeof idx == "number" && idx >= 0) {
global.HMR_CONTROLLERS.splice(idx, 1);
global.BUNEXT_HMR_CONTROLLERS.splice(idx, 1);
}
}
export default async function ({ req }) {
@@ -17,16 +17,16 @@ export default async function ({ req }) {
catch {
return new Response("Invalid Referer Header", { status: 400 });
}
const match = global.ROUTER.match(referer_url.pathname);
const match = global.BUNEXT_ROUTER.match(referer_url.pathname);
const target_map = match?.filePath
? global.BUNDLER_CTX_MAP?.[match.filePath]
? global.BUNEXT_BUNDLER_CTX_MAP?.[match.filePath]
: undefined;
let controller;
let heartbeat;
const stream = new ReadableStream({
start(c) {
controller = c;
global.HMR_CONTROLLERS.push({
global.BUNEXT_HMR_CONTROLLERS.push({
controller: c,
page_url: referer_url.href,
target_map,