@shopify/hydrogen 0.9.0 → 0.9.1
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.
|
@@ -22,16 +22,16 @@ export function hydrogenMiddleware({ dev, cache, indexTemplate, getServerEntrypo
|
|
|
22
22
|
* which is needed for proxy requests and server-side API requests.
|
|
23
23
|
*/
|
|
24
24
|
if (!globalThis.fetch) {
|
|
25
|
-
const
|
|
25
|
+
const fetch = await import('node-fetch');
|
|
26
26
|
const { default: AbortController } = await import('abort-controller');
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
globalThis.fetch = fetch;
|
|
29
29
|
// @ts-ignore
|
|
30
|
-
globalThis.Request = Request;
|
|
30
|
+
globalThis.Request = fetch.Request;
|
|
31
31
|
// @ts-ignore
|
|
32
|
-
globalThis.Response = Response;
|
|
32
|
+
globalThis.Response = fetch.Response;
|
|
33
33
|
// @ts-ignore
|
|
34
|
-
globalThis.Headers = Headers;
|
|
34
|
+
globalThis.Headers = fetch.Headers;
|
|
35
35
|
// @ts-ignore
|
|
36
36
|
globalThis.AbortController = AbortController;
|
|
37
37
|
}
|
|
@@ -62,17 +62,9 @@ export function hydrogenMiddleware({ dev, cache, indexTemplate, getServerEntrypo
|
|
|
62
62
|
});
|
|
63
63
|
response.statusCode = eventResponse.status;
|
|
64
64
|
if (eventResponse.body) {
|
|
65
|
-
|
|
66
|
-
while (true) {
|
|
67
|
-
const { done, value } = await reader.read();
|
|
68
|
-
if (done)
|
|
69
|
-
return response.end();
|
|
70
|
-
response.write(value);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
response.end();
|
|
65
|
+
response.write(eventResponse.body);
|
|
75
66
|
}
|
|
67
|
+
response.end();
|
|
76
68
|
}
|
|
77
69
|
}
|
|
78
70
|
catch (e) {
|
package/dist/esnext/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "0.9.
|
|
1
|
+
export declare const LIB_VERSION = "0.9.1";
|
package/dist/esnext/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = '0.9.
|
|
1
|
+
export const LIB_VERSION = '0.9.1';
|
|
@@ -48,16 +48,16 @@ function hydrogenMiddleware({ dev, cache, indexTemplate, getServerEntrypoint, de
|
|
|
48
48
|
* which is needed for proxy requests and server-side API requests.
|
|
49
49
|
*/
|
|
50
50
|
if (!globalThis.fetch) {
|
|
51
|
-
const
|
|
51
|
+
const fetch = await Promise.resolve().then(() => __importStar(require('node-fetch')));
|
|
52
52
|
const { default: AbortController } = await Promise.resolve().then(() => __importStar(require('abort-controller')));
|
|
53
53
|
// @ts-ignore
|
|
54
54
|
globalThis.fetch = fetch;
|
|
55
55
|
// @ts-ignore
|
|
56
|
-
globalThis.Request = Request;
|
|
56
|
+
globalThis.Request = fetch.Request;
|
|
57
57
|
// @ts-ignore
|
|
58
|
-
globalThis.Response = Response;
|
|
58
|
+
globalThis.Response = fetch.Response;
|
|
59
59
|
// @ts-ignore
|
|
60
|
-
globalThis.Headers = Headers;
|
|
60
|
+
globalThis.Headers = fetch.Headers;
|
|
61
61
|
// @ts-ignore
|
|
62
62
|
globalThis.AbortController = AbortController;
|
|
63
63
|
}
|
|
@@ -88,17 +88,9 @@ function hydrogenMiddleware({ dev, cache, indexTemplate, getServerEntrypoint, de
|
|
|
88
88
|
});
|
|
89
89
|
response.statusCode = eventResponse.status;
|
|
90
90
|
if (eventResponse.body) {
|
|
91
|
-
|
|
92
|
-
while (true) {
|
|
93
|
-
const { done, value } = await reader.read();
|
|
94
|
-
if (done)
|
|
95
|
-
return response.end();
|
|
96
|
-
response.write(value);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
response.end();
|
|
91
|
+
response.write(eventResponse.body);
|
|
101
92
|
}
|
|
93
|
+
response.end();
|
|
102
94
|
}
|
|
103
95
|
}
|
|
104
96
|
catch (e) {
|
package/dist/node/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "0.9.
|
|
1
|
+
export declare const LIB_VERSION = "0.9.1";
|
package/dist/node/version.js
CHANGED
package/package.json
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"@shopify:registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=14"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.9.
|
|
10
|
+
"version": "0.9.1",
|
|
11
11
|
"description": "Modern custom Shopify storefronts",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"main": "dist/esnext/index.js",
|
|
@@ -99,13 +99,12 @@
|
|
|
99
99
|
"isomorphic-dompurify": "^0.13.0",
|
|
100
100
|
"kolorist": "^1.5.1",
|
|
101
101
|
"magic-string": "^0.25.7",
|
|
102
|
-
"node-fetch": "^2.6.
|
|
102
|
+
"node-fetch": "^2.6.7",
|
|
103
103
|
"path-to-regexp": "^6.2.0",
|
|
104
104
|
"react-error-boundary": "^3.1.3",
|
|
105
105
|
"react-helmet-async": "^1.0.9",
|
|
106
106
|
"react-ssr-prepass": "^1.4.0",
|
|
107
|
-
"undici": "^4.12.2",
|
|
108
107
|
"vite-plugin-inspect": "^0.3.6"
|
|
109
108
|
},
|
|
110
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "b500ea200e5128e6a11f290e28921da7d2139d5a"
|
|
111
110
|
}
|