@modern-js/prod-server 1.2.0 → 1.2.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @modern-js/prod-server
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2ed8f7d: fix: the \_SERVER_DATA injection twice causes the prod-server route error.
|
|
8
|
+
fix: \_SERVER_DATA 二次注入,导致服务器路由错误
|
|
9
|
+
- Updated dependencies [4fc801f]
|
|
10
|
+
- Updated dependencies [c8614b8]
|
|
11
|
+
- @modern-js/utils@1.8.0
|
|
12
|
+
- @modern-js/server-core@1.4.1
|
|
13
|
+
|
|
3
14
|
## 1.2.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
|
@@ -443,8 +443,12 @@ export class ModernServer {
|
|
|
443
443
|
context,
|
|
444
444
|
templateAPI
|
|
445
445
|
});
|
|
446
|
-
await this.injectMicroFE(context, templateAPI);
|
|
447
|
-
|
|
446
|
+
await this.injectMicroFE(context, templateAPI); // It will inject _SERVER_DATA twice, when SSG mode.
|
|
447
|
+
// The first time was in ssg html created, the seoncd time was in prod-server start.
|
|
448
|
+
// but the second wound causes route error.
|
|
449
|
+
// To ensure that the second injection fails, the _SERVER_DATA inject at the front of head,
|
|
450
|
+
|
|
451
|
+
templateAPI.prependHead(`<script>window._SERVER_DATA=${JSON.stringify(context.serverData)}</script>`);
|
|
448
452
|
response = templateAPI.get();
|
|
449
453
|
}
|
|
450
454
|
|
|
@@ -480,8 +480,12 @@ class ModernServer {
|
|
|
480
480
|
context,
|
|
481
481
|
templateAPI
|
|
482
482
|
});
|
|
483
|
-
await this.injectMicroFE(context, templateAPI);
|
|
484
|
-
|
|
483
|
+
await this.injectMicroFE(context, templateAPI); // It will inject _SERVER_DATA twice, when SSG mode.
|
|
484
|
+
// The first time was in ssg html created, the seoncd time was in prod-server start.
|
|
485
|
+
// but the second wound causes route error.
|
|
486
|
+
// To ensure that the second injection fails, the _SERVER_DATA inject at the front of head,
|
|
487
|
+
|
|
488
|
+
templateAPI.prependHead(`<script>window._SERVER_DATA=${JSON.stringify(context.serverData)}</script>`);
|
|
485
489
|
response = templateAPI.get();
|
|
486
490
|
}
|
|
487
491
|
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.2.
|
|
14
|
+
"version": "1.2.1",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@modern-js/utils": "^1.
|
|
31
|
+
"@modern-js/utils": "^1.8.0",
|
|
32
32
|
"@babel/compat-data": "^7.17.10",
|
|
33
33
|
"@modern-js/server-core": "^1.4.1",
|
|
34
34
|
"axios": "^0.24.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@modern-js/types": "1.6.0",
|
|
47
|
-
"@modern-js/core": "1.13.
|
|
47
|
+
"@modern-js/core": "1.13.1",
|
|
48
48
|
"@scripts/jest-config": "0.0.0",
|
|
49
49
|
"@scripts/build": "0.0.0",
|
|
50
50
|
"@types/cookie": "^0.4.1",
|