@absolutejs/absolute 0.19.0-beta.1081 → 0.19.0-beta.1082
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-1N12Mn/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-1N12Mn/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-1N12Mn/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/index.js
CHANGED
|
@@ -40109,6 +40109,25 @@ var prepare = async (configOrPath) => {
|
|
|
40109
40109
|
return file5;
|
|
40110
40110
|
});
|
|
40111
40111
|
recordStep("create static plugin", stepStartedAt);
|
|
40112
|
+
const isFingerprintedAsset = (pathname) => {
|
|
40113
|
+
if (pathname.startsWith("/.absolutejs/"))
|
|
40114
|
+
return true;
|
|
40115
|
+
const base = pathname.slice(pathname.lastIndexOf("/") + 1);
|
|
40116
|
+
const hash = base.match(/[.-]([0-9a-z]{6,12})\.[0-9a-z]+$/i)?.[1];
|
|
40117
|
+
return hash ? /[0-9]/.test(hash) && /[a-z]/i.test(hash) : false;
|
|
40118
|
+
};
|
|
40119
|
+
const assetCachePlugin = new Elysia8({
|
|
40120
|
+
name: "absolutejs-asset-cache"
|
|
40121
|
+
}).onAfterHandle({ as: "global" }, ({ request, response }) => {
|
|
40122
|
+
if (!(response instanceof Response))
|
|
40123
|
+
return;
|
|
40124
|
+
if (request.method !== "GET" && request.method !== "HEAD")
|
|
40125
|
+
return;
|
|
40126
|
+
const { pathname } = new URL(request.url);
|
|
40127
|
+
if (pathname.endsWith("/") || !/\.[0-9a-z]+$/i.test(pathname))
|
|
40128
|
+
return;
|
|
40129
|
+
response.headers.set("cache-control", isFingerprintedAsset(pathname) ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate");
|
|
40130
|
+
});
|
|
40112
40131
|
stepStartedAt = performance.now();
|
|
40113
40132
|
const prerenderDir = join49(buildDir, "_prerendered");
|
|
40114
40133
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
@@ -40141,7 +40160,7 @@ var prepare = async (configOrPath) => {
|
|
|
40141
40160
|
});
|
|
40142
40161
|
stepStartedAt = performance.now();
|
|
40143
40162
|
const { imageOptimizer: imageOptimizer3 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
40144
|
-
const absolutejs2 = new Elysia8({ name: "absolutejs-runtime" }).use(imageOptimizer3(config2.images, buildDir)).use(prerenderPlugin).use(staticFiles).use(generatedAssetsPlugin).use(createNotFoundPlugin());
|
|
40163
|
+
const absolutejs2 = new Elysia8({ name: "absolutejs-runtime" }).use(assetCachePlugin).use(imageOptimizer3(config2.images, buildDir)).use(prerenderPlugin).use(staticFiles).use(generatedAssetsPlugin).use(createNotFoundPlugin());
|
|
40145
40164
|
await withOpenApi(absolutejs2, config2, process.cwd(), false);
|
|
40146
40165
|
await withTelemetry(absolutejs2, config2, process.cwd());
|
|
40147
40166
|
recordStep("assemble production runtime", stepStartedAt);
|
|
@@ -40150,7 +40169,7 @@ var prepare = async (configOrPath) => {
|
|
|
40150
40169
|
}
|
|
40151
40170
|
stepStartedAt = performance.now();
|
|
40152
40171
|
const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
40153
|
-
const absolutejs = new Elysia8({ name: "absolutejs-runtime" }).use(imageOptimizer2(config2.images, buildDir)).use(staticFiles).use(generatedAssetsPlugin).use(createNotFoundPlugin());
|
|
40172
|
+
const absolutejs = new Elysia8({ name: "absolutejs-runtime" }).use(assetCachePlugin).use(imageOptimizer2(config2.images, buildDir)).use(staticFiles).use(generatedAssetsPlugin).use(createNotFoundPlugin());
|
|
40154
40173
|
await withOpenApi(absolutejs, config2, process.cwd(), false);
|
|
40155
40174
|
await withTelemetry(absolutejs, config2, process.cwd());
|
|
40156
40175
|
recordStep("assemble production runtime", stepStartedAt);
|
|
@@ -47014,5 +47033,5 @@ export {
|
|
|
47014
47033
|
ANGULAR_INIT_TIMEOUT_MS
|
|
47015
47034
|
};
|
|
47016
47035
|
|
|
47017
|
-
//# debugId=
|
|
47036
|
+
//# debugId=5C2761F3C51DB90064756E2164756E21
|
|
47018
47037
|
//# sourceMappingURL=index.js.map
|