@opennextjs/aws 3.9.6 → 3.9.7
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.
|
@@ -10,7 +10,15 @@ declare const _default: {
|
|
|
10
10
|
} | undefined>;
|
|
11
11
|
set(cacheKey: string, pendingEntry: Promise<ComposableCacheEntry>): Promise<void>;
|
|
12
12
|
refreshTags(): Promise<void>;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The signature has changed in Next.js 16
|
|
15
|
+
* - Before Next.js 16, the method takes `...tags: string[]`
|
|
16
|
+
* - From Next.js 16, the method takes `tags: string[]`
|
|
17
|
+
*/
|
|
18
|
+
getExpiration(...tags: string[] | string[][]): Promise<number>;
|
|
19
|
+
/**
|
|
20
|
+
* This method is only used before Next.js 16
|
|
21
|
+
*/
|
|
14
22
|
expireTags(...tags: string[]): Promise<void>;
|
|
15
23
|
receiveExpiredTags(...tags: string[]): Promise<void>;
|
|
16
24
|
};
|
|
@@ -73,14 +73,23 @@ export default {
|
|
|
73
73
|
// We don't do anything for now, do we want to do something here ???
|
|
74
74
|
return;
|
|
75
75
|
},
|
|
76
|
+
/**
|
|
77
|
+
* The signature has changed in Next.js 16
|
|
78
|
+
* - Before Next.js 16, the method takes `...tags: string[]`
|
|
79
|
+
* - From Next.js 16, the method takes `tags: string[]`
|
|
80
|
+
*/
|
|
76
81
|
async getExpiration(...tags) {
|
|
77
82
|
if (globalThis.tagCache.mode === "nextMode") {
|
|
78
|
-
|
|
83
|
+
// Use `.flat()` to accommodate both signatures
|
|
84
|
+
return globalThis.tagCache.getLastRevalidated(tags.flat());
|
|
79
85
|
}
|
|
80
86
|
// We always return 0 here, original tag cache are handled directly in the get part
|
|
81
87
|
// TODO: We need to test this more, i'm not entirely sure that this is working as expected
|
|
82
88
|
return 0;
|
|
83
89
|
},
|
|
90
|
+
/**
|
|
91
|
+
* This method is only used before Next.js 16
|
|
92
|
+
*/
|
|
84
93
|
async expireTags(...tags) {
|
|
85
94
|
if (globalThis.tagCache.mode === "nextMode") {
|
|
86
95
|
return writeTags(tags);
|
package/dist/types/cache.d.ts
CHANGED
|
@@ -126,7 +126,13 @@ export interface ComposableCacheHandler {
|
|
|
126
126
|
get(cacheKey: string): Promise<ComposableCacheEntry | undefined>;
|
|
127
127
|
set(cacheKey: string, pendingEntry: Promise<ComposableCacheEntry>): Promise<void>;
|
|
128
128
|
refreshTags(): Promise<void>;
|
|
129
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Next 16 takes an array of tags instead of variadic arguments
|
|
131
|
+
*/
|
|
132
|
+
getExpiration(...tags: string[] | string[][]): Promise<number>;
|
|
133
|
+
/**
|
|
134
|
+
* Removed from Next.js 16
|
|
135
|
+
*/
|
|
130
136
|
expireTags(...tags: string[]): Promise<void>;
|
|
131
137
|
/**
|
|
132
138
|
* This function is only there for older versions and do nothing
|