@absolutejs/absolute 0.20.0-beta.4 → 0.20.0-beta.5
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/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +341 -22
- package/dist/angular/index.js.map +8 -5
- package/dist/angular/server.js +341 -22
- package/dist/angular/server.js.map +8 -5
- package/dist/build.js +94 -22
- package/dist/build.js.map +9 -9
- package/dist/cli/index.js +986 -557
- package/dist/dev/client/cssUtils.ts +16 -2
- package/dist/dev/client/handlers/rebuild.ts +11 -1
- package/dist/dev/client/hmrTiming.ts +14 -7
- package/dist/index.js +364 -191
- package/dist/index.js.map +17 -17
- package/dist/mobile/browser.js +14 -1
- package/dist/mobile/browser.js.map +3 -3
- package/dist/mobile/index.js +588 -99
- package/dist/mobile/index.js.map +15 -13
- package/dist/mobile/remoteMacAgentEntry.js +8 -8
- package/dist/src/angular/pageHandler.d.ts +3 -0
- package/dist/src/cli/config/server.d.ts +1 -1
- package/dist/src/core/pageHandlers.d.ts +11 -2
- package/dist/src/mobile/androidEmulatorController.d.ts +6 -1
- package/dist/src/mobile/buildPipeline.d.ts +1 -0
- package/dist/src/mobile/capacitorBundle.d.ts +11 -1
- package/dist/src/mobile/client.d.ts +4 -0
- package/dist/src/mobile/index.d.ts +1 -0
- package/dist/src/mobile/nativeAuth.d.ts +17 -0
- package/dist/src/mobile/releaseArtifact.d.ts +2 -0
- package/dist/src/mobile/shellAuth.d.ts +8 -0
- package/dist/src/mobile/shellBootstrap.d.ts +11 -1
- package/dist/src/mobile/shellSync.d.ts +2 -0
- package/dist/src/mobile/staticDocument.d.ts +5 -0
- package/dist/src/mobile/transport.d.ts +9 -1
- package/dist/src/plugins/imageOptimizer.d.ts +1 -1
- package/dist/src/svelte/pageHandler.d.ts +3 -0
- package/dist/src/vue/pageHandler.d.ts +3 -0
- package/dist/svelte/index.js +312 -23
- package/dist/svelte/index.js.map +7 -4
- package/dist/svelte/server.js +307 -18
- package/dist/svelte/server.js.map +7 -4
- package/dist/vue/index.js +312 -23
- package/dist/vue/index.js.map +7 -4
- package/dist/vue/server.js +307 -18
- package/dist/vue/server.js.map +7 -4
- package/package.json +20 -8
package/dist/vue/server.js
CHANGED
|
@@ -829,7 +829,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
829
829
|
getStreamingSlotsRuntimeScript()
|
|
830
830
|
].filter(Boolean).join(";");
|
|
831
831
|
return `<script${createNonceAttr(nonce)}>${escapeScriptContent(runtimeBody)}</script>`;
|
|
832
|
-
}, toUint8 = (value, encoder) => encoder.encode(value),
|
|
832
|
+
}, toUint8 = (value, encoder) => encoder.encode(value), isRecord2 = (value) => Boolean(value) && typeof value === "object", isSafeHtmlLike = (value) => isRecord2(value) && typeof value.changingThisBreaksApplicationSecurity === "string", normalizeSafeHtml = (value) => {
|
|
833
833
|
if (isSafeHtmlLike(value)) {
|
|
834
834
|
return value.changingThisBreaksApplicationSecurity;
|
|
835
835
|
}
|
|
@@ -890,7 +890,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
890
890
|
}, createTimeoutError = (slot, timeoutMs) => {
|
|
891
891
|
const error = Object.assign(new Error(`Streaming slot "${slot.id}" timed out after ${timeoutMs}ms`), { __absTimeout: true });
|
|
892
892
|
return error;
|
|
893
|
-
}, isSlotPatchPayloadObject = (value) =>
|
|
893
|
+
}, isSlotPatchPayloadObject = (value) => isRecord2(value) && ("html" in value), isTimeoutError = (error) => isRecord2(error) && error.__absTimeout === true, toStreamingSlot = (slot, policy) => ({
|
|
894
894
|
errorHtml: slot.errorHtml === undefined ? policy.errorHtml : slot.errorHtml,
|
|
895
895
|
fallbackHtml: normalizeSlotText(slot.fallbackHtml, policy.fallbackHtml),
|
|
896
896
|
id: slot.id ?? createStreamingSlotId(),
|
|
@@ -2039,6 +2039,278 @@ var setCurrentIslandManifest = (manifest) => {
|
|
|
2039
2039
|
|
|
2040
2040
|
// src/vue/pageHandler.ts
|
|
2041
2041
|
init_devRouteRegistrationCallsite();
|
|
2042
|
+
|
|
2043
|
+
// src/core/requestContext.ts
|
|
2044
|
+
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
2045
|
+
import { Elysia as Elysia2 } from "elysia";
|
|
2046
|
+
var REQUEST_STORAGE_KEY = Symbol.for("absolutejs.requestAsyncLocalStorage");
|
|
2047
|
+
var isAbsoluteRequestStorage = (value) => typeof value === "object" && value !== null && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
2048
|
+
var getRequestStorage = () => {
|
|
2049
|
+
const value = Reflect.get(globalThis, REQUEST_STORAGE_KEY);
|
|
2050
|
+
return isAbsoluteRequestStorage(value) ? value : undefined;
|
|
2051
|
+
};
|
|
2052
|
+
var ensureRequestStorage = () => {
|
|
2053
|
+
const existing = getRequestStorage();
|
|
2054
|
+
if (existing)
|
|
2055
|
+
return existing;
|
|
2056
|
+
const storage = new AsyncLocalStorage2;
|
|
2057
|
+
Reflect.set(globalThis, REQUEST_STORAGE_KEY, storage);
|
|
2058
|
+
return storage;
|
|
2059
|
+
};
|
|
2060
|
+
var absoluteRequestContext = new Elysia2({
|
|
2061
|
+
name: "absolutejs-request-context"
|
|
2062
|
+
}).request(({ request }) => {
|
|
2063
|
+
ensureRequestStorage().enterWith({ request });
|
|
2064
|
+
}).as("global");
|
|
2065
|
+
var getCurrentAbsoluteRequest = () => getRequestStorage()?.getStore()?.request;
|
|
2066
|
+
var runWithAbsoluteRequest = (request, callback) => ensureRequestStorage().run({ request }, callback);
|
|
2067
|
+
|
|
2068
|
+
// src/mobile/producerContextState.ts
|
|
2069
|
+
var ABSOLUTE_MOBILE_PRODUCER_STORAGE_KEY = Symbol.for("absolutejs.mobileProducerAsyncLocalStorage");
|
|
2070
|
+
var frameworks = new Set([
|
|
2071
|
+
"angular",
|
|
2072
|
+
"ember",
|
|
2073
|
+
"html",
|
|
2074
|
+
"htmx",
|
|
2075
|
+
"react",
|
|
2076
|
+
"svelte",
|
|
2077
|
+
"vue"
|
|
2078
|
+
]);
|
|
2079
|
+
var isCompatibilityPage = (value) => typeof value === "object" && value !== null && ("bundleHash" in value) && typeof value.bundleHash === "string" && ("contract" in value) && typeof value.contract === "string" && ("framework" in value) && typeof value.framework === "string" && frameworks.has(value.framework) && ("pageId" in value) && typeof value.pageId === "string" && ("propsSchemaHash" in value) && typeof value.propsSchemaHash === "string";
|
|
2080
|
+
var getCurrentAbsoluteMobileProducerContext = () => {
|
|
2081
|
+
const value = Reflect.get(globalThis, ABSOLUTE_MOBILE_PRODUCER_STORAGE_KEY);
|
|
2082
|
+
if (typeof value !== "object" || value === null || !("getStore" in value) || typeof value.getStore !== "function") {
|
|
2083
|
+
return;
|
|
2084
|
+
}
|
|
2085
|
+
const context = value.getStore();
|
|
2086
|
+
if (typeof context !== "object" || context === null || !("page" in context) || !isCompatibilityPage(context.page) || !("releaseId" in context) || typeof context.releaseId !== "string") {
|
|
2087
|
+
return;
|
|
2088
|
+
}
|
|
2089
|
+
return { page: context.page, releaseId: context.releaseId };
|
|
2090
|
+
};
|
|
2091
|
+
|
|
2092
|
+
// src/mobile/pageProtocol.ts
|
|
2093
|
+
var ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE = "application/vnd.absolute.page+json";
|
|
2094
|
+
var ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION = 1;
|
|
2095
|
+
var BAD_REQUEST_STATUS = 400;
|
|
2096
|
+
var OK_STATUS = 200;
|
|
2097
|
+
var SERVER_ERROR_STATUS = 500;
|
|
2098
|
+
var UPGRADE_REQUIRED_STATUS = 426;
|
|
2099
|
+
var MOBILE_PAGE_REQUEST_HEADERS = {
|
|
2100
|
+
appBuild: "x-absolute-mobile-app-build",
|
|
2101
|
+
pageBundle: "x-absolute-mobile-page-bundle",
|
|
2102
|
+
pageContracts: "x-absolute-mobile-page-contracts",
|
|
2103
|
+
pageId: "x-absolute-mobile-page-id",
|
|
2104
|
+
protocol: "x-absolute-mobile-protocol",
|
|
2105
|
+
runtime: "x-absolute-mobile-runtime"
|
|
2106
|
+
};
|
|
2107
|
+
var parseMediaType = (value) => value.split(";", 1)[0]?.trim().toLowerCase();
|
|
2108
|
+
var acceptsAbsoluteMobilePage = (request) => {
|
|
2109
|
+
if (!request)
|
|
2110
|
+
return false;
|
|
2111
|
+
return (request.headers.get("accept") ?? "").split(",").some((value) => parseMediaType(value) === ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE);
|
|
2112
|
+
};
|
|
2113
|
+
var readRequiredHeader = (request, name) => {
|
|
2114
|
+
const value = request.headers.get(name)?.trim();
|
|
2115
|
+
return value ? value : undefined;
|
|
2116
|
+
};
|
|
2117
|
+
var parseAbsoluteMobilePageRequest = (request) => {
|
|
2118
|
+
if (!request || !acceptsAbsoluteMobilePage(request)) {
|
|
2119
|
+
return { kind: "not-mobile" };
|
|
2120
|
+
}
|
|
2121
|
+
const protocolValue = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.protocol);
|
|
2122
|
+
const runtime = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.runtime);
|
|
2123
|
+
const appBuild = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.appBuild);
|
|
2124
|
+
const pageBundle = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.pageBundle);
|
|
2125
|
+
const pageContractsValue = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.pageContracts);
|
|
2126
|
+
const pageId = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.pageId);
|
|
2127
|
+
if (!protocolValue || !/^\d+$/.test(protocolValue)) {
|
|
2128
|
+
return {
|
|
2129
|
+
kind: "invalid",
|
|
2130
|
+
message: `Missing or invalid ${MOBILE_PAGE_REQUEST_HEADERS.protocol} header.`
|
|
2131
|
+
};
|
|
2132
|
+
}
|
|
2133
|
+
if (!runtime) {
|
|
2134
|
+
return {
|
|
2135
|
+
kind: "invalid",
|
|
2136
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.runtime} header.`
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
if (!appBuild) {
|
|
2140
|
+
return {
|
|
2141
|
+
kind: "invalid",
|
|
2142
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.appBuild} header.`
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2145
|
+
if (!pageBundle) {
|
|
2146
|
+
return {
|
|
2147
|
+
kind: "invalid",
|
|
2148
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.pageBundle} header.`
|
|
2149
|
+
};
|
|
2150
|
+
}
|
|
2151
|
+
if (!pageContractsValue) {
|
|
2152
|
+
return {
|
|
2153
|
+
kind: "invalid",
|
|
2154
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.pageContracts} header.`
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
if (!pageId) {
|
|
2158
|
+
return {
|
|
2159
|
+
kind: "invalid",
|
|
2160
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.pageId} header.`
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2163
|
+
const pageContracts = [
|
|
2164
|
+
...new Set(pageContractsValue.split(",").map((value) => value.trim()).filter(Boolean))
|
|
2165
|
+
];
|
|
2166
|
+
if (pageContracts.length === 0) {
|
|
2167
|
+
return {
|
|
2168
|
+
kind: "invalid",
|
|
2169
|
+
message: `${MOBILE_PAGE_REQUEST_HEADERS.pageContracts} must contain at least one contract.`
|
|
2170
|
+
};
|
|
2171
|
+
}
|
|
2172
|
+
return {
|
|
2173
|
+
client: {
|
|
2174
|
+
appBuild,
|
|
2175
|
+
pageBundle,
|
|
2176
|
+
pageContracts,
|
|
2177
|
+
pageId,
|
|
2178
|
+
protocol: Number(protocolValue),
|
|
2179
|
+
runtime
|
|
2180
|
+
},
|
|
2181
|
+
kind: "mobile"
|
|
2182
|
+
};
|
|
2183
|
+
};
|
|
2184
|
+
var responseHeaders = () => {
|
|
2185
|
+
const headers = new Headers({
|
|
2186
|
+
"cache-control": "no-store",
|
|
2187
|
+
"content-type": `${ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE}; version=${ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION}`
|
|
2188
|
+
});
|
|
2189
|
+
headerVaryValues.forEach((value) => headers.append("vary", value));
|
|
2190
|
+
return headers;
|
|
2191
|
+
};
|
|
2192
|
+
var headerVaryValues = [
|
|
2193
|
+
"Accept",
|
|
2194
|
+
MOBILE_PAGE_REQUEST_HEADERS.protocol,
|
|
2195
|
+
MOBILE_PAGE_REQUEST_HEADERS.runtime,
|
|
2196
|
+
MOBILE_PAGE_REQUEST_HEADERS.appBuild,
|
|
2197
|
+
MOBILE_PAGE_REQUEST_HEADERS.pageBundle,
|
|
2198
|
+
MOBILE_PAGE_REQUEST_HEADERS.pageContracts,
|
|
2199
|
+
MOBILE_PAGE_REQUEST_HEADERS.pageId
|
|
2200
|
+
];
|
|
2201
|
+
var envelopeResponse = (response, status) => new Response(JSON.stringify({
|
|
2202
|
+
protocol: ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION,
|
|
2203
|
+
response
|
|
2204
|
+
}), { headers: responseHeaders(), status });
|
|
2205
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2206
|
+
var normalizeJsonValue = (value) => {
|
|
2207
|
+
const serialized = JSON.stringify(value);
|
|
2208
|
+
if (serialized === undefined) {
|
|
2209
|
+
throw new TypeError("Mobile page props must be JSON-serializable.");
|
|
2210
|
+
}
|
|
2211
|
+
const parsed = JSON.parse(serialized);
|
|
2212
|
+
if (!isRecord(parsed)) {
|
|
2213
|
+
throw new TypeError("Mobile page props must serialize to an object.");
|
|
2214
|
+
}
|
|
2215
|
+
return parsed;
|
|
2216
|
+
};
|
|
2217
|
+
var finalizeArchivedMobilePage = (context, input) => {
|
|
2218
|
+
const { page } = context;
|
|
2219
|
+
if (page.pageId !== input.compatibility.pageId || page.framework !== input.compatibility.framework) {
|
|
2220
|
+
return envelopeResponse({
|
|
2221
|
+
kind: "invalid-request",
|
|
2222
|
+
message: "Archived producer page identity does not match its release artifact."
|
|
2223
|
+
}, BAD_REQUEST_STATUS);
|
|
2224
|
+
}
|
|
2225
|
+
try {
|
|
2226
|
+
const [currentRepresentation] = input.compatibility.representations;
|
|
2227
|
+
if (!currentRepresentation) {
|
|
2228
|
+
throw new TypeError("Mobile page has no current representation.");
|
|
2229
|
+
}
|
|
2230
|
+
return envelopeResponse({
|
|
2231
|
+
contract: page.contract,
|
|
2232
|
+
framework: page.framework,
|
|
2233
|
+
kind: "page",
|
|
2234
|
+
pageId: page.pageId,
|
|
2235
|
+
props: normalizeJsonValue(currentRepresentation.mapProps(input.props)),
|
|
2236
|
+
status: input.status ?? OK_STATUS
|
|
2237
|
+
}, input.status ?? OK_STATUS);
|
|
2238
|
+
} catch (error) {
|
|
2239
|
+
console.error(`[Mobile] Archived producer ${context.releaseId} failed for ${page.pageId}:`, error);
|
|
2240
|
+
return createAbsoluteMobilePageErrorResponse(page.pageId);
|
|
2241
|
+
}
|
|
2242
|
+
};
|
|
2243
|
+
var createAbsoluteMobileInvalidRequestResponse = (message) => envelopeResponse({ kind: "invalid-request", message }, BAD_REQUEST_STATUS);
|
|
2244
|
+
var createAbsoluteMobilePageErrorResponse = (pageId) => envelopeResponse({
|
|
2245
|
+
code: "representation-failed",
|
|
2246
|
+
kind: "error",
|
|
2247
|
+
pageId,
|
|
2248
|
+
status: SERVER_ERROR_STATUS
|
|
2249
|
+
}, SERVER_ERROR_STATUS);
|
|
2250
|
+
var createAbsoluteMobileUpgradeResponse = (result) => envelopeResponse(result, UPGRADE_REQUIRED_STATUS);
|
|
2251
|
+
var finalizeAbsoluteMobilePage = (input) => {
|
|
2252
|
+
const parsed = parseAbsoluteMobilePageRequest(input.request);
|
|
2253
|
+
if (parsed.kind === "not-mobile")
|
|
2254
|
+
return;
|
|
2255
|
+
if (parsed.kind === "invalid") {
|
|
2256
|
+
return envelopeResponse({ kind: "invalid-request", message: parsed.message }, BAD_REQUEST_STATUS);
|
|
2257
|
+
}
|
|
2258
|
+
const { client } = parsed;
|
|
2259
|
+
if (client.pageId !== input.compatibility.pageId) {
|
|
2260
|
+
return envelopeResponse({
|
|
2261
|
+
kind: "invalid-request",
|
|
2262
|
+
message: `Requested mobile page ${client.pageId} does not match ${input.compatibility.pageId}.`
|
|
2263
|
+
}, BAD_REQUEST_STATUS);
|
|
2264
|
+
}
|
|
2265
|
+
const producerContext = getCurrentAbsoluteMobileProducerContext();
|
|
2266
|
+
if (producerContext)
|
|
2267
|
+
return finalizeArchivedMobilePage(producerContext, input);
|
|
2268
|
+
if (client.protocol !== ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION) {
|
|
2269
|
+
return envelopeResponse({
|
|
2270
|
+
kind: "upgrade-required",
|
|
2271
|
+
pageId: input.compatibility.pageId,
|
|
2272
|
+
reason: "protocol"
|
|
2273
|
+
}, UPGRADE_REQUIRED_STATUS);
|
|
2274
|
+
}
|
|
2275
|
+
if (!input.compatibility.runtimes.includes(client.runtime)) {
|
|
2276
|
+
return envelopeResponse({
|
|
2277
|
+
kind: "upgrade-required",
|
|
2278
|
+
pageId: input.compatibility.pageId,
|
|
2279
|
+
reason: "runtime",
|
|
2280
|
+
supportedRuntimes: [...input.compatibility.runtimes]
|
|
2281
|
+
}, UPGRADE_REQUIRED_STATUS);
|
|
2282
|
+
}
|
|
2283
|
+
const clientContracts = new Set(client.pageContracts);
|
|
2284
|
+
const representation = input.compatibility.representations.find(({ contract }) => clientContracts.has(contract));
|
|
2285
|
+
if (!representation) {
|
|
2286
|
+
return envelopeResponse({
|
|
2287
|
+
kind: "upgrade-required",
|
|
2288
|
+
pageId: input.compatibility.pageId,
|
|
2289
|
+
reason: "page-contract",
|
|
2290
|
+
supportedContracts: input.compatibility.representations.map(({ contract }) => contract)
|
|
2291
|
+
}, UPGRADE_REQUIRED_STATUS);
|
|
2292
|
+
}
|
|
2293
|
+
try {
|
|
2294
|
+
return envelopeResponse({
|
|
2295
|
+
contract: representation.contract,
|
|
2296
|
+
framework: input.compatibility.framework,
|
|
2297
|
+
kind: "page",
|
|
2298
|
+
pageId: input.compatibility.pageId,
|
|
2299
|
+
props: normalizeJsonValue(representation.mapProps(input.props)),
|
|
2300
|
+
status: input.status ?? OK_STATUS
|
|
2301
|
+
}, input.status ?? OK_STATUS);
|
|
2302
|
+
} catch (error) {
|
|
2303
|
+
console.error(`[Mobile] Failed to produce ${input.compatibility.pageId} representation ${representation.contract}:`, error);
|
|
2304
|
+
return envelopeResponse({
|
|
2305
|
+
code: "representation-failed",
|
|
2306
|
+
kind: "error",
|
|
2307
|
+
pageId: input.compatibility.pageId,
|
|
2308
|
+
status: SERVER_ERROR_STATUS
|
|
2309
|
+
}, SERVER_ERROR_STATUS);
|
|
2310
|
+
}
|
|
2311
|
+
};
|
|
2312
|
+
|
|
2313
|
+
// src/vue/pageHandler.ts
|
|
2042
2314
|
init_pageResponseCache();
|
|
2043
2315
|
|
|
2044
2316
|
// src/core/responseEnhancers.ts
|
|
@@ -2095,7 +2367,7 @@ var withRegisteredStreamingSlots = async (renderResponse, options = {}) => {
|
|
|
2095
2367
|
|
|
2096
2368
|
// src/core/streamingSlotWarningScope.ts
|
|
2097
2369
|
init_logger();
|
|
2098
|
-
import { AsyncLocalStorage as
|
|
2370
|
+
import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
|
|
2099
2371
|
var STREAMING_SLOT_WARNING_STORAGE_KEY2 = Symbol.for("absolutejs.streamingSlotWarningAsyncLocalStorage");
|
|
2100
2372
|
var isObjectRecord4 = (value) => Boolean(value) && typeof value === "object";
|
|
2101
2373
|
var isAsyncLocalStorage3 = (value) => isObjectRecord4(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
@@ -2111,7 +2383,7 @@ var ensureWarningStorage = () => {
|
|
|
2111
2383
|
if (existing) {
|
|
2112
2384
|
return existing;
|
|
2113
2385
|
}
|
|
2114
|
-
const storage = new
|
|
2386
|
+
const storage = new AsyncLocalStorage3;
|
|
2115
2387
|
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY2, storage);
|
|
2116
2388
|
return storage;
|
|
2117
2389
|
};
|
|
@@ -2193,23 +2465,23 @@ var ABSOLUTE_TELEPORT_TARGET_ID = "absolute-teleports";
|
|
|
2193
2465
|
var ABSOLUTE_TELEPORT_TARGET = `#${ABSOLUTE_TELEPORT_TARGET_ID}`;
|
|
2194
2466
|
|
|
2195
2467
|
// src/vue/pageHandler.ts
|
|
2196
|
-
var
|
|
2197
|
-
var isGenericVueComponent = (value) => typeof value === "function" ||
|
|
2468
|
+
var isRecord3 = (value) => typeof value === "object" && value !== null;
|
|
2469
|
+
var isGenericVueComponent = (value) => typeof value === "function" || isRecord3(value);
|
|
2198
2470
|
var readHasIslands = (value) => {
|
|
2199
|
-
if (!
|
|
2471
|
+
if (!isRecord3(value))
|
|
2200
2472
|
return false;
|
|
2201
2473
|
const hasIslands = value["__ABSOLUTE_PAGE_HAS_ISLANDS__"];
|
|
2202
2474
|
return typeof hasIslands === "boolean" ? hasIslands : false;
|
|
2203
2475
|
};
|
|
2204
2476
|
var isVueSetupApp = (value) => typeof value === "function";
|
|
2205
2477
|
var readSetupAppHook = (value) => {
|
|
2206
|
-
if (!
|
|
2478
|
+
if (!isRecord3(value))
|
|
2207
2479
|
return null;
|
|
2208
2480
|
const { setupApp } = value;
|
|
2209
2481
|
return isVueSetupApp(setupApp) ? setupApp : null;
|
|
2210
2482
|
};
|
|
2211
|
-
var readHasSpaRoutes = (value) =>
|
|
2212
|
-
var readDefaultExport = (value) =>
|
|
2483
|
+
var readHasSpaRoutes = (value) => isRecord3(value) && Array.isArray(value["routes"]);
|
|
2484
|
+
var readDefaultExport = (value) => isRecord3(value) ? value.default : undefined;
|
|
2213
2485
|
var resolveRequestRenderUrl = (request) => {
|
|
2214
2486
|
if (!request)
|
|
2215
2487
|
return "/";
|
|
@@ -2239,12 +2511,29 @@ var getSsrOnlyHmrShim = () => {
|
|
|
2239
2511
|
};
|
|
2240
2512
|
var handleVuePageRequest = async (input) => {
|
|
2241
2513
|
const passedPageComponent = input.Page;
|
|
2514
|
+
const request = input.request ?? getCurrentAbsoluteRequest();
|
|
2515
|
+
const pageId = input.__absoluteMobile?.pageId ?? derivePageName(input.pagePath);
|
|
2516
|
+
const currentContract = input.__absoluteMobile?.contract ?? `vue:${pageId}:${ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION}`;
|
|
2517
|
+
const mobileResponse = finalizeAbsoluteMobilePage({
|
|
2518
|
+
compatibility: {
|
|
2519
|
+
framework: "vue",
|
|
2520
|
+
pageId,
|
|
2521
|
+
representations: [
|
|
2522
|
+
{ contract: currentContract, mapProps: (props) => props }
|
|
2523
|
+
],
|
|
2524
|
+
runtimes: [String(ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION)]
|
|
2525
|
+
},
|
|
2526
|
+
props: input.props ?? Object.create(null),
|
|
2527
|
+
request
|
|
2528
|
+
});
|
|
2529
|
+
if (mobileResponse)
|
|
2530
|
+
return mobileResponse;
|
|
2242
2531
|
const userHeadTag = input.headTag ?? "<head></head>";
|
|
2243
2532
|
const resolvedOptions = input;
|
|
2244
2533
|
const resolvedPagePath = input.pagePath;
|
|
2245
2534
|
const [siblingCss, spaChildCss] = await Promise.all([
|
|
2246
2535
|
readSiblingCss(resolvedPagePath),
|
|
2247
|
-
resolveSpaChildCss(resolvedPagePath,
|
|
2536
|
+
resolveSpaChildCss(resolvedPagePath, request?.url)
|
|
2248
2537
|
]);
|
|
2249
2538
|
const resolvedHeadTag = injectInlineCss(injectInlineCss(userHeadTag, siblingCss), spaChildCss);
|
|
2250
2539
|
const maybeProps = input.props;
|
|
@@ -2257,9 +2546,9 @@ var handleVuePageRequest = async (input) => {
|
|
|
2257
2546
|
throw new Error('handleVuePageRequest: `indexPath` is required when `client` is `"auto"` (the default). Pass `client: "none"` to ship a SSR-only page with no client bundle.');
|
|
2258
2547
|
}
|
|
2259
2548
|
try {
|
|
2260
|
-
const spaNotFound = await renderSpaNotFound("vue", derivePageName(resolvedPagePath),
|
|
2549
|
+
const spaNotFound = await renderSpaNotFound("vue", derivePageName(resolvedPagePath), request);
|
|
2261
2550
|
if (spaNotFound)
|
|
2262
|
-
return withPageCacheHeaders(spaNotFound,
|
|
2551
|
+
return withPageCacheHeaders(spaNotFound, request);
|
|
2263
2552
|
const handlerCallsite = resolvedOptions?.collectStreamingSlots === true ? undefined : getCurrentRouteRegistrationCallsite() ?? captureStreamingSlotWarningCallsite();
|
|
2264
2553
|
const renderPageResponse = async () => {
|
|
2265
2554
|
const resolvePageComponent = async () => {
|
|
@@ -2292,7 +2581,7 @@ var handleVuePageRequest = async (input) => {
|
|
|
2292
2581
|
let pendingRedirect = null;
|
|
2293
2582
|
let pendingNotFound = false;
|
|
2294
2583
|
if (resolvedPage.setupApp) {
|
|
2295
|
-
const url = resolveRequestRenderUrl(
|
|
2584
|
+
const url = resolveRequestRenderUrl(request);
|
|
2296
2585
|
await resolvedPage.setupApp(app, {
|
|
2297
2586
|
isServer: true,
|
|
2298
2587
|
router: null,
|
|
@@ -2373,7 +2662,7 @@ var handleVuePageRequest = async (input) => {
|
|
|
2373
2662
|
});
|
|
2374
2663
|
};
|
|
2375
2664
|
const pageResponse = await runWithStreamingSlotWarningScope(() => resolvedOptions?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, resolvedOptions) : renderPageResponse(), { handlerCallsite });
|
|
2376
|
-
return withPageCacheHeaders(pageResponse,
|
|
2665
|
+
return withPageCacheHeaders(pageResponse, request, {
|
|
2377
2666
|
bufferStreamForEtag: input.bufferStreamForEtag
|
|
2378
2667
|
});
|
|
2379
2668
|
} catch (error) {
|
|
@@ -2381,12 +2670,12 @@ var handleVuePageRequest = async (input) => {
|
|
|
2381
2670
|
const pageName = derivePageName(resolvedPagePath);
|
|
2382
2671
|
const conventionResponse = await renderConventionError("vue", pageName, error);
|
|
2383
2672
|
if (conventionResponse) {
|
|
2384
|
-
return withPageCacheHeaders(conventionResponse,
|
|
2673
|
+
return withPageCacheHeaders(conventionResponse, request);
|
|
2385
2674
|
}
|
|
2386
2675
|
return withPageCacheHeaders(new Response(ssrErrorPage("vue", error), {
|
|
2387
2676
|
headers: { "Content-Type": "text/html" },
|
|
2388
2677
|
status: 500
|
|
2389
|
-
}),
|
|
2678
|
+
}), request);
|
|
2390
2679
|
}
|
|
2391
2680
|
};
|
|
2392
2681
|
// src/vue/routerRedirectProviders.ts
|
|
@@ -2411,5 +2700,5 @@ export {
|
|
|
2411
2700
|
applyVueRouterRedirect
|
|
2412
2701
|
};
|
|
2413
2702
|
|
|
2414
|
-
//# debugId=
|
|
2703
|
+
//# debugId=1586E98D5BE5EE5B64756E2164756E21
|
|
2415
2704
|
//# sourceMappingURL=server.js.map
|