@absolutejs/absolute 0.20.0-beta.177 → 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 +26 -0
- package/changelog.json +51 -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 +505 -389
- package/dist/index.js.map +15 -15
- 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/index.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
|
|
@@ -4946,9 +4968,9 @@ var createVueCompiler = async () => {
|
|
|
4946
4968
|
// src/core/vueServerModule.ts
|
|
4947
4969
|
import { readFileSync as readFileSync7, realpathSync } from "fs";
|
|
4948
4970
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
4949
|
-
import { dirname as dirname7, join as join9, relative as relative4, resolve as resolve7 } from "path";
|
|
4971
|
+
import { basename as basename5, dirname as dirname7, join as join9, relative as relative4, resolve as resolve7 } from "path";
|
|
4950
4972
|
var {Transpiler } = globalThis.Bun;
|
|
4951
|
-
var
|
|
4973
|
+
var serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
4952
4974
|
const importPath = relative4(dirname7(from), target).replace(/\\/g, "/");
|
|
4953
4975
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
4954
4976
|
}, getCachedModulePath3 = (sourcePath) => {
|
|
@@ -4990,7 +5012,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
|
|
|
4990
5012
|
const compiler = await loadVueCompiler();
|
|
4991
5013
|
const source = await Bun.file(sourcePath).text();
|
|
4992
5014
|
const { descriptor } = compiler.parse(source, { filename: sourcePath });
|
|
4993
|
-
const componentId =
|
|
5015
|
+
const componentId = toKebab(basename5(sourcePath, ".vue"));
|
|
4994
5016
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
4995
5017
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
4996
5018
|
fs: {
|
|
@@ -5040,7 +5062,6 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
|
|
|
5040
5062
|
return compiledModulePath;
|
|
5041
5063
|
};
|
|
5042
5064
|
var init_vueServerModule = __esm(() => {
|
|
5043
|
-
init_constants();
|
|
5044
5065
|
init_isFile();
|
|
5045
5066
|
serverCacheRoot3 = join9(process.cwd(), ".absolutejs", "islands", "vue");
|
|
5046
5067
|
compiledModuleCache3 = new Map;
|
|
@@ -5209,6 +5230,18 @@ var init_renderIslandMarkup = __esm(() => {
|
|
|
5209
5230
|
});
|
|
5210
5231
|
});
|
|
5211
5232
|
|
|
5233
|
+
// src/utils/requestRenderUrl.ts
|
|
5234
|
+
var requestRenderUrl = (request) => {
|
|
5235
|
+
if (!request)
|
|
5236
|
+
return;
|
|
5237
|
+
try {
|
|
5238
|
+
const parsed = new URL(request.url);
|
|
5239
|
+
return `${parsed.pathname.replace(/\/{2,}/g, "/")}${parsed.search}`;
|
|
5240
|
+
} catch {
|
|
5241
|
+
return;
|
|
5242
|
+
}
|
|
5243
|
+
};
|
|
5244
|
+
|
|
5212
5245
|
// src/vue/pageHandler.ts
|
|
5213
5246
|
init_escapeScriptContent();
|
|
5214
5247
|
init_cspNonceRef();
|
|
@@ -5216,6 +5249,38 @@ init_inlinePageCss();
|
|
|
5216
5249
|
init_spaRouteCss();
|
|
5217
5250
|
init_spaRouteManifest();
|
|
5218
5251
|
init_islandPageContext();
|
|
5252
|
+
|
|
5253
|
+
// src/core/islandStylesheet.ts
|
|
5254
|
+
init_cspNonceRef();
|
|
5255
|
+
var INLINE_ISLAND_STYLES_CONTEXT_KEY = "__absoluteInlineIslandStyles";
|
|
5256
|
+
var ISLAND_STYLE_PRECEDENCE = "absolute-islands";
|
|
5257
|
+
var ISLAND_FRAMEWORKS2 = [
|
|
5258
|
+
"react",
|
|
5259
|
+
"svelte",
|
|
5260
|
+
"vue",
|
|
5261
|
+
"angular"
|
|
5262
|
+
];
|
|
5263
|
+
var toIslandFramework2 = (value) => ISLAND_FRAMEWORKS2.find((framework) => framework === value);
|
|
5264
|
+
var readIslandManifest = () => {
|
|
5265
|
+
const manifest = typeof window === "undefined" ? Reflect.get(globalThis, "__absoluteManifest") : Reflect.get(window, "__ABSOLUTE_MANIFEST__");
|
|
5266
|
+
return typeof manifest === "object" && manifest !== null ? manifest : undefined;
|
|
5267
|
+
};
|
|
5268
|
+
var findIslandStylesheet = (framework, component) => {
|
|
5269
|
+
const islandFramework = toIslandFramework2(framework);
|
|
5270
|
+
const manifest = readIslandManifest();
|
|
5271
|
+
if (!islandFramework || !manifest)
|
|
5272
|
+
return;
|
|
5273
|
+
const key = getIslandStyleManifestKey(islandFramework, component);
|
|
5274
|
+
const href = Reflect.get(manifest, key);
|
|
5275
|
+
return typeof href === "string" ? { href, key } : undefined;
|
|
5276
|
+
};
|
|
5277
|
+
var readIslandStyleNonce = () => {
|
|
5278
|
+
if (typeof document === "undefined")
|
|
5279
|
+
return readCspNonce() ?? "";
|
|
5280
|
+
return Array.from(document.querySelectorAll("script[nonce]")).find((element) => element.nonce)?.nonce ?? "";
|
|
5281
|
+
};
|
|
5282
|
+
|
|
5283
|
+
// src/vue/pageHandler.ts
|
|
5219
5284
|
init_devRouteRegistrationCallsite();
|
|
5220
5285
|
init_requestContext();
|
|
5221
5286
|
init_pageProtocol();
|
|
@@ -5618,16 +5683,7 @@ var readSetupAppHook = (value) => {
|
|
|
5618
5683
|
};
|
|
5619
5684
|
var readHasSpaRoutes = (value) => isRecord4(value) && Array.isArray(value["routes"]);
|
|
5620
5685
|
var readDefaultExport = (value) => isRecord4(value) ? value.default : undefined;
|
|
5621
|
-
var resolveRequestRenderUrl = (request) =>
|
|
5622
|
-
if (!request)
|
|
5623
|
-
return "/";
|
|
5624
|
-
try {
|
|
5625
|
-
const parsed = new URL(request.url);
|
|
5626
|
-
return `${parsed.pathname}${parsed.search}`;
|
|
5627
|
-
} catch {
|
|
5628
|
-
return "/";
|
|
5629
|
-
}
|
|
5630
|
-
};
|
|
5686
|
+
var resolveRequestRenderUrl = (request) => requestRenderUrl(request) ?? "/";
|
|
5631
5687
|
var primeVueStream = async (stream) => {
|
|
5632
5688
|
const reader = stream.getReader();
|
|
5633
5689
|
const firstChunk = await reader.read();
|
|
@@ -5783,10 +5839,12 @@ var handleVuePageRequest = async (input) => {
|
|
|
5783
5839
|
}
|
|
5784
5840
|
if (resolvedOptions?.collectStreamingSlots !== true) {
|
|
5785
5841
|
const body = await renderToString(app, ssrContext);
|
|
5786
|
-
|
|
5842
|
+
const html = injectIslandPageContext(`${head}${body}${buildTail()}`, { hasIslands: resolvedPage.hasIslands ? true : undefined });
|
|
5843
|
+
return new Response(html, {
|
|
5787
5844
|
headers: streamingPageHeaders()
|
|
5788
5845
|
});
|
|
5789
5846
|
}
|
|
5847
|
+
ssrContext[INLINE_ISLAND_STYLES_CONTEXT_KEY] = new Set;
|
|
5790
5848
|
const bodyStream = renderToWebStream(app, ssrContext);
|
|
5791
5849
|
const { firstChunk, reader } = await primeVueStream(bodyStream);
|
|
5792
5850
|
const stream = new ReadableStream({
|
|
@@ -5856,7 +5914,12 @@ var applyVueRouterRedirect = (router, requestedUrl, setRedirect, status = DEFAUL
|
|
|
5856
5914
|
var defineRoutes = (routes) => routes;
|
|
5857
5915
|
var defineVueSetupApp = (hook) => hook;
|
|
5858
5916
|
// src/vue/Island.ts
|
|
5859
|
-
import {
|
|
5917
|
+
import {
|
|
5918
|
+
defineComponent,
|
|
5919
|
+
h as h2,
|
|
5920
|
+
onServerPrefetch,
|
|
5921
|
+
useSSRContext
|
|
5922
|
+
} from "vue";
|
|
5860
5923
|
|
|
5861
5924
|
// src/client/preserveIslandMarkup.ts
|
|
5862
5925
|
init_islandMarkupAttributes();
|
|
@@ -5910,6 +5973,21 @@ var preserveIslandMarkup = (props) => {
|
|
|
5910
5973
|
innerHTML: liveCandidate.innerHTML
|
|
5911
5974
|
};
|
|
5912
5975
|
};
|
|
5976
|
+
var claimedServerIslands = new WeakSet;
|
|
5977
|
+
var claimServerIslandStyleLink = (props) => {
|
|
5978
|
+
if (typeof document === "undefined")
|
|
5979
|
+
return null;
|
|
5980
|
+
const element = Array.from(document.querySelectorAll('[data-island="true"]')).find((candidate) => !claimedServerIslands.has(candidate) && isMatchingIslandElement(candidate, props));
|
|
5981
|
+
if (!element)
|
|
5982
|
+
return null;
|
|
5983
|
+
claimedServerIslands.add(element);
|
|
5984
|
+
const previous = element.previousSibling;
|
|
5985
|
+
if (!(previous instanceof HTMLLinkElement))
|
|
5986
|
+
return null;
|
|
5987
|
+
const key = previous.dataset.islandStyle;
|
|
5988
|
+
const href = previous.getAttribute("href");
|
|
5989
|
+
return key && href ? { href, key } : null;
|
|
5990
|
+
};
|
|
5913
5991
|
var innerHtmlObjects = new Map;
|
|
5914
5992
|
var getStableInnerHtml = (html) => {
|
|
5915
5993
|
const existing = innerHtmlObjects.get(html);
|
|
@@ -5925,7 +6003,7 @@ init_islandMarkupAttributes();
|
|
|
5925
6003
|
|
|
5926
6004
|
// src/core/normalizeIslandProps.ts
|
|
5927
6005
|
var EMPTY_PROPS = {};
|
|
5928
|
-
var
|
|
6006
|
+
var ISLAND_FRAMEWORKS3 = [
|
|
5929
6007
|
"react",
|
|
5930
6008
|
"svelte",
|
|
5931
6009
|
"vue",
|
|
@@ -5938,7 +6016,7 @@ var ISLAND_HYDRATE_MODES = [
|
|
|
5938
6016
|
"visible",
|
|
5939
6017
|
"none"
|
|
5940
6018
|
];
|
|
5941
|
-
var isIslandFramework = (value) =>
|
|
6019
|
+
var isIslandFramework = (value) => ISLAND_FRAMEWORKS3.some((framework) => framework === value);
|
|
5942
6020
|
var isIslandHydrate = (value) => ISLAND_HYDRATE_MODES.some((mode) => mode === value);
|
|
5943
6021
|
var normalizeRuntimeIslandRenderProps = (raw) => {
|
|
5944
6022
|
const { component, framework, hydrate, props } = raw;
|
|
@@ -5977,6 +6055,40 @@ var normalizeIslandProps = (value) => {
|
|
|
5977
6055
|
|
|
5978
6056
|
// src/vue/Island.ts
|
|
5979
6057
|
init_renderIslandMarkup();
|
|
6058
|
+
|
|
6059
|
+
// src/vue/islandStyleLink.ts
|
|
6060
|
+
import { h } from "vue";
|
|
6061
|
+
var readInlineStyleKeys = (ssrContext) => {
|
|
6062
|
+
if (typeof ssrContext !== "object" || ssrContext === null)
|
|
6063
|
+
return;
|
|
6064
|
+
const keys = Reflect.get(ssrContext, INLINE_ISLAND_STYLES_CONTEXT_KEY);
|
|
6065
|
+
return keys instanceof Set ? keys : undefined;
|
|
6066
|
+
};
|
|
6067
|
+
var claimInlineIslandStyleLink = (ssrContext, props) => {
|
|
6068
|
+
const claimed = readInlineStyleKeys(ssrContext);
|
|
6069
|
+
const stylesheet = claimed ? findIslandStylesheet(props.framework, props.component) : undefined;
|
|
6070
|
+
if (!claimed || !stylesheet || claimed.has(stylesheet.key))
|
|
6071
|
+
return null;
|
|
6072
|
+
claimed.add(stylesheet.key);
|
|
6073
|
+
const nonce = readIslandStyleNonce();
|
|
6074
|
+
return {
|
|
6075
|
+
"data-island-style": stylesheet.key,
|
|
6076
|
+
href: stylesheet.href,
|
|
6077
|
+
...nonce ? { nonce } : {},
|
|
6078
|
+
rel: "stylesheet"
|
|
6079
|
+
};
|
|
6080
|
+
};
|
|
6081
|
+
var hydratedIslandStyleLink = (props) => {
|
|
6082
|
+
const link = claimServerIslandStyleLink(props);
|
|
6083
|
+
return link ? {
|
|
6084
|
+
"data-island-style": link.key,
|
|
6085
|
+
href: link.href,
|
|
6086
|
+
rel: "stylesheet"
|
|
6087
|
+
} : null;
|
|
6088
|
+
};
|
|
6089
|
+
var withIslandStyleLink = (link, island) => link ? [h("link", link), island] : island;
|
|
6090
|
+
|
|
6091
|
+
// src/vue/Island.ts
|
|
5980
6092
|
var defineRuntimeIslandComponent = (setup) => defineComponent({
|
|
5981
6093
|
name: "AbsoluteIsland",
|
|
5982
6094
|
props: {
|
|
@@ -6001,25 +6113,33 @@ var defineRuntimeIslandComponent = (setup) => defineComponent({
|
|
|
6001
6113
|
});
|
|
6002
6114
|
var Island = defineRuntimeIslandComponent((props) => {
|
|
6003
6115
|
const isBrowser = typeof window !== "undefined";
|
|
6116
|
+
const ssrContext = isBrowser ? undefined : useSSRContext();
|
|
6004
6117
|
let markerAttributes = getIslandMarkerAttributes(props);
|
|
6005
6118
|
let html = "";
|
|
6119
|
+
let styleLink = isBrowser ? hydratedIslandStyleLink(props) : null;
|
|
6006
6120
|
onServerPrefetch(async () => {
|
|
6007
6121
|
const result = await renderIslandResult(requireCurrentIslandRegistry(), props);
|
|
6008
6122
|
({ attributes: markerAttributes, html } = result);
|
|
6123
|
+
styleLink = claimInlineIslandStyleLink(ssrContext, props);
|
|
6009
6124
|
});
|
|
6010
6125
|
return () => {
|
|
6011
6126
|
const preserved = isBrowser ? preserveIslandMarkup(props) : null;
|
|
6012
|
-
return
|
|
6127
|
+
return withIslandStyleLink(styleLink, h2("div", {
|
|
6013
6128
|
...preserved?.attributes ?? markerAttributes,
|
|
6014
6129
|
"data-allow-mismatch": "",
|
|
6015
6130
|
innerHTML: isBrowser ? preserved?.innerHTML : html
|
|
6016
|
-
});
|
|
6131
|
+
}));
|
|
6017
6132
|
};
|
|
6018
6133
|
});
|
|
6019
6134
|
// src/vue/createIsland.ts
|
|
6020
6135
|
init_islandMarkupAttributes();
|
|
6021
6136
|
init_renderIslandMarkup();
|
|
6022
|
-
import {
|
|
6137
|
+
import {
|
|
6138
|
+
defineComponent as defineComponent2,
|
|
6139
|
+
h as h3,
|
|
6140
|
+
onServerPrefetch as onServerPrefetch2,
|
|
6141
|
+
useSSRContext as useSSRContext2
|
|
6142
|
+
} from "vue";
|
|
6023
6143
|
var defineRuntimeIslandComponent2 = (setup) => defineComponent2({
|
|
6024
6144
|
name: "AbsoluteIsland",
|
|
6025
6145
|
props: {
|
|
@@ -6044,17 +6164,20 @@ var defineRuntimeIslandComponent2 = (setup) => defineComponent2({
|
|
|
6044
6164
|
});
|
|
6045
6165
|
var createTypedIsland = (registry) => defineRuntimeIslandComponent2((props) => {
|
|
6046
6166
|
const isBrowser = typeof window !== "undefined";
|
|
6167
|
+
const ssrContext = isBrowser ? undefined : useSSRContext2();
|
|
6047
6168
|
let markerAttributes = getIslandMarkerAttributes(props);
|
|
6048
6169
|
let html = "";
|
|
6170
|
+
let styleLink = isBrowser ? hydratedIslandStyleLink(props) : null;
|
|
6049
6171
|
onServerPrefetch2(async () => {
|
|
6050
6172
|
const result = await renderIslandResult(registry, props);
|
|
6051
6173
|
({ attributes: markerAttributes, html } = result);
|
|
6174
|
+
styleLink = claimInlineIslandStyleLink(ssrContext, props);
|
|
6052
6175
|
});
|
|
6053
|
-
return () =>
|
|
6176
|
+
return () => withIslandStyleLink(styleLink, h3("div", {
|
|
6054
6177
|
...markerAttributes,
|
|
6055
6178
|
"data-allow-mismatch": "",
|
|
6056
6179
|
innerHTML: isBrowser ? undefined : html
|
|
6057
|
-
});
|
|
6180
|
+
}));
|
|
6058
6181
|
});
|
|
6059
6182
|
// src/vue/useIslandStore.ts
|
|
6060
6183
|
import { customRef, onBeforeUnmount } from "vue";
|
|
@@ -6334,7 +6457,7 @@ var preserveBrowserTranslation = (strategy) => {
|
|
|
6334
6457
|
return translatedStrategy;
|
|
6335
6458
|
};
|
|
6336
6459
|
// src/vue/components/Image.ts
|
|
6337
|
-
import { computed, defineComponent as defineComponent3, h as
|
|
6460
|
+
import { computed, defineComponent as defineComponent3, h as h4, ref } from "vue";
|
|
6338
6461
|
|
|
6339
6462
|
// src/utils/imageClient.ts
|
|
6340
6463
|
init_constants();
|
|
@@ -6471,7 +6594,7 @@ var Image = defineComponent3({
|
|
|
6471
6594
|
props.onError?.(event);
|
|
6472
6595
|
};
|
|
6473
6596
|
return () => {
|
|
6474
|
-
const imgNode =
|
|
6597
|
+
const imgNode = h4("img", {
|
|
6475
6598
|
alt: props.alt,
|
|
6476
6599
|
class: props.className,
|
|
6477
6600
|
crossorigin: props.crossOrigin,
|
|
@@ -6488,7 +6611,7 @@ var Image = defineComponent3({
|
|
|
6488
6611
|
style: imgStyle.value,
|
|
6489
6612
|
width: props.fill ? undefined : props.width
|
|
6490
6613
|
});
|
|
6491
|
-
return props.fill ?
|
|
6614
|
+
return props.fill ? h4("span", { style: fillWrapperStyle }, [imgNode]) : imgNode;
|
|
6492
6615
|
};
|
|
6493
6616
|
}
|
|
6494
6617
|
});
|
|
@@ -6496,12 +6619,12 @@ var Image = defineComponent3({
|
|
|
6496
6619
|
import {
|
|
6497
6620
|
cloneVNode,
|
|
6498
6621
|
defineComponent as defineComponent4,
|
|
6499
|
-
h as
|
|
6622
|
+
h as h5,
|
|
6500
6623
|
isVNode,
|
|
6501
6624
|
onMounted,
|
|
6502
6625
|
onBeforeUnmount as onBeforeUnmount2,
|
|
6503
6626
|
ref as ref2,
|
|
6504
|
-
useSSRContext
|
|
6627
|
+
useSSRContext as useSSRContext3
|
|
6505
6628
|
} from "vue";
|
|
6506
6629
|
var renderVueNodesToHtml = async (nodes) => {
|
|
6507
6630
|
const { createSSRApp, h: createVNode } = await import("vue");
|
|
@@ -6644,7 +6767,7 @@ var SuspenseSlot = defineComponent4({
|
|
|
6644
6767
|
const hasError = ref2(false);
|
|
6645
6768
|
const hasPatchedDom = ref2(readPatchedDomState());
|
|
6646
6769
|
const usesFrameworkSlots = hasFrameworkSlots(slots.default, slots.fallback, slots.error, props.promise);
|
|
6647
|
-
const isSsrRender =
|
|
6770
|
+
const isSsrRender = useSSRContext3() !== undefined;
|
|
6648
6771
|
if (isSsrRender) {
|
|
6649
6772
|
registerSuspenseSlotForSsr(props, slots, usesFrameworkSlots);
|
|
6650
6773
|
}
|
|
@@ -6694,14 +6817,14 @@ var SuspenseSlot = defineComponent4({
|
|
|
6694
6817
|
};
|
|
6695
6818
|
return () => {
|
|
6696
6819
|
if (!usesFrameworkSlots) {
|
|
6697
|
-
return
|
|
6820
|
+
return h5("div", {
|
|
6698
6821
|
class: props.className,
|
|
6699
6822
|
"data-absolute-slot": "true",
|
|
6700
6823
|
id: props.id,
|
|
6701
6824
|
innerHTML: props.fallbackHtml
|
|
6702
6825
|
});
|
|
6703
6826
|
}
|
|
6704
|
-
return
|
|
6827
|
+
return h5("div", {
|
|
6705
6828
|
class: props.className,
|
|
6706
6829
|
"data-absolute-slot": "true",
|
|
6707
6830
|
"data-allow-mismatch": "",
|
|
@@ -6711,7 +6834,7 @@ var SuspenseSlot = defineComponent4({
|
|
|
6711
6834
|
}
|
|
6712
6835
|
});
|
|
6713
6836
|
// src/vue/components/StreamSlot.ts
|
|
6714
|
-
import { defineComponent as defineComponent5, h as
|
|
6837
|
+
import { defineComponent as defineComponent5, h as h6, useSSRContext as useSSRContext4 } from "vue";
|
|
6715
6838
|
var StreamSlot = defineComponent5({
|
|
6716
6839
|
name: "AbsoluteStreamSlot",
|
|
6717
6840
|
props: {
|
|
@@ -6726,10 +6849,10 @@ var StreamSlot = defineComponent5({
|
|
|
6726
6849
|
timeoutMs: { default: undefined, type: Number }
|
|
6727
6850
|
},
|
|
6728
6851
|
setup(props) {
|
|
6729
|
-
if (
|
|
6852
|
+
if (useSSRContext4() !== undefined) {
|
|
6730
6853
|
registerStreamSlotForSsr(props);
|
|
6731
6854
|
}
|
|
6732
|
-
return () =>
|
|
6855
|
+
return () => h6("div", {
|
|
6733
6856
|
class: props.className,
|
|
6734
6857
|
"data-absolute-slot": "true",
|
|
6735
6858
|
id: props.id,
|
|
@@ -6914,7 +7037,7 @@ var useServerData = (key, fetcher, options = {}) => {
|
|
|
6914
7037
|
return state;
|
|
6915
7038
|
};
|
|
6916
7039
|
// src/vue/router/Link.ts
|
|
6917
|
-
import { defineComponent as defineComponent6, getCurrentInstance as getCurrentInstance2, h as
|
|
7040
|
+
import { defineComponent as defineComponent6, getCurrentInstance as getCurrentInstance2, h as h7 } from "vue";
|
|
6918
7041
|
|
|
6919
7042
|
// src/client/prefetch.ts
|
|
6920
7043
|
var PREFETCH_CACHE_LIMIT = 16;
|
|
@@ -7382,7 +7505,7 @@ var Link = defineComponent6({
|
|
|
7382
7505
|
router.push(props.href);
|
|
7383
7506
|
}
|
|
7384
7507
|
};
|
|
7385
|
-
return () =>
|
|
7508
|
+
return () => h7("a", {
|
|
7386
7509
|
download: props.download,
|
|
7387
7510
|
href: props.href,
|
|
7388
7511
|
onBlur,
|
|
@@ -7418,5 +7541,5 @@ export {
|
|
|
7418
7541
|
useServerData
|
|
7419
7542
|
};
|
|
7420
7543
|
|
|
7421
|
-
//# debugId=
|
|
7544
|
+
//# debugId=3A0CD60AE9E8377764756E2164756E21
|
|
7422
7545
|
//# sourceMappingURL=index.js.map
|