@modern-js/prod-server 2.13.4 → 2.14.0

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,22 @@
1
1
  # @modern-js/prod-server
2
2
 
3
+ ## 2.14.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 60a81d0: feat: add ssr.inlineScript for use inline json instead inline script when ssr
8
+ feat: 添加 ssr.inlineScript 用于在 ssr 模式下使用内联 json 而不是内联脚本
9
+ - Updated dependencies [4779152]
10
+ - Updated dependencies [8a3c693]
11
+ - Updated dependencies [9321bef]
12
+ - Updated dependencies [9b45c58]
13
+ - Updated dependencies [52d0cb1]
14
+ - Updated dependencies [60a81d0]
15
+ - Updated dependencies [dacef96]
16
+ - Updated dependencies [16399fd]
17
+ - @modern-js/utils@2.14.0
18
+ - @modern-js/server-core@2.14.0
19
+
3
20
  ## 2.13.4
4
21
 
5
22
  ### Patch Changes
@@ -25,7 +25,7 @@ var import_template = require("../hook-api/template");
25
25
  const injectServerData = (content, context) => {
26
26
  const template = new import_template.TemplateAPI(content);
27
27
  template.prependHead(
28
- `<script>window._SERVER_DATA=${JSON.stringify(
28
+ `<script type="application/json" id="__MODERN_SERVER_DATA__">${JSON.stringify(
29
29
  context.serverData
30
30
  )}</script>`
31
31
  );
@@ -34,7 +34,7 @@ const injectServerData = (content, context) => {
34
34
  const injectServerDataStream = (content, context) => {
35
35
  return content.pipe(
36
36
  (0, import_template.templateInjectableStream)({
37
- prependHead: `<script>window._SERVER_DATA=${JSON.stringify(
37
+ prependHead: `<script type="application/json" id="__MODERN_SERVER_DATA__">${JSON.stringify(
38
38
  context.serverData
39
39
  )}</script>`
40
40
  })
@@ -1,12 +1,12 @@
1
1
  import { TemplateAPI, templateInjectableStream } from "../hook-api/template";
2
2
  var injectServerData = function(content, context) {
3
3
  var template = new TemplateAPI(content);
4
- template.prependHead("<script>window._SERVER_DATA=".concat(JSON.stringify(context.serverData), "</script>"));
4
+ template.prependHead('<script type="application/json" id="__MODERN_SERVER_DATA__">'.concat(JSON.stringify(context.serverData), "</script>"));
5
5
  return template.get();
6
6
  };
7
7
  var injectServerDataStream = function(content, context) {
8
8
  return content.pipe(templateInjectableStream({
9
- prependHead: "<script>window._SERVER_DATA=".concat(JSON.stringify(context.serverData), "</script>")
9
+ prependHead: '<script type="application/json" id="__MODERN_SERVER_DATA__">'.concat(JSON.stringify(context.serverData), "</script>")
10
10
  }));
11
11
  };
12
12
  export { injectServerData, injectServerDataStream };
@@ -2,7 +2,7 @@ import { TemplateAPI, templateInjectableStream } from "../hook-api/template";
2
2
  const injectServerData = (content, context) => {
3
3
  const template = new TemplateAPI(content);
4
4
  template.prependHead(
5
- `<script>window._SERVER_DATA=${JSON.stringify(
5
+ `<script type="application/json" id="__MODERN_SERVER_DATA__">${JSON.stringify(
6
6
  context.serverData
7
7
  )}</script>`
8
8
  );
@@ -11,7 +11,7 @@ const injectServerData = (content, context) => {
11
11
  const injectServerDataStream = (content, context) => {
12
12
  return content.pipe(
13
13
  templateInjectableStream({
14
- prependHead: `<script>window._SERVER_DATA=${JSON.stringify(
14
+ prependHead: `<script type="application/json" id="__MODERN_SERVER_DATA__">${JSON.stringify(
15
15
  context.serverData
16
16
  )}</script>`
17
17
  })
@@ -2,7 +2,7 @@
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
4
  /// <reference types="node/http" />
5
- /// <reference types=".dts-temp/UYvsWNOnEBMa44BGkYlLy/src/type" />
5
+ /// <reference types=".dts-temp/n1HIMoX_AzoA1M8E5zepR/src/type" />
6
6
  import { IncomingMessage, ServerResponse } from 'http';
7
7
  import qs from 'querystring';
8
8
  import type { ModernServerContext as ModernServerContextInterface } from '@modern-js/types';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node/http" />
3
- /// <reference types=".dts-temp/UYvsWNOnEBMa44BGkYlLy/src/type" />
3
+ /// <reference types=".dts-temp/n1HIMoX_AzoA1M8E5zepR/src/type" />
4
4
  import { IncomingMessage } from 'http';
5
5
  import type { OutputNormalizedConfig, HtmlNormalizedConfig } from '@modern-js/server-core';
6
6
  export declare const debug: any;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.13.4",
14
+ "version": "2.14.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/cjs/index.js",
@@ -56,8 +56,8 @@
56
56
  "merge-deep": "^3.0.3",
57
57
  "path-to-regexp": "^6.2.0",
58
58
  "serve-static": "^1.14.1",
59
- "@modern-js/utils": "2.13.4",
60
- "@modern-js/server-core": "2.13.4"
59
+ "@modern-js/utils": "2.14.0",
60
+ "@modern-js/server-core": "2.14.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/cookie": "^0.4.1",
@@ -73,10 +73,10 @@
73
73
  "node-mocks-http": "^1.11.0",
74
74
  "portfinder": "^1.0.28",
75
75
  "typescript": "^4",
76
- "@modern-js/types": "2.13.4",
77
- "@modern-js/server-core": "2.13.4",
78
- "@scripts/jest-config": "2.13.4",
79
- "@scripts/build": "2.13.4"
76
+ "@modern-js/types": "2.14.0",
77
+ "@modern-js/server-core": "2.14.0",
78
+ "@scripts/jest-config": "2.14.0",
79
+ "@scripts/build": "2.14.0"
80
80
  },
81
81
  "sideEffects": false,
82
82
  "publishConfig": {