@absolutejs/absolute 0.19.0-beta.1073 → 0.19.0-beta.1075
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 +52 -7
- package/dist/angular/index.js.map +6 -5
- package/dist/angular/server.js +52 -7
- package/dist/angular/server.js.map +6 -5
- package/dist/build.js +45 -6
- package/dist/build.js.map +5 -4
- package/dist/cli/config/server.js +53 -7
- package/dist/index.js +54 -11
- package/dist/index.js.map +7 -6
- package/dist/react/index.js +55 -10
- package/dist/react/index.js.map +6 -5
- package/dist/react/server.js +53 -8
- package/dist/react/server.js.map +6 -5
- package/dist/src/core/pageResponseCache.d.ts +23 -0
- package/dist/src/react/pageHandler.d.ts +5 -0
- package/dist/src/svelte/pageHandler.d.ts +5 -0
- package/dist/src/vue/pageHandler.d.ts +5 -0
- package/dist/svelte/index.js +53 -8
- package/dist/svelte/index.js.map +6 -5
- package/dist/svelte/server.js +53 -8
- package/dist/svelte/server.js.map +6 -5
- package/dist/vue/index.js +55 -10
- package/dist/vue/index.js.map +6 -5
- package/dist/vue/server.js +53 -8
- package/dist/vue/server.js.map +6 -5
- package/package.json +5 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-pJspKi/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-pJspKi/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
|
48
48
|
getWarningController()?.maybeWarn(primitiveName);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
// .angular-partial-tmp-
|
|
51
|
+
// .angular-partial-tmp-pJspKi/src/core/streamingSlotRegistry.ts
|
|
52
52
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
53
53
|
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
54
54
|
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
package/dist/angular/index.js
CHANGED
|
@@ -2471,6 +2471,43 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
2471
2471
|
pageHandlerWrappers = new WeakMap;
|
|
2472
2472
|
});
|
|
2473
2473
|
|
|
2474
|
+
// src/core/pageResponseCache.ts
|
|
2475
|
+
import { createHash as createHash2 } from "crypto";
|
|
2476
|
+
var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html", streamingPageHeaders = (extra) => {
|
|
2477
|
+
const headers = new Headers(extra);
|
|
2478
|
+
headers.set("content-type", HTML_CONTENT_TYPE);
|
|
2479
|
+
headers.set(STREAMING_PAGE_HEADER, "1");
|
|
2480
|
+
return headers;
|
|
2481
|
+
}, computeEtag = (html) => `W/"${createHash2("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
|
|
2482
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
2483
|
+
if (!contentType.includes(HTML_CONTENT_TYPE))
|
|
2484
|
+
return response;
|
|
2485
|
+
const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
|
|
2486
|
+
if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
|
|
2487
|
+
response.headers.delete(STREAMING_PAGE_HEADER);
|
|
2488
|
+
response.headers.set("cache-control", "no-cache");
|
|
2489
|
+
return response;
|
|
2490
|
+
}
|
|
2491
|
+
const html = await response.text();
|
|
2492
|
+
const etag = computeEtag(html);
|
|
2493
|
+
if (request?.headers.get("if-none-match") === etag) {
|
|
2494
|
+
return new Response(null, {
|
|
2495
|
+
headers: { "cache-control": "no-cache", etag },
|
|
2496
|
+
status: 304
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
const headers = new Headers(response.headers);
|
|
2500
|
+
headers.delete(STREAMING_PAGE_HEADER);
|
|
2501
|
+
headers.set("cache-control", "no-cache");
|
|
2502
|
+
headers.set("etag", etag);
|
|
2503
|
+
return new Response(html, {
|
|
2504
|
+
headers,
|
|
2505
|
+
status: response.status,
|
|
2506
|
+
statusText: response.statusText
|
|
2507
|
+
});
|
|
2508
|
+
};
|
|
2509
|
+
var init_pageResponseCache = () => {};
|
|
2510
|
+
|
|
2474
2511
|
// src/client/streamSwap.ts
|
|
2475
2512
|
var streamSwapRuntime = () => {
|
|
2476
2513
|
const absoluteWindow = window;
|
|
@@ -15025,8 +15062,12 @@ var resetSsrSanitizer = () => {
|
|
|
15025
15062
|
ssrSanitizer = null;
|
|
15026
15063
|
};
|
|
15027
15064
|
|
|
15065
|
+
// src/angular/pageHandler.ts
|
|
15066
|
+
init_pageResponseCache();
|
|
15067
|
+
|
|
15028
15068
|
// src/core/responseEnhancers.ts
|
|
15029
15069
|
init_streamingSlots();
|
|
15070
|
+
init_pageResponseCache();
|
|
15030
15071
|
var toResponse = async (responseLike) => responseLike;
|
|
15031
15072
|
var cloneHeaders = (response) => {
|
|
15032
15073
|
const headers = new Headers(response.headers);
|
|
@@ -15050,8 +15091,10 @@ var enhanceHtmlResponseWithStreamingSlots = (response, {
|
|
|
15050
15091
|
runtimePlacement,
|
|
15051
15092
|
runtimePreludeScript
|
|
15052
15093
|
});
|
|
15094
|
+
const headers = cloneHeaders(response);
|
|
15095
|
+
headers.set(STREAMING_PAGE_HEADER, "1");
|
|
15053
15096
|
return new Response(body, {
|
|
15054
|
-
headers
|
|
15097
|
+
headers,
|
|
15055
15098
|
status: response.status,
|
|
15056
15099
|
statusText: response.statusText
|
|
15057
15100
|
});
|
|
@@ -15312,17 +15355,19 @@ var handleAngularPageRequest = async (input) => {
|
|
|
15312
15355
|
const html = injectIslandPageContext(injectSsrScripts(htmlWithLoweredIslands, requestId, resolvedIndexPath, maybeRequestContext), { hasIslands: shouldProcessIslands });
|
|
15313
15356
|
return new Response(html, withHtmlContentType(responseInit));
|
|
15314
15357
|
};
|
|
15315
|
-
|
|
15358
|
+
const pageResponse = await runWithStreamingSlotWarningScope(() => options?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, options) : renderPageResponse(), { handlerCallsite });
|
|
15359
|
+
return withPageCacheHeaders(pageResponse, input.request);
|
|
15316
15360
|
} catch (error) {
|
|
15317
15361
|
console.error("[SSR] Angular render error:", error);
|
|
15318
15362
|
const pageName = derivePageName(resolvedPagePath);
|
|
15319
15363
|
const conventionResponse = await renderConventionError("angular", pageName, error);
|
|
15320
|
-
if (conventionResponse)
|
|
15321
|
-
return conventionResponse;
|
|
15322
|
-
|
|
15364
|
+
if (conventionResponse) {
|
|
15365
|
+
return withPageCacheHeaders(conventionResponse, input.request);
|
|
15366
|
+
}
|
|
15367
|
+
return withPageCacheHeaders(new Response(ssrErrorPage("angular", error), {
|
|
15323
15368
|
headers: { "Content-Type": "text/html" },
|
|
15324
15369
|
status: 500
|
|
15325
|
-
});
|
|
15370
|
+
}), input.request);
|
|
15326
15371
|
}
|
|
15327
15372
|
});
|
|
15328
15373
|
};
|
|
@@ -15843,5 +15888,5 @@ export {
|
|
|
15843
15888
|
ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
|
|
15844
15889
|
};
|
|
15845
15890
|
|
|
15846
|
-
//# debugId=
|
|
15891
|
+
//# debugId=4A79A80332A695EF64756E2164756E21
|
|
15847
15892
|
//# sourceMappingURL=index.js.map
|