@modern-js/server-core 2.68.17 → 2.68.18
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.
|
@@ -75,8 +75,11 @@ class CustomServer {
|
|
|
75
75
|
const afterStreamingRenderContext = (0, import_context.createAfterStreamingRenderContext)(baseHookCtx, routeInfo);
|
|
76
76
|
c.res = (0, import_utils2.transformResponse)(c.res, async (chunk) => {
|
|
77
77
|
const context = afterStreamingRenderContext(chunk);
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const result = await this.hooks.afterStreamingRender.call(context);
|
|
79
|
+
if (typeof result === "string") {
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
return result.chunk;
|
|
80
83
|
});
|
|
81
84
|
} else {
|
|
82
85
|
const afterRenderCtx = await (0, import_context.getAfterRenderCtx)(c, baseHookCtx, routeInfo);
|
|
@@ -100,7 +100,7 @@ var CustomServer = /* @__PURE__ */ function() {
|
|
|
100
100
|
afterStreamingRenderContext = createAfterStreamingRenderContext(baseHookCtx, routeInfo);
|
|
101
101
|
c.res = transformResponse(c.res, function() {
|
|
102
102
|
var _ref2 = _async_to_generator(function(chunk) {
|
|
103
|
-
var context,
|
|
103
|
+
var context, result;
|
|
104
104
|
return _ts_generator(this, function(_state2) {
|
|
105
105
|
switch (_state2.label) {
|
|
106
106
|
case 0:
|
|
@@ -110,10 +110,16 @@ var CustomServer = /* @__PURE__ */ function() {
|
|
|
110
110
|
_this.hooks.afterStreamingRender.call(context)
|
|
111
111
|
];
|
|
112
112
|
case 1:
|
|
113
|
-
|
|
113
|
+
result = _state2.sent();
|
|
114
|
+
if (typeof result === "string") {
|
|
115
|
+
return [
|
|
116
|
+
2,
|
|
117
|
+
result
|
|
118
|
+
];
|
|
119
|
+
}
|
|
114
120
|
return [
|
|
115
121
|
2,
|
|
116
|
-
|
|
122
|
+
result.chunk
|
|
117
123
|
];
|
|
118
124
|
}
|
|
119
125
|
});
|
|
@@ -51,8 +51,11 @@ class CustomServer {
|
|
|
51
51
|
const afterStreamingRenderContext = createAfterStreamingRenderContext(baseHookCtx, routeInfo);
|
|
52
52
|
c.res = transformResponse(c.res, async (chunk) => {
|
|
53
53
|
const context = afterStreamingRenderContext(chunk);
|
|
54
|
-
const
|
|
55
|
-
|
|
54
|
+
const result = await this.hooks.afterStreamingRender.call(context);
|
|
55
|
+
if (typeof result === "string") {
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
return result.chunk;
|
|
56
59
|
});
|
|
57
60
|
} else {
|
|
58
61
|
const afterRenderCtx = await getAfterRenderCtx(c, baseHookCtx, routeInfo);
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.68.
|
|
18
|
+
"version": "2.68.18",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"flatted": "^3.3.3",
|
|
63
63
|
"hono": "^3.12.2",
|
|
64
64
|
"ts-deepmerge": "7.0.2",
|
|
65
|
-
"@modern-js/plugin": "2.68.
|
|
66
|
-
"@modern-js/plugin-v2": "2.68.
|
|
67
|
-
"@modern-js/runtime-utils": "2.68.
|
|
68
|
-
"@modern-js/utils": "2.68.
|
|
65
|
+
"@modern-js/plugin": "2.68.18",
|
|
66
|
+
"@modern-js/plugin-v2": "2.68.18",
|
|
67
|
+
"@modern-js/runtime-utils": "2.68.18",
|
|
68
|
+
"@modern-js/utils": "2.68.18"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/cloneable-readable": "^2.0.3",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"jest": "^29",
|
|
77
77
|
"ts-jest": "^29.1.0",
|
|
78
78
|
"typescript": "^5",
|
|
79
|
-
"@modern-js/types": "2.68.
|
|
79
|
+
"@modern-js/types": "2.68.18",
|
|
80
80
|
"@scripts/build": "2.66.0",
|
|
81
81
|
"@scripts/jest-config": "2.66.0"
|
|
82
82
|
},
|