@shuvi/platform-web 1.0.49 → 1.0.50
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.
|
@@ -24,7 +24,7 @@ export class ReactServerView {
|
|
|
24
24
|
constructor() {
|
|
25
25
|
this.renderApp = ({ req, app, manifest }) => __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
yield Loadable.preloadAll();
|
|
27
|
-
const { router, appComponent: AppComponent, setError: setAppError
|
|
27
|
+
const { router, appComponent: AppComponent, setError: setAppError } = app;
|
|
28
28
|
yield router.ready;
|
|
29
29
|
// todo: move these into renderer
|
|
30
30
|
let { matches, redirected, state, pathname } = router.current;
|
|
@@ -32,8 +32,17 @@ export class ReactServerView {
|
|
|
32
32
|
if (!matches.length) {
|
|
33
33
|
setAppError(SHUVI_ERROR.PAGE_NOT_FOUND);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
/**
|
|
36
|
+
* @Note Please note that you should not use `error` directly, please
|
|
37
|
+
* use `app.error` instead.
|
|
38
|
+
* ❌ if (error && error.fatal)
|
|
39
|
+
* ✅ if (app.error && app.error.fatal)
|
|
40
|
+
*/
|
|
41
|
+
if (app.error && app.error.fatal) {
|
|
42
|
+
return response('', {
|
|
43
|
+
status: app.error.code,
|
|
44
|
+
statusText: app.error.message
|
|
45
|
+
});
|
|
37
46
|
}
|
|
38
47
|
if (redirected) {
|
|
39
48
|
// handel loader redirect
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuvi/platform-web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.50",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/shuvijs/shuvi.git",
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@next/react-refresh-utils": "12.1.6",
|
|
75
|
-
"@shuvi/error-overlay": "1.0.
|
|
76
|
-
"@shuvi/hook": "1.0.
|
|
77
|
-
"@shuvi/platform-shared": "1.0.
|
|
78
|
-
"@shuvi/router": "1.0.
|
|
79
|
-
"@shuvi/router-react": "1.0.
|
|
80
|
-
"@shuvi/runtime": "1.0.
|
|
81
|
-
"@shuvi/shared": "1.0.
|
|
82
|
-
"@shuvi/toolpack": "1.0.
|
|
83
|
-
"@shuvi/utils": "1.0.
|
|
75
|
+
"@shuvi/error-overlay": "1.0.50",
|
|
76
|
+
"@shuvi/hook": "1.0.50",
|
|
77
|
+
"@shuvi/platform-shared": "1.0.50",
|
|
78
|
+
"@shuvi/router": "1.0.50",
|
|
79
|
+
"@shuvi/router-react": "1.0.50",
|
|
80
|
+
"@shuvi/runtime": "1.0.50",
|
|
81
|
+
"@shuvi/shared": "1.0.50",
|
|
82
|
+
"@shuvi/toolpack": "1.0.50",
|
|
83
|
+
"@shuvi/utils": "1.0.50",
|
|
84
84
|
"content-type": "1.0.4",
|
|
85
85
|
"core-js": "3.6.5",
|
|
86
86
|
"doura": "0.0.13",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"whatwg-fetch": "3.0.0"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"@shuvi/service": "1.0.
|
|
101
|
+
"@shuvi/service": "1.0.50"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@shuvi/service": "workspace:*",
|