@modern-js/runtime 2.25.0 → 2.25.2
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.
- package/CHANGELOG.md +31 -0
- package/dist/cjs/ssr/cli/index.js +1 -1
- package/dist/cjs/ssr/serverRender/renderToStream/renderToPipe.worker.js +3 -4
- package/dist/esm/ssr/serverRender/renderToStream/renderToPipe.worker.js +3 -4
- package/dist/esm-node/ssr/cli/index.js +1 -1
- package/dist/esm-node/ssr/serverRender/renderToStream/renderToPipe.worker.js +3 -4
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @modern-js/runtime
|
|
2
2
|
|
|
3
|
+
## 2.25.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 272646c: feat(builder): bump webpack v5.88, support top level await
|
|
8
|
+
|
|
9
|
+
feat(builder): 升级 webpack v5.88, 支持 top level await
|
|
10
|
+
|
|
11
|
+
- e8a90f3: fix(ssr-plugin): worker streaming ssr douable enqueue the value so that ssr error
|
|
12
|
+
fix(ssr-plugin): worker streaming ssr 重复 enqueue chunk 值导致 ssr 错误
|
|
13
|
+
- Updated dependencies [63d8247]
|
|
14
|
+
- Updated dependencies [6651684]
|
|
15
|
+
- Updated dependencies [272646c]
|
|
16
|
+
- Updated dependencies [358ed24]
|
|
17
|
+
- @modern-js/utils@2.25.2
|
|
18
|
+
- @modern-js/plugin@2.25.2
|
|
19
|
+
- @modern-js/types@2.25.2
|
|
20
|
+
|
|
21
|
+
## 2.25.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 85366bc: chore(deps): bump esbuild from v15/v16 to v17
|
|
26
|
+
|
|
27
|
+
chore(deps): 将 esbuild 从 v15/v16 升级到 v17
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [9f78d0c]
|
|
30
|
+
- @modern-js/utils@2.25.1
|
|
31
|
+
- @modern-js/plugin@2.25.1
|
|
32
|
+
- @modern-js/types@2.25.1
|
|
33
|
+
|
|
3
34
|
## 2.25.0
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
@@ -114,7 +114,7 @@ const ssrPlugin = () => {
|
|
|
114
114
|
throw new Error(`router v5 plugin doesn't support streaming SSR, check your config 'runtime.router'`);
|
|
115
115
|
}
|
|
116
116
|
if (fileSystemRoutes && !entrypoint.nestedRoutesEntry) {
|
|
117
|
-
throw new Error(
|
|
117
|
+
throw new Error("You should switch to file-system based router to support streaming SSR.");
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
const useSSG = (0, _utils.isSSGEntry)(userConfig, entryName, entrypoints);
|
|
@@ -33,8 +33,8 @@ function renderToPipe(rootElement, context, options) {
|
|
|
33
33
|
nonce: ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.nonce,
|
|
34
34
|
onError(error) {
|
|
35
35
|
var _options_onError;
|
|
36
|
-
ssrContext.logger.error("An error occurs during streaming SSR", error);
|
|
37
|
-
ssrContext.metrics.emitCounter("app.render.streaming.error", 1);
|
|
36
|
+
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.logger.error("An error occurs during streaming SSR", error);
|
|
37
|
+
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.metrics.emitCounter("app.render.streaming.error", 1);
|
|
38
38
|
options === null || options === void 0 ? void 0 : (_options_onError = options.onError) === null || _options_onError === void 0 ? void 0 : _options_onError.call(options, error);
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -56,7 +56,6 @@ function renderToPipe(rootElement, context, options) {
|
|
|
56
56
|
shellChunkStatus = ShellChunkStatus.FINIESH;
|
|
57
57
|
controller.enqueue(encodeForWebStream(`${shellBefore}${concatedChunk}${shellAfter}`));
|
|
58
58
|
}
|
|
59
|
-
controller.enqueue(encodeForWebStream(concatedChunk));
|
|
60
59
|
} else {
|
|
61
60
|
controller.enqueue(value);
|
|
62
61
|
}
|
|
@@ -67,7 +66,7 @@ function renderToPipe(rootElement, context, options) {
|
|
|
67
66
|
});
|
|
68
67
|
return injectableStream;
|
|
69
68
|
} catch (err) {
|
|
70
|
-
ssrContext.metrics.emitCounter("app.render.streaming.shell.error", 1);
|
|
69
|
+
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.metrics.emitCounter("app.render.streaming.shell.error", 1);
|
|
71
70
|
const { shellAfter: shellAfter2, shellBefore: shellBefore2 } = (0, _template.getTemplates)(context, _types.RenderLevel.CLIENT_RENDER);
|
|
72
71
|
const fallbackHtml = `${shellBefore2}${shellAfter2}`;
|
|
73
72
|
return fallbackHtml;
|
|
@@ -39,8 +39,8 @@ function renderToPipe(rootElement, context, options) {
|
|
|
39
39
|
nonce: ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.nonce,
|
|
40
40
|
onError: function onError(error) {
|
|
41
41
|
var _options_onError;
|
|
42
|
-
ssrContext.logger.error("An error occurs during streaming SSR", error);
|
|
43
|
-
ssrContext.metrics.emitCounter("app.render.streaming.error", 1);
|
|
42
|
+
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.logger.error("An error occurs during streaming SSR", error);
|
|
43
|
+
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.metrics.emitCounter("app.render.streaming.error", 1);
|
|
44
44
|
options === null || options === void 0 ? void 0 : (_options_onError = options.onError) === null || _options_onError === void 0 ? void 0 : _options_onError.call(options, error);
|
|
45
45
|
}
|
|
46
46
|
}))
|
|
@@ -80,7 +80,6 @@ function renderToPipe(rootElement, context, options) {
|
|
|
80
80
|
shellChunkStatus = ShellChunkStatus.FINIESH;
|
|
81
81
|
controller.enqueue(encodeForWebStream("".concat(shellBefore).concat(concatedChunk).concat(shellAfter)));
|
|
82
82
|
}
|
|
83
|
-
controller.enqueue(encodeForWebStream(concatedChunk));
|
|
84
83
|
} else {
|
|
85
84
|
controller.enqueue(value);
|
|
86
85
|
}
|
|
@@ -102,7 +101,7 @@ function renderToPipe(rootElement, context, options) {
|
|
|
102
101
|
];
|
|
103
102
|
case 3:
|
|
104
103
|
err = _state.sent();
|
|
105
|
-
ssrContext.metrics.emitCounter("app.render.streaming.shell.error", 1);
|
|
104
|
+
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.metrics.emitCounter("app.render.streaming.shell.error", 1);
|
|
106
105
|
_getTemplates1 = getTemplates(context, RenderLevel.CLIENT_RENDER), shellAfter1 = _getTemplates1.shellAfter, shellBefore1 = _getTemplates1.shellBefore;
|
|
107
106
|
fallbackHtml = "".concat(shellBefore1).concat(shellAfter1);
|
|
108
107
|
return [
|
|
@@ -94,7 +94,7 @@ export const ssrPlugin = () => {
|
|
|
94
94
|
throw new Error(`router v5 plugin doesn't support streaming SSR, check your config 'runtime.router'`);
|
|
95
95
|
}
|
|
96
96
|
if (fileSystemRoutes && !entrypoint.nestedRoutesEntry) {
|
|
97
|
-
throw new Error(
|
|
97
|
+
throw new Error("You should switch to file-system based router to support streaming SSR.");
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
const useSSG = isSSGEntry(userConfig, entryName, entrypoints);
|
|
@@ -23,8 +23,8 @@ function renderToPipe(rootElement, context, options) {
|
|
|
23
23
|
nonce: ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.nonce,
|
|
24
24
|
onError(error) {
|
|
25
25
|
var _options_onError;
|
|
26
|
-
ssrContext.logger.error("An error occurs during streaming SSR", error);
|
|
27
|
-
ssrContext.metrics.emitCounter("app.render.streaming.error", 1);
|
|
26
|
+
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.logger.error("An error occurs during streaming SSR", error);
|
|
27
|
+
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.metrics.emitCounter("app.render.streaming.error", 1);
|
|
28
28
|
options === null || options === void 0 ? void 0 : (_options_onError = options.onError) === null || _options_onError === void 0 ? void 0 : _options_onError.call(options, error);
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -46,7 +46,6 @@ function renderToPipe(rootElement, context, options) {
|
|
|
46
46
|
shellChunkStatus = ShellChunkStatus.FINIESH;
|
|
47
47
|
controller.enqueue(encodeForWebStream(`${shellBefore}${concatedChunk}${shellAfter}`));
|
|
48
48
|
}
|
|
49
|
-
controller.enqueue(encodeForWebStream(concatedChunk));
|
|
50
49
|
} else {
|
|
51
50
|
controller.enqueue(value);
|
|
52
51
|
}
|
|
@@ -57,7 +56,7 @@ function renderToPipe(rootElement, context, options) {
|
|
|
57
56
|
});
|
|
58
57
|
return injectableStream;
|
|
59
58
|
} catch (err) {
|
|
60
|
-
ssrContext.metrics.emitCounter("app.render.streaming.shell.error", 1);
|
|
59
|
+
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.metrics.emitCounter("app.render.streaming.shell.error", 1);
|
|
61
60
|
const { shellAfter: shellAfter2, shellBefore: shellBefore2 } = getTemplates(context, RenderLevel.CLIENT_RENDER);
|
|
62
61
|
const fallbackHtml = `${shellBefore2}${shellAfter2}`;
|
|
63
62
|
return fallbackHtml;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.25.
|
|
18
|
+
"version": "2.25.2",
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=14.17.6"
|
|
21
21
|
},
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@types/react-helmet": "^6.1.2",
|
|
161
161
|
"@types/redux-logger": "^3.0.9",
|
|
162
162
|
"@types/styled-components": "^5.1.14",
|
|
163
|
-
"esbuild": "0.
|
|
163
|
+
"esbuild": "0.17.19",
|
|
164
164
|
"hoist-non-react-statics": "^3.3.2",
|
|
165
165
|
"invariant": "^2.2.4",
|
|
166
166
|
"react-helmet": "^6.1.0",
|
|
@@ -169,9 +169,9 @@
|
|
|
169
169
|
"redux-logger": "^3.0.6",
|
|
170
170
|
"styled-components": "^5.3.1",
|
|
171
171
|
"@swc/helpers": "0.5.1",
|
|
172
|
-
"@modern-js/plugin": "2.25.
|
|
173
|
-
"@modern-js/types": "2.25.
|
|
174
|
-
"@modern-js/utils": "2.25.
|
|
172
|
+
"@modern-js/plugin": "2.25.2",
|
|
173
|
+
"@modern-js/types": "2.25.2",
|
|
174
|
+
"@modern-js/utils": "2.25.2"
|
|
175
175
|
},
|
|
176
176
|
"peerDependencies": {
|
|
177
177
|
"react": ">=17",
|
|
@@ -191,12 +191,12 @@
|
|
|
191
191
|
"react-dom": "^18",
|
|
192
192
|
"ts-jest": "^29.1.0",
|
|
193
193
|
"typescript": "^5",
|
|
194
|
-
"webpack": "^5.
|
|
195
|
-
"@modern-js/app-tools": "2.25.
|
|
196
|
-
"@modern-js/core": "2.25.
|
|
197
|
-
"@modern-js/server-core": "2.25.
|
|
198
|
-
"@scripts/build": "2.25.
|
|
199
|
-
"@scripts/jest-config": "2.25.
|
|
194
|
+
"webpack": "^5.88.1",
|
|
195
|
+
"@modern-js/app-tools": "2.25.2",
|
|
196
|
+
"@modern-js/core": "2.25.2",
|
|
197
|
+
"@modern-js/server-core": "2.25.2",
|
|
198
|
+
"@scripts/build": "2.25.2",
|
|
199
|
+
"@scripts/jest-config": "2.25.2"
|
|
200
200
|
},
|
|
201
201
|
"sideEffects": false,
|
|
202
202
|
"modernConfig": {},
|