@absolutejs/absolute 0.20.0-beta.170 → 0.20.0-beta.172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/README.md +33 -4
- package/changelog.json +128 -0
- package/dist/angular/browser.js +2 -2
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/constants.js +1 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +2 -2
- package/dist/angular/components/core/streamingSlotRegistry.js +3 -3
- package/dist/angular/index.js +184 -29
- package/dist/angular/index.js.map +15 -14
- package/dist/angular/server.js +184 -29
- package/dist/angular/server.js.map +15 -14
- package/dist/build.js +1241 -853
- package/dist/build.js.map +32 -30
- package/dist/cli/{add-6a7pjkn9.js → add-ae6mg79m.js} +10 -10
- package/dist/cli/{analyze-606fshwa.js → analyze-e57zz9x8.js} +3 -3
- package/dist/cli/{androidEmulatorController-68jjdxmx.js → androidEmulatorController-vqc5m2rp.js} +6 -6
- package/dist/cli/{androidNativeWatcher-x032x9yr.js → androidNativeWatcher-s03aczxv.js} +6 -6
- package/dist/cli/{api-mshjr4ah.js → api-8ppxw487.js} +8 -8
- package/dist/cli/{build-g81xqbb9.js → build-fz7qbdn3.js} +3 -3
- package/dist/cli/{buildDepVendor-29d8v9cx.js → buildDepVendor-qvsh6dsj.js} +7 -3
- package/dist/cli/{compile-9y1w9zpj.js → compile-ndc36zna.js} +10 -7
- package/dist/cli/config/server.js +36 -6
- package/dist/cli/{db-5b4s1kvx.js → db-qbzjw3en.js} +2 -2
- package/dist/cli/{dev-hyeb89hp.js → dev-x49583aj.js} +43 -15
- package/dist/cli/{doctor-h55y9hj1.js → doctor-repprx92.js} +42 -12
- package/dist/cli/{emulatorDoctor-p3yt7140.js → emulatorDoctor-s1z5tkp7.js} +5 -5
- package/dist/cli/{emulatorInstaller-4pm2kx9w.js → emulatorInstaller-pgkdswvq.js} +6 -6
- package/dist/cli/{env-snb0597q.js → env-5nz1qm8e.js} +3 -3
- package/dist/cli/{expoDevController-0vj8dvkh.js → expoDevController-018anvbm.js} +6 -6
- package/dist/cli/{generate-20x1pkf7.js → generate-brvjesd6.js} +8 -8
- package/dist/cli/{heapDiff-wqj8vrq8.js → heapDiff-kncvdtn8.js} +3 -3
- package/dist/cli/htmx/htmx.min.js +1 -1
- package/dist/cli/{htmx-6mz2h7k1.js → htmx-5twhjz7p.js} +7 -7
- package/dist/cli/{index-w09fzs9f.js → index-0z5fgb80.js} +1 -1
- package/dist/cli/{index-exfkpjja.js → index-125cfzvn.js} +2 -2
- package/dist/cli/{index-32ge2w1f.js → index-25e7k849.js} +16 -8
- package/dist/cli/{index-ys2rzqhg.js → index-2shf4aya.js} +1 -1
- package/dist/cli/{index-74m7kh8c.js → index-3ewt17wm.js} +1 -1
- package/dist/cli/{index-zd3cna19.js → index-3sfcmb49.js} +1 -1
- package/dist/cli/{index-14fbvz34.js → index-50ag35xg.js} +2 -2
- package/dist/cli/{index-h5qx5jpk.js → index-7854xf0m.js} +1 -1
- package/dist/cli/{index-3y57kd7x.js → index-8khbn8qr.js} +3 -3
- package/dist/cli/{index-xw1byvzp.js → index-9djrap79.js} +1 -1
- package/dist/cli/{index-ppphkyps.js → index-a6xx0p9e.js} +1 -1
- package/dist/cli/{index-g4ehq6ev.js → index-aemhvvwb.js} +1 -1
- package/dist/cli/{index-z6f43b20.js → index-b1wht4q5.js} +1 -1
- package/dist/cli/{index-s3xvccq3.js → index-btp4fyf1.js} +2 -2
- package/dist/cli/{index-066qhc6n.js → index-cgmp9d02.js} +1 -1
- package/dist/cli/{index-3wz3mktm.js → index-gyjxrnnz.js} +1 -1
- package/dist/cli/index-jwfambwe.js +13 -0
- package/dist/cli/{index-3wm8p7rg.js → index-n6faa3m3.js} +1 -1
- package/dist/cli/{index-kye08pjx.js → index-pr1skxen.js} +1 -1
- package/dist/cli/{index-t8cf0zj9.js → index-prza6tkp.js} +3 -3
- package/dist/cli/{index-qbrzvmh9.js → index-q3snnhyd.js} +1 -1
- package/dist/cli/{index-3vmc30gf.js → index-rz56x932.js} +1 -1
- package/dist/cli/{index-9sksd8c8.js → index-vh68jb0e.js} +2 -2
- package/dist/cli/index.js +32 -32
- package/dist/cli/{info-mn125212.js → info-k124sh7g.js} +4 -4
- package/dist/cli/{inspect-c7s117j0.js → inspect-n6pcfvfw.js} +5 -5
- package/dist/cli/{iosNativeWatcher-0nm6qad5.js → iosNativeWatcher-wdq2fvj1.js} +7 -7
- package/dist/cli/{iosSimulatorController-hza2c3rv.js → iosSimulatorController-n97dpa8p.js} +7 -7
- package/dist/cli/{islands-dc54e5y1.js → islands-p4vgx7a2.js} +3 -3
- package/dist/cli/{logs-ej1add2b.js → logs-shg23fbt.js} +3 -3
- package/dist/cli/{ls-b6zz24nt.js → ls-0hfx323m.js} +3 -3
- package/dist/cli/{mem-5q7n3ymb.js → mem-16sy1707.js} +5 -5
- package/dist/cli/{migrate-6nm4kdf6.js → migrate-k91k050s.js} +2 -2
- package/dist/cli/{mobile-ajnnvqtv.js → mobile-nqdkk3gd.js} +13 -13
- package/dist/cli/prerender-010z771p.js +10 -0
- package/dist/cli/{prettier-phdtvqef.js → prettier-dh5fh786.js} +1 -1
- package/dist/cli/{ps-ezmzyscn.js → ps-pk7ncjac.js} +6 -6
- package/dist/cli/{psTui-3x3ykjve.js → psTui-50wf0b72.js} +7 -7
- package/dist/cli/{remoteMacProtocol-g09myqt5.js → remoteMacProtocol-g10s408w.js} +7 -7
- package/dist/cli/{remove-t8x1mrxg.js → remove-abaf0w6k.js} +8 -8
- package/dist/cli/{routes-3xj256gx.js → routes-mc3ymp8t.js} +3 -3
- package/dist/cli/{start-d6p831ny.js → start-t3cq57wn.js} +5 -5
- package/dist/cli/{typecheck-stbt0qt5.js → typecheck-fag7djt5.js} +38 -10
- package/dist/cli/{workspace-61hh6jq1.js → workspace-7sbyyc59.js} +5 -5
- package/dist/client/chunks/islands-s2ta5ajb.js.map +1 -1
- package/dist/client/navigation.js +2 -1
- package/dist/client/navigation.js.map +3 -3
- package/dist/dev/client/domTracker.ts +52 -19
- package/dist/dev/client/frameworkDetect.ts +11 -0
- package/dist/dev/client/handlers/html.ts +6 -1
- package/dist/dev/client/handlers/htmx.ts +6 -1
- package/dist/dev/client/hmrClient.ts +10 -0
- package/dist/dev/serverBootstrap.js +112 -6
- package/dist/index.js +1147 -757
- package/dist/index.js.map +32 -30
- package/dist/islands/index.js +16 -5
- package/dist/islands/index.js.map +6 -6
- package/dist/mobile/index.js +2 -2
- package/dist/mobile/index.js.map +3 -3
- package/dist/react/components/index.js +2 -2
- package/dist/react/components/index.js.map +3 -3
- package/dist/react/index.js +85 -18
- package/dist/react/index.js.map +11 -11
- package/dist/react/server.js +71 -15
- package/dist/react/server.js.map +8 -8
- package/dist/src/angular/baseHref.d.ts +2 -0
- package/dist/src/angular/components/constants.d.ts +1 -0
- package/dist/src/angular/ssrRender.d.ts +1 -1
- package/dist/src/build/compileAngular.d.ts +15 -0
- package/dist/src/build/resolveBuildMode.d.ts +6 -0
- package/dist/src/build/scanAngularHandlerCalls.d.ts +3 -1
- package/dist/src/build/verifyAngularCoreUniqueness.d.ts +3 -1
- package/dist/src/cli/htmx/install.d.ts +1 -1
- package/dist/src/cli/scripts/bunCheck.d.ts +3 -1
- package/dist/src/cli/typeGraphCoherence.d.ts +9 -2
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/core/appErrorHooks.d.ts +8 -0
- package/dist/src/core/islandPageContext.d.ts +5 -1
- package/dist/src/core/requestContext.d.ts +5 -0
- package/dist/src/core/serverOnlyStaticFiles.d.ts +7 -0
- package/dist/src/dev/editorTempFiles.d.ts +3 -0
- package/dist/src/dev/hot/analyze.d.ts +1 -1
- package/dist/src/dev/hot/runtime.d.ts +20 -0
- package/dist/src/dev/importCost/instrument.d.ts +1 -1
- package/dist/src/dev/rebuildTrigger.d.ts +1 -0
- package/dist/src/utils/cleanStaleOutputs.d.ts +4 -1
- package/dist/src/utils/logger.d.ts +3 -2
- package/dist/src/utils/resolveConvention.d.ts +1 -0
- package/dist/src/utils/ssrErrorPage.d.ts +3 -0
- package/dist/svelte/index.js +85 -18
- package/dist/svelte/index.js.map +11 -11
- package/dist/svelte/router/Route.svelte.d.ts +1 -2
- package/dist/svelte/router/Router.svelte +2 -4
- package/dist/svelte/server.js +73 -16
- package/dist/svelte/server.js.map +9 -9
- package/dist/types/globals.d.ts +3 -0
- package/dist/types/svelteRouter.ts +3 -12
- package/dist/vue/components/Image.js +2 -2
- package/dist/vue/components/Image.js.map +3 -3
- package/dist/vue/components/index.js +2 -2
- package/dist/vue/components/index.js.map +3 -3
- package/dist/vue/index.js +158 -91
- package/dist/vue/index.js.map +12 -12
- package/dist/vue/server.js +144 -88
- package/dist/vue/server.js.map +9 -9
- package/package.json +2 -1
- package/dist/cli/prerender-fqpp0m1j.js +0 -10
- /package/dist/cli/{index-vtp20gwf.js → index-2bxfhs32.js} +0 -0
- /package/dist/cli/{index-fgz435qn.js → index-t8jmj8w1.js} +0 -0
package/dist/vue/server.js
CHANGED
|
@@ -267,6 +267,80 @@ var init_staticHtmlNonce = __esm(() => {
|
|
|
267
267
|
init_cspNonceRef();
|
|
268
268
|
});
|
|
269
269
|
|
|
270
|
+
// src/utils/ssrErrorPage.ts
|
|
271
|
+
var GENERIC_ERROR_MESSAGE = "Something went wrong while rendering this page.", errorPageHtml = ({
|
|
272
|
+
framework,
|
|
273
|
+
hint,
|
|
274
|
+
kind,
|
|
275
|
+
message,
|
|
276
|
+
script = ""
|
|
277
|
+
}) => {
|
|
278
|
+
const frameworkColors = {
|
|
279
|
+
angular: "#dd0031",
|
|
280
|
+
html: "#e34c26",
|
|
281
|
+
htmx: "#1a365d",
|
|
282
|
+
react: "#61dafb",
|
|
283
|
+
svelte: "#ff3e00",
|
|
284
|
+
vue: "#42b883"
|
|
285
|
+
};
|
|
286
|
+
const accent = frameworkColors[framework] ?? "#94a3b8";
|
|
287
|
+
const label = framework.charAt(0).toUpperCase() + framework.slice(1);
|
|
288
|
+
return `<!DOCTYPE html>
|
|
289
|
+
<html>
|
|
290
|
+
<head>
|
|
291
|
+
<meta charset="utf-8">
|
|
292
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
293
|
+
<title>SSR Error - AbsoluteJS</title>
|
|
294
|
+
<style${nonceAttr()}>
|
|
295
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
296
|
+
body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);color:#e2e8f0;font-family:"JetBrains Mono","Fira Code",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;display:flex;align-items:flex-start;justify-content:center;padding:32px}
|
|
297
|
+
.card{max-width:720px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden}
|
|
298
|
+
.header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4)}
|
|
299
|
+
.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}
|
|
300
|
+
.badge{padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${accent};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2)}
|
|
301
|
+
.kind{color:#94a3b8;font-size:13px;font-weight:500}
|
|
302
|
+
.content{padding:24px}
|
|
303
|
+
.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}
|
|
304
|
+
.message{margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5}
|
|
305
|
+
.hint{margin-top:20px;padding:12px 20px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px}
|
|
306
|
+
</style>
|
|
307
|
+
</head>
|
|
308
|
+
<body>
|
|
309
|
+
<div class="card">
|
|
310
|
+
<div class="header">
|
|
311
|
+
<div style="display:flex;align-items:center;gap:12px">
|
|
312
|
+
<span class="brand">AbsoluteJS</span>
|
|
313
|
+
<span class="badge">${label}</span>
|
|
314
|
+
</div>
|
|
315
|
+
<span class="kind">${kind}</span>
|
|
316
|
+
</div>
|
|
317
|
+
<div class="content">
|
|
318
|
+
<div class="label">What went wrong</div>
|
|
319
|
+
<pre class="message">${message.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</pre>
|
|
320
|
+
<div class="hint">${hint}</div>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
${script}
|
|
324
|
+
</body>
|
|
325
|
+
</html>`;
|
|
326
|
+
}, reloadOnRebuild = () => `<script${nonceAttr()}>(()=>{const url=(location.protocol==='https:'?'wss://':'ws://')+location.host+'/hmr';let seen=false;const connect=()=>{const socket=new WebSocket(url);socket.onopen=()=>{if(seen)location.reload();seen=true;};socket.onmessage=(event)=>{try{const message=JSON.parse(event.data);const type=message&&typeof message.type==='string'?message.type:'';if(type==='rebuild-complete'||type==='server-entry-reloaded'||type.endsWith('-update'))location.reload();}catch{}};socket.onclose=()=>setTimeout(connect,500);};connect();})();</script>`, buildErrorPage = (framework, pageName, error) => errorPageHtml({
|
|
327
|
+
framework,
|
|
328
|
+
hint: "Fix the file and save. This page reloads by itself when the build succeeds.",
|
|
329
|
+
kind: "Build Error",
|
|
330
|
+
message: `${pageName || "This page"} could not be built.
|
|
331
|
+
|
|
332
|
+
${error ?? "The dev-server terminal has the build output."}`,
|
|
333
|
+
script: reloadOnRebuild()
|
|
334
|
+
}), errorMessage = (error) => error instanceof Error ? error.message : String(error), ssrErrorPage = (framework, error) => errorPageHtml({
|
|
335
|
+
framework,
|
|
336
|
+
hint: "A component threw during server-side rendering. Check the terminal for the full stack trace.",
|
|
337
|
+
kind: "Server Render Error",
|
|
338
|
+
message: isDevelopmentRuntime() ? errorMessage(error) : GENERIC_ERROR_MESSAGE
|
|
339
|
+
});
|
|
340
|
+
var init_ssrErrorPage = __esm(() => {
|
|
341
|
+
init_cspNonceRef();
|
|
342
|
+
});
|
|
343
|
+
|
|
270
344
|
// src/utils/resolveConvention.ts
|
|
271
345
|
import { basename } from "path";
|
|
272
346
|
var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boolean(value) && typeof value === "object", getMap = () => {
|
|
@@ -304,14 +378,17 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
304
378
|
}, resolveNotFoundConventionPath = (framework) => getMap()[framework]?.defaults?.notFound, setConventions = (map) => {
|
|
305
379
|
Reflect.set(globalThis, CONVENTIONS_KEY, map);
|
|
306
380
|
}, isDev = () => isDevelopmentRuntime(), buildErrorProps = (error) => {
|
|
381
|
+
const name = error instanceof Error ? error.name : "Error";
|
|
382
|
+
if (!isDev())
|
|
383
|
+
return { message: GENERIC_ERROR_MESSAGE, name };
|
|
307
384
|
if (error instanceof Error) {
|
|
308
385
|
return {
|
|
309
386
|
message: error.message,
|
|
310
|
-
name
|
|
311
|
-
...
|
|
387
|
+
name,
|
|
388
|
+
...error.stack ? { stack: error.stack } : {}
|
|
312
389
|
};
|
|
313
390
|
}
|
|
314
|
-
return { message: String(error), name
|
|
391
|
+
return { message: String(error), name };
|
|
315
392
|
}, renderReactError = async (conventionPath, errorProps) => {
|
|
316
393
|
const { createElement } = await import("react");
|
|
317
394
|
const { renderToReadableStream } = await import("react-dom/server");
|
|
@@ -425,6 +502,29 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
425
502
|
return htmlResponse;
|
|
426
503
|
}
|
|
427
504
|
return null;
|
|
505
|
+
}, isPageRequest = (request) => {
|
|
506
|
+
if (request.headers.get("hx-request") === "true")
|
|
507
|
+
return true;
|
|
508
|
+
if (request.headers.get("sec-fetch-dest") === "document")
|
|
509
|
+
return true;
|
|
510
|
+
return (request.headers.get("accept") ?? "").includes("text/html");
|
|
511
|
+
}, renderStaticRouteError = async (request, error) => {
|
|
512
|
+
if (!isPageRequest(request))
|
|
513
|
+
return null;
|
|
514
|
+
const preferHtmx = request.headers.get("hx-request") === "true";
|
|
515
|
+
const order = preferHtmx ? ["htmx", "html"] : ["html", "htmx"];
|
|
516
|
+
const frameworks = order.filter((framework) => hasErrorConvention(framework));
|
|
517
|
+
if (frameworks.length === 0)
|
|
518
|
+
return null;
|
|
519
|
+
const errorProps = buildErrorProps(error);
|
|
520
|
+
const renderNext = async (remaining) => {
|
|
521
|
+
const [framework, ...rest] = remaining;
|
|
522
|
+
if (!framework)
|
|
523
|
+
return null;
|
|
524
|
+
const response = await tryFrameworkErrorConvention(framework, "", errorProps, error);
|
|
525
|
+
return response ?? renderNext(rest);
|
|
526
|
+
};
|
|
527
|
+
return renderNext(frameworks);
|
|
428
528
|
}, renderReactNotFound = async (conventionPath) => {
|
|
429
529
|
const { createElement } = await import("react");
|
|
430
530
|
const { renderToReadableStream } = await import("react-dom/server");
|
|
@@ -519,6 +619,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
519
619
|
var init_resolveConvention = __esm(() => {
|
|
520
620
|
init_cspNonceRef();
|
|
521
621
|
init_staticHtmlNonce();
|
|
622
|
+
init_ssrErrorPage();
|
|
522
623
|
ERROR_RENDERERS = {
|
|
523
624
|
angular: renderAngularError,
|
|
524
625
|
ember: renderEmberError,
|
|
@@ -617,7 +718,7 @@ var init_spaRouteManifest = __esm(() => {
|
|
|
617
718
|
});
|
|
618
719
|
|
|
619
720
|
// src/constants.ts
|
|
620
|
-
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
721
|
+
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
621
722
|
var init_constants = __esm(() => {
|
|
622
723
|
TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
|
|
623
724
|
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
@@ -720,7 +821,7 @@ var init_startupBanner = __esm(() => {
|
|
|
720
821
|
});
|
|
721
822
|
|
|
722
823
|
// src/utils/logger.ts
|
|
723
|
-
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
824
|
+
var colors2, frameworkColors, logTag = () => isDevelopmentRuntime() ? "[hmr]" : "[absolutejs]", formatPath = (filePath) => {
|
|
724
825
|
const cwd = process.cwd();
|
|
725
826
|
let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
726
827
|
relative = relative.replace(/\\/g, "/");
|
|
@@ -730,7 +831,7 @@ var colors2, frameworkColors, formatPath = (filePath) => {
|
|
|
730
831
|
return relative;
|
|
731
832
|
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
732
833
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
733
|
-
const tag = `${colors2.cyan}
|
|
834
|
+
const tag = `${colors2.cyan}${logTag()}${colors2.reset}`;
|
|
734
835
|
let message = action;
|
|
735
836
|
if (options?.path) {
|
|
736
837
|
const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
|
|
@@ -744,7 +845,7 @@ var colors2, frameworkColors, formatPath = (filePath) => {
|
|
|
744
845
|
log("css update", { duration, framework: framework ?? "css", path });
|
|
745
846
|
}, logError = (message, error) => {
|
|
746
847
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
747
|
-
const tag = `${colors2.red}
|
|
848
|
+
const tag = `${colors2.red}${logTag()}${colors2.reset}`;
|
|
748
849
|
const errorMsg = error instanceof Error ? error.message : error;
|
|
749
850
|
const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
|
|
750
851
|
console.error(`${timestamp} ${tag} ${fullMessage}`);
|
|
@@ -773,7 +874,7 @@ var colors2, frameworkColors, formatPath = (filePath) => {
|
|
|
773
874
|
log(`${colors2.cyan}server module reloaded${colors2.reset}`);
|
|
774
875
|
}, logWarn = (message) => {
|
|
775
876
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
776
|
-
const tag = `${colors2.yellow}
|
|
877
|
+
const tag = `${colors2.yellow}${logTag()}${colors2.reset}`;
|
|
777
878
|
console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
|
|
778
879
|
};
|
|
779
880
|
var init_logger = __esm(() => {
|
|
@@ -836,8 +937,23 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
836
937
|
return;
|
|
837
938
|
warnedMissingBootstrap = true;
|
|
838
939
|
logWarn("A page contains islands, but the build manifest has no islands bootstrap, so they will render without hydrating. Set `islands.registry` in absolute.config.ts (a default bootstrap is generated from it) or point `islands.bootstrap` at a file that calls startIslands().");
|
|
940
|
+
}, manifestBuildDir, WINDOWS_ABSOLUTE_PATH, isServerFilePath = (value) => {
|
|
941
|
+
if (WINDOWS_ABSOLUTE_PATH.test(value))
|
|
942
|
+
return true;
|
|
943
|
+
if (!manifestBuildDir)
|
|
944
|
+
return false;
|
|
945
|
+
const root = manifestBuildDir.endsWith("/") ? manifestBuildDir : `${manifestBuildDir}/`;
|
|
946
|
+
return value.startsWith(root);
|
|
947
|
+
}, toBrowserManifest = (manifest) => {
|
|
948
|
+
const browserManifest = {};
|
|
949
|
+
for (const [key, value] of Object.entries(manifest)) {
|
|
950
|
+
if (typeof value !== "string" || isServerFilePath(value))
|
|
951
|
+
continue;
|
|
952
|
+
browserManifest[key] = value;
|
|
953
|
+
}
|
|
954
|
+
return browserManifest;
|
|
839
955
|
}, buildIslandsHeadMarkup = (manifest) => {
|
|
840
|
-
const manifestScript = `<script${nonceAttr()}>window.__ABSOLUTE_MANIFEST__ = ${escapeScriptContent(JSON.stringify(manifest))}</script>`;
|
|
956
|
+
const manifestScript = `<script${nonceAttr()}>window.__ABSOLUTE_MANIFEST__ = ${escapeScriptContent(JSON.stringify(toBrowserManifest(manifest)))}</script>`;
|
|
841
957
|
const islandStateScript = `<script${nonceAttr()}>window.__ABS_ISLAND_STATE__ = ${escapeScriptContent(JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {}))}</script>`;
|
|
842
958
|
const bootstrapPath = getIslandBootstrapPath(manifest);
|
|
843
959
|
const bootstrapScript = bootstrapPath ? `<script${nonceAttr()} type="module" src="${bootstrapPath}"></script>` : "";
|
|
@@ -1037,13 +1153,15 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
1037
1153
|
return stream;
|
|
1038
1154
|
}
|
|
1039
1155
|
return pipeStreamWithIslandMarkerDetection(stream, markup, () => warnIfBootstrapMissing(manifest));
|
|
1040
|
-
}, setCurrentIslandManifest = (manifest) => {
|
|
1156
|
+
}, setCurrentIslandManifest = (manifest, buildDir) => {
|
|
1041
1157
|
globalThis.__absoluteManifest = manifest;
|
|
1158
|
+
manifestBuildDir = buildDir?.replaceAll("\\", "/");
|
|
1042
1159
|
};
|
|
1043
1160
|
var init_islandPageContext = __esm(() => {
|
|
1044
1161
|
init_escapeScriptContent();
|
|
1045
1162
|
init_cspNonceRef();
|
|
1046
1163
|
init_logger();
|
|
1164
|
+
WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
|
|
1047
1165
|
});
|
|
1048
1166
|
|
|
1049
1167
|
// src/core/devRouteRegistrationCallsite.ts
|
|
@@ -1148,80 +1266,6 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
1148
1266
|
pageHandlerWrappers = new WeakMap;
|
|
1149
1267
|
});
|
|
1150
1268
|
|
|
1151
|
-
// src/utils/ssrErrorPage.ts
|
|
1152
|
-
var errorPageHtml = ({
|
|
1153
|
-
framework,
|
|
1154
|
-
hint,
|
|
1155
|
-
kind,
|
|
1156
|
-
message,
|
|
1157
|
-
script = ""
|
|
1158
|
-
}) => {
|
|
1159
|
-
const frameworkColors = {
|
|
1160
|
-
angular: "#dd0031",
|
|
1161
|
-
html: "#e34c26",
|
|
1162
|
-
htmx: "#1a365d",
|
|
1163
|
-
react: "#61dafb",
|
|
1164
|
-
svelte: "#ff3e00",
|
|
1165
|
-
vue: "#42b883"
|
|
1166
|
-
};
|
|
1167
|
-
const accent = frameworkColors[framework] ?? "#94a3b8";
|
|
1168
|
-
const label = framework.charAt(0).toUpperCase() + framework.slice(1);
|
|
1169
|
-
return `<!DOCTYPE html>
|
|
1170
|
-
<html>
|
|
1171
|
-
<head>
|
|
1172
|
-
<meta charset="utf-8">
|
|
1173
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1174
|
-
<title>SSR Error - AbsoluteJS</title>
|
|
1175
|
-
<style${nonceAttr()}>
|
|
1176
|
-
*{margin:0;padding:0;box-sizing:border-box}
|
|
1177
|
-
body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);color:#e2e8f0;font-family:"JetBrains Mono","Fira Code",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;display:flex;align-items:flex-start;justify-content:center;padding:32px}
|
|
1178
|
-
.card{max-width:720px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden}
|
|
1179
|
-
.header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4)}
|
|
1180
|
-
.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}
|
|
1181
|
-
.badge{padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${accent};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2)}
|
|
1182
|
-
.kind{color:#94a3b8;font-size:13px;font-weight:500}
|
|
1183
|
-
.content{padding:24px}
|
|
1184
|
-
.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}
|
|
1185
|
-
.message{margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5}
|
|
1186
|
-
.hint{margin-top:20px;padding:12px 20px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px}
|
|
1187
|
-
</style>
|
|
1188
|
-
</head>
|
|
1189
|
-
<body>
|
|
1190
|
-
<div class="card">
|
|
1191
|
-
<div class="header">
|
|
1192
|
-
<div style="display:flex;align-items:center;gap:12px">
|
|
1193
|
-
<span class="brand">AbsoluteJS</span>
|
|
1194
|
-
<span class="badge">${label}</span>
|
|
1195
|
-
</div>
|
|
1196
|
-
<span class="kind">${kind}</span>
|
|
1197
|
-
</div>
|
|
1198
|
-
<div class="content">
|
|
1199
|
-
<div class="label">What went wrong</div>
|
|
1200
|
-
<pre class="message">${message.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</pre>
|
|
1201
|
-
<div class="hint">${hint}</div>
|
|
1202
|
-
</div>
|
|
1203
|
-
</div>
|
|
1204
|
-
${script}
|
|
1205
|
-
</body>
|
|
1206
|
-
</html>`;
|
|
1207
|
-
}, reloadOnRebuild = () => `<script${nonceAttr()}>(()=>{const url=(location.protocol==='https:'?'wss://':'ws://')+location.host+'/hmr';let seen=false;const connect=()=>{const socket=new WebSocket(url);socket.onopen=()=>{if(seen)location.reload();seen=true;};socket.onmessage=(event)=>{try{const message=JSON.parse(event.data);const type=message&&typeof message.type==='string'?message.type:'';if(type==='rebuild-complete'||type==='server-entry-reloaded'||type.endsWith('-update'))location.reload();}catch{}};socket.onclose=()=>setTimeout(connect,500);};connect();})();</script>`, buildErrorPage = (framework, pageName, error) => errorPageHtml({
|
|
1208
|
-
framework,
|
|
1209
|
-
hint: "Fix the file and save. This page reloads by itself when the build succeeds.",
|
|
1210
|
-
kind: "Build Error",
|
|
1211
|
-
message: `${pageName || "This page"} could not be built.
|
|
1212
|
-
|
|
1213
|
-
${error ?? "The dev-server terminal has the build output."}`,
|
|
1214
|
-
script: reloadOnRebuild()
|
|
1215
|
-
}), ssrErrorPage = (framework, error) => errorPageHtml({
|
|
1216
|
-
framework,
|
|
1217
|
-
hint: "A component threw during server-side rendering. Check the terminal for the full stack trace.",
|
|
1218
|
-
kind: "Server Render Error",
|
|
1219
|
-
message: error instanceof Error ? error.message : String(error)
|
|
1220
|
-
});
|
|
1221
|
-
var init_ssrErrorPage = __esm(() => {
|
|
1222
|
-
init_cspNonceRef();
|
|
1223
|
-
});
|
|
1224
|
-
|
|
1225
1269
|
// src/core/requestContext.ts
|
|
1226
1270
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
1227
1271
|
import { Elysia as Elysia2 } from "elysia";
|
|
@@ -1235,7 +1279,14 @@ var REQUEST_STORAGE_KEY, PAGE_WARMER_KEY, isAbsoluteRequestStorage = (value) =>
|
|
|
1235
1279
|
const storage = new AsyncLocalStorage2;
|
|
1236
1280
|
Reflect.set(globalThis, REQUEST_STORAGE_KEY, storage);
|
|
1237
1281
|
return storage;
|
|
1238
|
-
}, absoluteRequestContext, getCurrentAbsoluteRequest = () => getRequestStorage()?.getStore()?.request,
|
|
1282
|
+
}, absoluteRequestContext, getCurrentAbsoluteRequest = () => getRequestStorage()?.getStore()?.request, getCurrentAbsoluteRoute = (request) => {
|
|
1283
|
+
const store = getRequestStorage()?.getStore();
|
|
1284
|
+
if (!store)
|
|
1285
|
+
return;
|
|
1286
|
+
if (request && store.request !== request)
|
|
1287
|
+
return;
|
|
1288
|
+
return store.route;
|
|
1289
|
+
}, runWithAbsoluteRequest = (request, callback) => ensureRequestStorage().run({ request }, callback), CSS_KEY_RE, isDevPageWarmer = (value) => typeof value === "object" && value !== null && ("describe" in value) && typeof value.describe === "function" && ("warm" in value) && typeof value.warm === "function" && ("lookup" in value) && typeof value.lookup === "function", devBuildErrorResponse = (framework, assets) => {
|
|
1239
1290
|
if (!assets?.failed)
|
|
1240
1291
|
return null;
|
|
1241
1292
|
return new Response(buildErrorPage(framework, assets.name, assets.error), {
|
|
@@ -1301,6 +1352,11 @@ var init_requestContext = __esm(() => {
|
|
|
1301
1352
|
name: "absolutejs-request-context"
|
|
1302
1353
|
}).onRequest(({ request }) => {
|
|
1303
1354
|
ensureRequestStorage().enterWith({ request });
|
|
1355
|
+
}).onBeforeHandle(({ request, route }) => {
|
|
1356
|
+
const store = getRequestStorage()?.getStore();
|
|
1357
|
+
if (store && store.request === request && typeof route === "string") {
|
|
1358
|
+
store.route = route;
|
|
1359
|
+
}
|
|
1304
1360
|
}).as("global");
|
|
1305
1361
|
CSS_KEY_RE = /(?:CSS|Css)$/;
|
|
1306
1362
|
});
|
|
@@ -2907,10 +2963,10 @@ init_cspNonceRef();
|
|
|
2907
2963
|
init_escapeScriptContent();
|
|
2908
2964
|
var SERVER_DATA_CONTEXT_KEY = "__absoluteServerData";
|
|
2909
2965
|
var SERVER_DATA_GLOBAL = "__ABSOLUTE_SERVER_DATA__";
|
|
2910
|
-
var
|
|
2966
|
+
var GENERIC_ERROR_MESSAGE2 = "Loading server data failed.";
|
|
2911
2967
|
var toPublicError = (cause) => {
|
|
2912
2968
|
const detail = cause instanceof Error ? cause.message : String(cause);
|
|
2913
|
-
const publicError = new Error(isProductionRuntime() ?
|
|
2969
|
+
const publicError = new Error(isProductionRuntime() ? GENERIC_ERROR_MESSAGE2 : detail);
|
|
2914
2970
|
publicError.name = cause instanceof Error ? cause.name : "Error";
|
|
2915
2971
|
return publicError;
|
|
2916
2972
|
};
|
|
@@ -3221,5 +3277,5 @@ export {
|
|
|
3221
3277
|
handleVuePageRequest
|
|
3222
3278
|
};
|
|
3223
3279
|
|
|
3224
|
-
//# debugId=
|
|
3280
|
+
//# debugId=F9CA11A69DA611AC64756E2164756E21
|
|
3225
3281
|
//# sourceMappingURL=server.js.map
|