@absolutejs/absolute 0.20.0-beta.127 → 0.20.0-beta.128
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 +9 -0
- package/changelog.json +20 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +54 -7
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +54 -7
- package/dist/angular/server.js.map +5 -5
- package/dist/build.js +134 -64
- package/dist/build.js.map +10 -9
- package/dist/cli/config/server.js +91 -52
- package/dist/index.js +135 -64
- package/dist/index.js.map +10 -9
- package/dist/react/index.js +105 -58
- package/dist/react/index.js.map +6 -6
- package/dist/react/server.js +105 -58
- package/dist/react/server.js.map +6 -6
- package/dist/src/core/requestContext.d.ts +5 -10
- package/dist/src/dev/restartScope.d.ts +1 -0
- package/dist/src/utils/ssrErrorPage.d.ts +3 -0
- package/dist/svelte/index.js +105 -58
- package/dist/svelte/index.js.map +6 -6
- package/dist/svelte/server.js +105 -58
- package/dist/svelte/server.js.map +6 -6
- package/dist/vue/index.js +105 -58
- package/dist/vue/index.js.map +6 -6
- package/dist/vue/server.js +105 -58
- package/dist/vue/server.js.map +6 -6
- package/package.json +1 -1
package/dist/vue/index.js
CHANGED
|
@@ -855,7 +855,96 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
855
855
|
pageHandlerWrappers = new WeakMap;
|
|
856
856
|
});
|
|
857
857
|
|
|
858
|
+
// src/utils/ssrErrorPage.ts
|
|
859
|
+
var exports_ssrErrorPage = {};
|
|
860
|
+
__export(exports_ssrErrorPage, {
|
|
861
|
+
buildErrorPage: () => buildErrorPage,
|
|
862
|
+
ssrErrorPage: () => ssrErrorPage
|
|
863
|
+
});
|
|
864
|
+
var errorPageHtml = ({
|
|
865
|
+
framework,
|
|
866
|
+
hint,
|
|
867
|
+
kind,
|
|
868
|
+
message,
|
|
869
|
+
script = ""
|
|
870
|
+
}) => {
|
|
871
|
+
const frameworkColors = {
|
|
872
|
+
angular: "#dd0031",
|
|
873
|
+
html: "#e34c26",
|
|
874
|
+
htmx: "#1a365d",
|
|
875
|
+
react: "#61dafb",
|
|
876
|
+
svelte: "#ff3e00",
|
|
877
|
+
vue: "#42b883"
|
|
878
|
+
};
|
|
879
|
+
const accent = frameworkColors[framework] ?? "#94a3b8";
|
|
880
|
+
const label = framework.charAt(0).toUpperCase() + framework.slice(1);
|
|
881
|
+
return `<!DOCTYPE html>
|
|
882
|
+
<html>
|
|
883
|
+
<head>
|
|
884
|
+
<meta charset="utf-8">
|
|
885
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
886
|
+
<title>SSR Error - AbsoluteJS</title>
|
|
887
|
+
<style>
|
|
888
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
889
|
+
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}
|
|
890
|
+
.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}
|
|
891
|
+
.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)}
|
|
892
|
+
.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}
|
|
893
|
+
.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)}
|
|
894
|
+
.kind{color:#94a3b8;font-size:13px;font-weight:500}
|
|
895
|
+
.content{padding:24px}
|
|
896
|
+
.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}
|
|
897
|
+
.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}
|
|
898
|
+
.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}
|
|
899
|
+
</style>
|
|
900
|
+
</head>
|
|
901
|
+
<body>
|
|
902
|
+
<div class="card">
|
|
903
|
+
<div class="header">
|
|
904
|
+
<div style="display:flex;align-items:center;gap:12px">
|
|
905
|
+
<span class="brand">AbsoluteJS</span>
|
|
906
|
+
<span class="badge">${label}</span>
|
|
907
|
+
</div>
|
|
908
|
+
<span class="kind">${kind}</span>
|
|
909
|
+
</div>
|
|
910
|
+
<div class="content">
|
|
911
|
+
<div class="label">What went wrong</div>
|
|
912
|
+
<pre class="message">${message.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</pre>
|
|
913
|
+
<div class="hint">${hint}</div>
|
|
914
|
+
</div>
|
|
915
|
+
</div>
|
|
916
|
+
${script}
|
|
917
|
+
</body>
|
|
918
|
+
</html>`;
|
|
919
|
+
}, RELOAD_ON_REBUILD = `<script>(()=>{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({
|
|
920
|
+
framework,
|
|
921
|
+
hint: "Fix the file and save. This page reloads by itself when the build succeeds.",
|
|
922
|
+
kind: "Build Error",
|
|
923
|
+
message: `${pageName || "This page"} could not be built.
|
|
924
|
+
|
|
925
|
+
${error ?? "The dev-server terminal has the build output."}`,
|
|
926
|
+
script: RELOAD_ON_REBUILD
|
|
927
|
+
}), ssrErrorPage = (framework, error) => errorPageHtml({
|
|
928
|
+
framework,
|
|
929
|
+
hint: "A component threw during server-side rendering. Check the terminal for the full stack trace.",
|
|
930
|
+
kind: "Server Render Error",
|
|
931
|
+
message: error instanceof Error ? error.message : String(error)
|
|
932
|
+
});
|
|
933
|
+
|
|
858
934
|
// src/core/requestContext.ts
|
|
935
|
+
var exports_requestContext = {};
|
|
936
|
+
__export(exports_requestContext, {
|
|
937
|
+
absoluteRequestContext: () => absoluteRequestContext,
|
|
938
|
+
devBuildErrorResponse: () => devBuildErrorResponse,
|
|
939
|
+
getCurrentAbsoluteRequest: () => getCurrentAbsoluteRequest,
|
|
940
|
+
getDevPageWarmer: () => getDevPageWarmer,
|
|
941
|
+
getMissingAssets: () => getMissingAssets,
|
|
942
|
+
recordMissingAsset: () => recordMissingAsset,
|
|
943
|
+
resolveDeferredPageAssets: () => resolveDeferredPageAssets,
|
|
944
|
+
runWithAbsoluteRequest: () => runWithAbsoluteRequest,
|
|
945
|
+
setDevPageWarmer: () => setDevPageWarmer,
|
|
946
|
+
withDeferredStylesheets: () => withDeferredStylesheets
|
|
947
|
+
});
|
|
859
948
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
860
949
|
import { Elysia as Elysia2 } from "elysia";
|
|
861
950
|
var REQUEST_STORAGE_KEY, PAGE_WARMER_KEY, isAbsoluteRequestStorage = (value) => typeof value === "object" && value !== null && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", getRequestStorage = () => {
|
|
@@ -868,7 +957,17 @@ var REQUEST_STORAGE_KEY, PAGE_WARMER_KEY, isAbsoluteRequestStorage = (value) =>
|
|
|
868
957
|
const storage = new AsyncLocalStorage2;
|
|
869
958
|
Reflect.set(globalThis, REQUEST_STORAGE_KEY, storage);
|
|
870
959
|
return storage;
|
|
871
|
-
}, absoluteRequestContext, getCurrentAbsoluteRequest = () => getRequestStorage()?.getStore()?.request, 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",
|
|
960
|
+
}, absoluteRequestContext, getCurrentAbsoluteRequest = () => getRequestStorage()?.getStore()?.request, 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) => {
|
|
961
|
+
if (!assets?.failed)
|
|
962
|
+
return null;
|
|
963
|
+
return new Response(buildErrorPage(framework, assets.name, assets.error), {
|
|
964
|
+
headers: {
|
|
965
|
+
"cache-control": "no-store",
|
|
966
|
+
"content-type": "text/html; charset=utf-8"
|
|
967
|
+
},
|
|
968
|
+
status: 500
|
|
969
|
+
});
|
|
970
|
+
}, getDevPageWarmer = () => {
|
|
872
971
|
const value = Reflect.get(globalThis, PAGE_WARMER_KEY);
|
|
873
972
|
return isDevPageWarmer(value) ? value : undefined;
|
|
874
973
|
}, getMissingAssets = () => {
|
|
@@ -898,6 +997,7 @@ var REQUEST_STORAGE_KEY, PAGE_WARMER_KEY, isAbsoluteRequestStorage = (value) =>
|
|
|
898
997
|
const cssHrefs = () => cssKeys.map(lookup).filter((href) => href.length > 0 && href.startsWith("/"));
|
|
899
998
|
const assets = {
|
|
900
999
|
cssHrefs,
|
|
1000
|
+
error: failed ? warmer.lastError?.() : undefined,
|
|
901
1001
|
failed,
|
|
902
1002
|
lookup,
|
|
903
1003
|
name: described.name
|
|
@@ -2155,62 +2255,6 @@ var init_logger = __esm(() => {
|
|
|
2155
2255
|
};
|
|
2156
2256
|
});
|
|
2157
2257
|
|
|
2158
|
-
// src/utils/ssrErrorPage.ts
|
|
2159
|
-
var exports_ssrErrorPage = {};
|
|
2160
|
-
__export(exports_ssrErrorPage, {
|
|
2161
|
-
ssrErrorPage: () => ssrErrorPage
|
|
2162
|
-
});
|
|
2163
|
-
var ssrErrorPage = (framework, error) => {
|
|
2164
|
-
const frameworkColors2 = {
|
|
2165
|
-
angular: "#dd0031",
|
|
2166
|
-
html: "#e34c26",
|
|
2167
|
-
htmx: "#1a365d",
|
|
2168
|
-
react: "#61dafb",
|
|
2169
|
-
svelte: "#ff3e00",
|
|
2170
|
-
vue: "#42b883"
|
|
2171
|
-
};
|
|
2172
|
-
const accent = frameworkColors2[framework] ?? "#94a3b8";
|
|
2173
|
-
const label = framework.charAt(0).toUpperCase() + framework.slice(1);
|
|
2174
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
2175
|
-
return `<!DOCTYPE html>
|
|
2176
|
-
<html>
|
|
2177
|
-
<head>
|
|
2178
|
-
<meta charset="utf-8">
|
|
2179
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
2180
|
-
<title>SSR Error - AbsoluteJS</title>
|
|
2181
|
-
<style>
|
|
2182
|
-
*{margin:0;padding:0;box-sizing:border-box}
|
|
2183
|
-
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}
|
|
2184
|
-
.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}
|
|
2185
|
-
.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)}
|
|
2186
|
-
.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}
|
|
2187
|
-
.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)}
|
|
2188
|
-
.kind{color:#94a3b8;font-size:13px;font-weight:500}
|
|
2189
|
-
.content{padding:24px}
|
|
2190
|
-
.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}
|
|
2191
|
-
.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}
|
|
2192
|
-
.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}
|
|
2193
|
-
</style>
|
|
2194
|
-
</head>
|
|
2195
|
-
<body>
|
|
2196
|
-
<div class="card">
|
|
2197
|
-
<div class="header">
|
|
2198
|
-
<div style="display:flex;align-items:center;gap:12px">
|
|
2199
|
-
<span class="brand">AbsoluteJS</span>
|
|
2200
|
-
<span class="badge">${label}</span>
|
|
2201
|
-
</div>
|
|
2202
|
-
<span class="kind">Server Render Error</span>
|
|
2203
|
-
</div>
|
|
2204
|
-
<div class="content">
|
|
2205
|
-
<div class="label">What went wrong</div>
|
|
2206
|
-
<pre class="message">${message.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</pre>
|
|
2207
|
-
<div class="hint">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>
|
|
2208
|
-
</div>
|
|
2209
|
-
</div>
|
|
2210
|
-
</body>
|
|
2211
|
-
</html>`;
|
|
2212
|
-
};
|
|
2213
|
-
|
|
2214
2258
|
// src/core/routeAssets.ts
|
|
2215
2259
|
var LINK_TAG_RE, REL_STYLESHEET_RE, HREF_RE, TITLE_RE, ENTITIES, ENTITY_RE, decodeEntities = (value) => value.replace(ENTITY_RE, (match) => ENTITIES[match] ?? match), readHeadStylesheets = (head) => {
|
|
2216
2260
|
if (!head)
|
|
@@ -5573,6 +5617,9 @@ var handleVuePageRequest = async (input) => {
|
|
|
5573
5617
|
const request = input.request ?? getCurrentAbsoluteRequest();
|
|
5574
5618
|
const clientMode = input.client ?? "auto";
|
|
5575
5619
|
const deferredAssets = input.pagePath === "" || clientMode === "auto" && input.indexPath === "" ? await resolveDeferredPageAssets() : null;
|
|
5620
|
+
const buildFailure = devBuildErrorResponse("vue", deferredAssets);
|
|
5621
|
+
if (buildFailure)
|
|
5622
|
+
return buildFailure;
|
|
5576
5623
|
const resolvedPagePath = deferredAssets && input.pagePath === "" ? deferredAssets.lookup(deferredAssets.name) : input.pagePath;
|
|
5577
5624
|
const resolvedIndexPath = deferredAssets && input.indexPath === "" ? deferredAssets.lookup(`${deferredAssets.name}Index`) : input.indexPath;
|
|
5578
5625
|
const resolvedOptions = input;
|
|
@@ -6808,5 +6855,5 @@ export {
|
|
|
6808
6855
|
useResource
|
|
6809
6856
|
};
|
|
6810
6857
|
|
|
6811
|
-
//# debugId=
|
|
6858
|
+
//# debugId=FC32D869FEA085E164756E2164756E21
|
|
6812
6859
|
//# sourceMappingURL=index.js.map
|