@opennextjs/aws 4.1.13 → 4.1.15
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/adapters/cache.d.ts +21 -1
- package/dist/adapters/cache.js +138 -30
- package/dist/adapters/composable-cache.d.ts +20 -0
- package/dist/adapters/composable-cache.js +33 -8
- package/dist/adapters/config/index.js +14 -4
- package/dist/adapters/config/util.d.ts +19 -0
- package/dist/adapters/config/util.js +21 -0
- package/dist/adapters/edge-adapter.js +2 -11
- package/dist/adapters/image-optimization-adapter.js +8 -2
- package/dist/build/createAssets.d.ts +3 -0
- package/dist/build/createAssets.js +11 -8
- package/dist/build/createImageOptimizationBundle.js +0 -1
- package/dist/build/helper.js +1 -1
- package/dist/build/installDeps.js +6 -7
- package/dist/build/patch/patches/patchNextServer.d.ts +25 -0
- package/dist/build/patch/patches/patchNextServer.js +48 -0
- package/dist/core/requestHandler.js +5 -0
- package/dist/core/resolve.d.ts +8 -1
- package/dist/core/revalidate.d.ts +68 -0
- package/dist/core/revalidate.js +143 -0
- package/dist/core/routing/cacheInterceptor.js +27 -4
- package/dist/core/routing/matcher.js +16 -4
- package/dist/core/routing/middleware.d.ts +4 -0
- package/dist/core/routing/middleware.js +19 -0
- package/dist/core/routing/routeParamPlaceholder.d.ts +14 -0
- package/dist/core/routing/routeParamPlaceholder.js +42 -0
- package/dist/core/routingHandler.js +8 -2
- package/dist/core/util.js +5 -0
- package/dist/http/framing.d.ts +35 -0
- package/dist/http/framing.js +181 -0
- package/dist/http/util.d.ts +11 -0
- package/dist/http/util.js +26 -0
- package/dist/overrides/cdnInvalidation/cloudfront.js +2 -1
- package/dist/overrides/proxyExternalRequest/fetch.js +5 -1
- package/dist/overrides/proxyExternalRequest/node.js +5 -0
- package/dist/overrides/wrappers/express-dev.js +3 -5
- package/dist/overrides/wrappers/node.js +2 -3
- package/dist/plugins/edge.js +3 -2
- package/dist/types/cache.d.ts +12 -4
- package/dist/types/global.d.ts +7 -0
- package/dist/types/open-next.d.ts +4 -1
- package/dist/types/overrides.d.ts +47 -0
- package/dist/utils/cache.d.ts +14 -0
- package/dist/utils/cache.js +21 -1
- package/package.json +3 -3
package/dist/utils/cache.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
1
3
|
import { debug } from "../adapters/logger";
|
|
2
4
|
import { CACHE_TAGS_HEADER } from "./cacheHeaders";
|
|
3
5
|
import { compareSemver } from "./semver";
|
|
6
|
+
/**
|
|
7
|
+
* Computes the key used to store a composable (`"use cache"`) entry.
|
|
8
|
+
*
|
|
9
|
+
* The cache key provided by Next.js embeds the serialized arguments of the cached function and may
|
|
10
|
+
* contain any UTF-16 string. Storage backends transform keys (path normalization, URL parsing,
|
|
11
|
+
* UTF-8 encoding, ...) which could map distinct Next.js keys to the same stored entry.
|
|
12
|
+
*
|
|
13
|
+
* The storage key is the sha256 of the exact UTF-16 code units of the cache key, as a 64 characters
|
|
14
|
+
* lowercase hex string that every backend can store as is.
|
|
15
|
+
*
|
|
16
|
+
* @param cacheKey The cache key provided by Next.js
|
|
17
|
+
* @returns The key to use for the incremental cache and the tag cache
|
|
18
|
+
*/
|
|
19
|
+
export function getComposableCacheStorageKey(cacheKey) {
|
|
20
|
+
return createHash("sha256")
|
|
21
|
+
.update(Buffer.from(cacheKey, "utf16le"))
|
|
22
|
+
.digest("hex");
|
|
23
|
+
}
|
|
4
24
|
/**
|
|
5
25
|
*
|
|
6
26
|
* @param key The key for that specific cache entry
|
|
@@ -45,7 +65,7 @@ export function getStaleLastModified(revalidate) {
|
|
|
45
65
|
return 1;
|
|
46
66
|
}
|
|
47
67
|
if (typeof revalidate !== "number") {
|
|
48
|
-
//
|
|
68
|
+
// The cache adapter then reports `{ revalidate: 1 }` without `expire` (see `getCacheControl`),
|
|
49
69
|
// so the historical sentinel is still safe here.
|
|
50
70
|
return 1;
|
|
51
71
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"access": "public"
|
|
4
4
|
},
|
|
5
5
|
"name": "@opennextjs/aws",
|
|
6
|
-
"version": "4.1.
|
|
6
|
+
"version": "4.1.15",
|
|
7
7
|
"bin": {
|
|
8
8
|
"open-next": "./dist/index.js"
|
|
9
9
|
},
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"@types/node": "20.17.6",
|
|
58
58
|
"concurrently": "^9.2.4",
|
|
59
59
|
"diff": "^9.0.0",
|
|
60
|
-
"next": "16.4.
|
|
60
|
+
"next": "16.4.5",
|
|
61
61
|
"tsc-alias": "^1.9.7",
|
|
62
62
|
"typescript": "5.9.3"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"diff": "^9.0.0",
|
|
66
|
-
"next": ">=15.5.
|
|
66
|
+
"next": ">=15.5.29 <16 || >=16.4.5"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"diff": {
|