@opennextjs/aws 3.9.5 → 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
- getExpiration(...tags: string[]): Promise<number>;
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
- return globalThis.tagCache.getLastRevalidated(tags);
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);
@@ -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
- getExpiration(...tags: string[]): Promise<number>;
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
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "access": "public"
4
4
  },
5
5
  "name": "@opennextjs/aws",
6
- "version": "3.9.5",
6
+ "version": "3.9.7",
7
7
  "bin": {
8
8
  "open-next": "./dist/index.js"
9
9
  },
@@ -60,7 +60,7 @@
60
60
  "typescript": "5.9.3"
61
61
  },
62
62
  "peerDependencies": {
63
- "next": "^14.2.34 || ~15.0.6 || ~15.1.10 || ~15.2.7 || ~15.3.7 || ~15.4.9 || ~15.5.8 || ^16.0.9"
63
+ "next": "^14.2.35 || ~15.0.7 || ~15.1.11 || ~15.2.8 || ~15.3.8 || ~15.4.10 || ~15.5.9 || ^16.0.10"
64
64
  },
65
65
  "bugs": {
66
66
  "url": "https://github.com/opennextjs/opennextjs-aws/issues"