@absolutejs/absolute 0.20.0-beta.176 → 0.20.0-beta.178
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 +33 -0
- package/changelog.json +62 -0
- package/dist/angular/browser.js +17 -2
- package/dist/angular/browser.js.map +4 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +57 -33
- package/dist/angular/index.js.map +9 -8
- package/dist/angular/server.js +57 -33
- package/dist/angular/server.js.map +9 -8
- package/dist/build.js +532 -416
- package/dist/build.js.map +15 -15
- package/dist/cli/{compile-w2z6c9vt.js → compile-p5yv6ecp.js} +2 -2
- package/dist/cli/config/server.js +45 -12
- package/dist/cli/{dev-8br5mr7t.js → dev-2hbcsvkp.js} +1 -1
- package/dist/cli/{index-420h9hq7.js → index-1ewba8ye.js} +32 -3
- package/dist/cli/{index-7z1hh3fg.js → index-9dzdbbfc.js} +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{islands-bx67g15t.js → islands-6zgb7501.js} +1 -1
- package/dist/cli/{mobile-we5q51ey.js → mobile-c92dh8s2.js} +2 -2
- package/dist/cli/{start-srs11bm8.js → start-asxb79rc.js} +2 -2
- package/dist/cli/{typecheck-7fvww3b7.js → typecheck-m2j4tkdk.js} +165 -35
- package/dist/client/chunks/{index-8m2qq61n.js → index-58svs66p.js} +13 -3
- package/dist/client/chunks/{index-8m2qq61n.js.map → index-58svs66p.js.map} +5 -4
- package/dist/client/chunks/{islands-mfjmdwnb.js → islands-tcadmgcx.js} +3 -6
- package/dist/client/chunks/{islands-mfjmdwnb.js.map → islands-tcadmgcx.js.map} +3 -4
- package/dist/client/chunks/{react-sprprqzs.js → react-khr6ewhr.js} +2 -2
- package/dist/client/index.js +82 -6
- package/dist/client/index.js.map +7 -6
- package/dist/dev/client/handlers/islands.ts +2 -0
- package/dist/dev/client/handlers/react.ts +92 -111
- package/dist/dev/client/handlers/reactUpdateQueue.ts +153 -0
- package/dist/index.js +506 -389
- package/dist/index.js.map +16 -16
- package/dist/islands/browser.js +2 -2
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +13 -6
- package/dist/islands/index.js.map +6 -5
- package/dist/react/browser.js +113 -12
- package/dist/react/browser.js.map +10 -7
- package/dist/react/components/index.js +31 -7
- package/dist/react/components/index.js.map +5 -4
- package/dist/react/components/server/index.js +22 -6
- package/dist/react/index.js +190 -46
- package/dist/react/index.js.map +15 -11
- package/dist/react/server.js +82 -23
- package/dist/react/server.js.map +11 -9
- package/dist/src/build/compileSvelte.d.ts +12 -1
- package/dist/src/build/compileVue.d.ts +1 -0
- package/dist/src/build/islandEntries.d.ts +3 -1
- package/dist/src/cli/scripts/typecheck.d.ts +8 -0
- package/dist/src/cli/scripts/typecheckDiagnostics.d.ts +17 -0
- package/dist/src/client/preserveIslandMarkup.d.ts +4 -0
- package/dist/src/core/islandManifest.d.ts +6 -0
- package/dist/src/core/islandStylesheet.d.ts +17 -0
- package/dist/src/react/Island.d.ts +9 -2
- package/dist/src/react/IslandStyleLink.d.ts +11 -0
- package/dist/src/react/createIsland.d.ts +1 -1
- package/dist/src/react/serverComponents/nodeRendererRef.d.ts +13 -0
- package/dist/src/utils/requestRenderUrl.d.ts +1 -0
- package/dist/src/utils/resolveConvention.d.ts +1 -0
- package/dist/src/vue/Island.browser.d.ts +3 -1
- package/dist/src/vue/Island.d.ts +2 -2
- package/dist/src/vue/createIsland.browser.d.ts +2 -2
- package/dist/src/vue/createIsland.d.ts +2 -2
- package/dist/src/vue/islandStyleLink.d.ts +30 -0
- package/dist/svelte/browser.js +2 -2
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +51 -49
- package/dist/svelte/index.js.map +9 -8
- package/dist/svelte/server.js +48 -45
- package/dist/svelte/server.js.map +8 -7
- package/dist/types/globals.d.ts +3 -0
- package/dist/vue/browser.js +105 -10
- package/dist/vue/browser.js.map +10 -7
- package/dist/vue/index.js +170 -47
- package/dist/vue/index.js.map +14 -11
- package/dist/vue/server.js +81 -22
- package/dist/vue/server.js.map +9 -7
- package/package.json +1 -1
- /package/dist/cli/{index-6522t968.js → index-yd672jyq.js} +0 -0
- /package/dist/client/chunks/{react-sprprqzs.js.map → react-khr6ewhr.js.map} +0 -0
package/dist/vue/server.js
CHANGED
|
@@ -491,6 +491,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
491
491
|
logConventionRenderError(framework, "error", renderError);
|
|
492
492
|
}
|
|
493
493
|
return null;
|
|
494
|
+
}, isPageRequest = (request) => {
|
|
495
|
+
if (request.headers.get("hx-request") === "true")
|
|
496
|
+
return true;
|
|
497
|
+
if (request.headers.get("sec-fetch-dest") === "document")
|
|
498
|
+
return true;
|
|
499
|
+
return (request.headers.get("accept") ?? "").includes("text/html");
|
|
494
500
|
}, renderConventionError = async (framework, pageName, error) => {
|
|
495
501
|
const errorProps = buildErrorProps(error);
|
|
496
502
|
const frameworkResponse = await tryFrameworkErrorConvention(framework, pageName, errorProps, error);
|
|
@@ -502,12 +508,6 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
502
508
|
return htmlResponse;
|
|
503
509
|
}
|
|
504
510
|
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
511
|
}, renderStaticRouteError = async (request, error) => {
|
|
512
512
|
if (!isPageRequest(request))
|
|
513
513
|
return null;
|
|
@@ -927,7 +927,7 @@ var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOO
|
|
|
927
927
|
islands[framework] = entries;
|
|
928
928
|
}
|
|
929
929
|
return islands;
|
|
930
|
-
}, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
|
|
930
|
+
}, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`, ISLAND_STYLE_PREFIX = "IslandStyle", getIslandStyleManifestEntries = (manifest) => Object.entries(manifest).filter(([key]) => key.startsWith(ISLAND_STYLE_PREFIX)), getIslandStyleManifestKey = (framework, component) => `${ISLAND_STYLE_PREFIX}${toIslandFrameworkSegment(framework)}${component}`;
|
|
931
931
|
|
|
932
932
|
// src/core/islandPageContext.ts
|
|
933
933
|
var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST__", ISLAND_STATE_MARKER = "__ABS_ISLAND_STATE__", CLOSING_HEAD_TAG = "</head>", warnedMissingBootstrap = false, warnIfBootstrapMissing = (manifest) => {
|
|
@@ -964,12 +964,27 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
964
964
|
browserManifest[key] = value;
|
|
965
965
|
}
|
|
966
966
|
return browserManifest;
|
|
967
|
-
},
|
|
967
|
+
}, ISLAND_MARKER_TAG, ISLAND_FRAMEWORKS, readMarkerAttribute = (tag, name) => new RegExp(`\\b${name}="([^"]*)"`).exec(tag)?.[1]?.replaceAll(""", '"').replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&"), toIslandFramework = (value) => ISLAND_FRAMEWORKS.find((framework) => framework === value), collectRenderedIslandStyleKeys = (html) => {
|
|
968
|
+
const keys = new Set;
|
|
969
|
+
for (const [tag] of html.matchAll(ISLAND_MARKER_TAG)) {
|
|
970
|
+
const framework = toIslandFramework(readMarkerAttribute(tag, "data-framework"));
|
|
971
|
+
const component = readMarkerAttribute(tag, "data-component");
|
|
972
|
+
if (framework && component)
|
|
973
|
+
keys.add(getIslandStyleManifestKey(framework, component));
|
|
974
|
+
}
|
|
975
|
+
return keys;
|
|
976
|
+
}, buildIslandStyleLinks = (manifest, html) => {
|
|
977
|
+
if (html === undefined)
|
|
978
|
+
return "";
|
|
979
|
+
const renderedKeys = collectRenderedIslandStyleKeys(html);
|
|
980
|
+
return getIslandStyleManifestEntries(manifest).filter(([key]) => renderedKeys.has(key)).filter(([, href]) => !html.includes(`href="${href}"`)).map(([key, href]) => `<link rel="stylesheet" href="${href}" data-island-style="${key}"${nonceAttr()}>`).join("");
|
|
981
|
+
}, buildIslandsHeadMarkup = (manifest, html) => {
|
|
982
|
+
const styleLinks = buildIslandStyleLinks(manifest, html);
|
|
968
983
|
const manifestScript = `<script${nonceAttr()}>window.__ABSOLUTE_MANIFEST__ = ${escapeScriptContent(JSON.stringify(toBrowserManifest(manifest)))}</script>`;
|
|
969
984
|
const islandStateScript = `<script${nonceAttr()}>window.__ABS_ISLAND_STATE__ = ${escapeScriptContent(JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {}))}</script>`;
|
|
970
985
|
const bootstrapPath = getIslandBootstrapPath(manifest);
|
|
971
986
|
const bootstrapScript = bootstrapPath ? `<script${nonceAttr()} type="module" src="${bootstrapPath}"></script>` : "";
|
|
972
|
-
return `${manifestScript}${islandStateScript}${bootstrapScript}`;
|
|
987
|
+
return `${styleLinks}${manifestScript}${islandStateScript}${bootstrapScript}`;
|
|
973
988
|
}, injectHeadMarkup = (html, markup) => {
|
|
974
989
|
const closingHeadIndex = html.indexOf("</head>");
|
|
975
990
|
if (closingHeadIndex >= 0) {
|
|
@@ -1151,7 +1166,7 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
1151
1166
|
return html;
|
|
1152
1167
|
}
|
|
1153
1168
|
warnIfBootstrapMissing(manifest);
|
|
1154
|
-
return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest));
|
|
1169
|
+
return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest, html));
|
|
1155
1170
|
}, injectIslandPageContextStream = (stream, options) => {
|
|
1156
1171
|
const manifest = globalThis.__absoluteManifest;
|
|
1157
1172
|
if (!manifest)
|
|
@@ -1175,6 +1190,13 @@ var init_islandPageContext = __esm(() => {
|
|
|
1175
1190
|
init_logger();
|
|
1176
1191
|
MANIFEST_BUILD_DIR_KEY = Symbol.for("absolutejs.islandManifestBuildDir");
|
|
1177
1192
|
WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
|
|
1193
|
+
ISLAND_MARKER_TAG = /<[^>]*\bdata-island="true"[^>]*>/g;
|
|
1194
|
+
ISLAND_FRAMEWORKS = [
|
|
1195
|
+
"react",
|
|
1196
|
+
"svelte",
|
|
1197
|
+
"vue",
|
|
1198
|
+
"angular"
|
|
1199
|
+
];
|
|
1178
1200
|
});
|
|
1179
1201
|
|
|
1180
1202
|
// src/core/devRouteRegistrationCallsite.ts
|
|
@@ -2656,6 +2678,18 @@ var init_buildHMRClient = __esm(() => {
|
|
|
2656
2678
|
hmrClientPath = resolveHmrClientPath();
|
|
2657
2679
|
});
|
|
2658
2680
|
|
|
2681
|
+
// src/utils/requestRenderUrl.ts
|
|
2682
|
+
var requestRenderUrl = (request) => {
|
|
2683
|
+
if (!request)
|
|
2684
|
+
return;
|
|
2685
|
+
try {
|
|
2686
|
+
const parsed = new URL(request.url);
|
|
2687
|
+
return `${parsed.pathname.replace(/\/{2,}/g, "/")}${parsed.search}`;
|
|
2688
|
+
} catch {
|
|
2689
|
+
return;
|
|
2690
|
+
}
|
|
2691
|
+
};
|
|
2692
|
+
|
|
2659
2693
|
// src/vue/pageHandler.ts
|
|
2660
2694
|
init_escapeScriptContent();
|
|
2661
2695
|
init_cspNonceRef();
|
|
@@ -2663,6 +2697,38 @@ init_inlinePageCss();
|
|
|
2663
2697
|
init_spaRouteCss();
|
|
2664
2698
|
init_spaRouteManifest();
|
|
2665
2699
|
init_islandPageContext();
|
|
2700
|
+
|
|
2701
|
+
// src/core/islandStylesheet.ts
|
|
2702
|
+
init_cspNonceRef();
|
|
2703
|
+
var INLINE_ISLAND_STYLES_CONTEXT_KEY = "__absoluteInlineIslandStyles";
|
|
2704
|
+
var ISLAND_STYLE_PRECEDENCE = "absolute-islands";
|
|
2705
|
+
var ISLAND_FRAMEWORKS2 = [
|
|
2706
|
+
"react",
|
|
2707
|
+
"svelte",
|
|
2708
|
+
"vue",
|
|
2709
|
+
"angular"
|
|
2710
|
+
];
|
|
2711
|
+
var toIslandFramework2 = (value) => ISLAND_FRAMEWORKS2.find((framework) => framework === value);
|
|
2712
|
+
var readIslandManifest = () => {
|
|
2713
|
+
const manifest = typeof window === "undefined" ? Reflect.get(globalThis, "__absoluteManifest") : Reflect.get(window, "__ABSOLUTE_MANIFEST__");
|
|
2714
|
+
return typeof manifest === "object" && manifest !== null ? manifest : undefined;
|
|
2715
|
+
};
|
|
2716
|
+
var findIslandStylesheet = (framework, component) => {
|
|
2717
|
+
const islandFramework = toIslandFramework2(framework);
|
|
2718
|
+
const manifest = readIslandManifest();
|
|
2719
|
+
if (!islandFramework || !manifest)
|
|
2720
|
+
return;
|
|
2721
|
+
const key = getIslandStyleManifestKey(islandFramework, component);
|
|
2722
|
+
const href = Reflect.get(manifest, key);
|
|
2723
|
+
return typeof href === "string" ? { href, key } : undefined;
|
|
2724
|
+
};
|
|
2725
|
+
var readIslandStyleNonce = () => {
|
|
2726
|
+
if (typeof document === "undefined")
|
|
2727
|
+
return readCspNonce() ?? "";
|
|
2728
|
+
return Array.from(document.querySelectorAll("script[nonce]")).find((element) => element.nonce)?.nonce ?? "";
|
|
2729
|
+
};
|
|
2730
|
+
|
|
2731
|
+
// src/vue/pageHandler.ts
|
|
2666
2732
|
init_devRouteRegistrationCallsite();
|
|
2667
2733
|
init_requestContext();
|
|
2668
2734
|
init_pageProtocol();
|
|
@@ -3065,16 +3131,7 @@ var readSetupAppHook = (value) => {
|
|
|
3065
3131
|
};
|
|
3066
3132
|
var readHasSpaRoutes = (value) => isRecord4(value) && Array.isArray(value["routes"]);
|
|
3067
3133
|
var readDefaultExport = (value) => isRecord4(value) ? value.default : undefined;
|
|
3068
|
-
var resolveRequestRenderUrl = (request) =>
|
|
3069
|
-
if (!request)
|
|
3070
|
-
return "/";
|
|
3071
|
-
try {
|
|
3072
|
-
const parsed = new URL(request.url);
|
|
3073
|
-
return `${parsed.pathname}${parsed.search}`;
|
|
3074
|
-
} catch {
|
|
3075
|
-
return "/";
|
|
3076
|
-
}
|
|
3077
|
-
};
|
|
3134
|
+
var resolveRequestRenderUrl = (request) => requestRenderUrl(request) ?? "/";
|
|
3078
3135
|
var primeVueStream = async (stream) => {
|
|
3079
3136
|
const reader = stream.getReader();
|
|
3080
3137
|
const firstChunk = await reader.read();
|
|
@@ -3230,10 +3287,12 @@ var handleVuePageRequest = async (input) => {
|
|
|
3230
3287
|
}
|
|
3231
3288
|
if (resolvedOptions?.collectStreamingSlots !== true) {
|
|
3232
3289
|
const body = await renderToString(app, ssrContext);
|
|
3233
|
-
|
|
3290
|
+
const html = injectIslandPageContext(`${head}${body}${buildTail()}`, { hasIslands: resolvedPage.hasIslands ? true : undefined });
|
|
3291
|
+
return new Response(html, {
|
|
3234
3292
|
headers: streamingPageHeaders()
|
|
3235
3293
|
});
|
|
3236
3294
|
}
|
|
3295
|
+
ssrContext[INLINE_ISLAND_STYLES_CONTEXT_KEY] = new Set;
|
|
3237
3296
|
const bodyStream = renderToWebStream(app, ssrContext);
|
|
3238
3297
|
const { firstChunk, reader } = await primeVueStream(bodyStream);
|
|
3239
3298
|
const stream = new ReadableStream({
|
|
@@ -3304,5 +3363,5 @@ export {
|
|
|
3304
3363
|
handleVuePageRequest
|
|
3305
3364
|
};
|
|
3306
3365
|
|
|
3307
|
-
//# debugId=
|
|
3366
|
+
//# debugId=E3D78E81B54F74EC64756E2164756E21
|
|
3308
3367
|
//# sourceMappingURL=server.js.map
|