@gigadrive/network-config 3.4.15 → 3.4.16
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.
|
@@ -8,16 +8,27 @@
|
|
|
8
8
|
import { persistPprCacheEntry } from '__GIGADRIVE_PPR_RUNTIME__';
|
|
9
9
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
11
|
+
// Next's edge chunks must evaluate lazily on the first request, not at module
|
|
12
|
+
// scope: chunk evaluation can block on runtime facilities that only exist once
|
|
13
|
+
// the guest server is up, and an eager top-level await would keep the process
|
|
14
|
+
// from ever reaching its listening state (observed as a MicroVM boot loop in
|
|
15
|
+
// prod). The promise is shared, so evaluation still happens exactly once.
|
|
16
|
+
let handlerPromise;
|
|
17
|
+
const resolveHandler = () =>
|
|
18
|
+
(handlerPromise ??= (async () => {
|
|
19
|
+
globalThis.self ??= globalThis;
|
|
20
|
+
globalThis.AsyncLocalStorage ??= AsyncLocalStorage;
|
|
21
|
+
/* __GIGADRIVE_EDGE_IMPORTS__ */
|
|
22
|
+
const registry = globalThis._ENTRIES;
|
|
23
|
+
if (!registry) throw new Error('Next.js edge entry registry is unavailable');
|
|
24
|
+
const entry = await registry['__GIGADRIVE_EDGE_ENTRY_KEY__'];
|
|
25
|
+
const handler = entry?.['__GIGADRIVE_EDGE_HANDLER_EXPORT__'];
|
|
26
|
+
if (typeof handler !== 'function') throw new Error('Next.js edge handler is unavailable');
|
|
27
|
+
return handler;
|
|
28
|
+
})());
|
|
19
29
|
|
|
20
30
|
export async function fetch(request) {
|
|
31
|
+
const nextHandler = await resolveHandler();
|
|
21
32
|
const pending = [];
|
|
22
33
|
const url = new URL(request.url);
|
|
23
34
|
const response = await nextHandler(request, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gigadrive/network-config",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.16",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/Gigadrive/sdk.git",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"minimatch": "^10.0.3",
|
|
54
54
|
"safe-regex2": "^5.0.0",
|
|
55
55
|
"yaml": "^2.8.1",
|
|
56
|
-
"@gigadrive/
|
|
57
|
-
"@gigadrive/
|
|
56
|
+
"@gigadrive/commons": "2.1.1",
|
|
57
|
+
"@gigadrive/build-utils": "1.0.3"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@effect/platform": "^0.96.0",
|