@modern-js/main-doc 0.0.0-next-20230228115039 → 0.0.0-next-20230228140620

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,7 +1,7 @@
1
1
  # @modern-js/main-doc
2
2
 
3
- ## 0.0.0-next-20230228115039
3
+ ## 0.0.0-next-20230228140620
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - @modern-js/builder-doc@0.0.0-next-20230228115039
7
+ - @modern-js/builder-doc@0.0.0-next-20230228140620
@@ -9,6 +9,8 @@ sidebar_label: ssr
9
9
 
10
10
  Enalbe SSR configuration.
11
11
 
12
+ ### Boolean Type
13
+
12
14
  When the value type is `boolean`, it indicates whether to enable SSR deployment mode, and `false` is not enabled by default.
13
15
 
14
16
  ```ts title="modern.config.ts"
@@ -18,3 +20,19 @@ export default defineConfig({
18
20
  },
19
21
  });
20
22
  ```
23
+
24
+ ### Object Type
25
+
26
+ When the value type is `Object`, The following properties can be configured:
27
+
28
+ - `mode`:`string = 'string'`, use `renderToString` rendering default. onfigure 'stream' to enable streaming rendering.
29
+ - `forceCSR`:`boolean = false`, forced CSR rendering is disable by default. When configured as `true`, add `?csr=true` in URL to force CSR.
30
+
31
+ ```ts title="modern.config.ts"
32
+ export default defineConfig({
33
+ server: {
34
+ forceCSR: true,
35
+ mode: 'stream',
36
+ },
37
+ });
38
+ ```
package/package.json CHANGED
@@ -11,13 +11,13 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "0.0.0-next-20230228115039",
14
+ "version": "0.0.0-next-20230228140620",
15
15
  "publishConfig": {
16
16
  "registry": "https://registry.npmjs.org/",
17
17
  "access": "public"
18
18
  },
19
19
  "peerDependencies": {
20
- "@modern-js/builder-doc": "0.0.0-next-20230228115039"
20
+ "@modern-js/builder-doc": "0.0.0-next-20230228140620"
21
21
  },
22
22
  "devDependencies": {
23
23
  "ts-node": "^10",
@@ -25,7 +25,7 @@
25
25
  "fs-extra": "^10",
26
26
  "@types/node": "^16",
27
27
  "@types/fs-extra": "^9",
28
- "@modern-js/builder-doc": "0.0.0-next-20230228115039"
28
+ "@modern-js/builder-doc": "0.0.0-next-20230228140620"
29
29
  },
30
30
  "scripts": {
31
31
  "build": "npx ts-node ./scripts/sync.ts"
@@ -4,11 +4,13 @@ sidebar_label: ssr
4
4
 
5
5
  # server.ssr
6
6
 
7
- - **类型:** `boolean`
7
+ - **类型:** `boolean` | `Object`
8
8
  - **默认值:** `false`
9
9
 
10
10
  SSR 开关以及相关设置。
11
11
 
12
+ ### Boolean 类型
13
+
12
14
  当值类型为 `boolean` 时,表示是否开启 SSR 部署模式,默认 `false` 不开启。
13
15
 
14
16
  ```ts title="modern.config.ts"
@@ -18,3 +20,19 @@ export default defineConfig({
18
20
  },
19
21
  });
20
22
  ```
23
+
24
+ ### Object 类型
25
+
26
+ 当值类型为 `Object` 时,可以配置如下属性:
27
+
28
+ - `mode`:`string = 'string'`,默认为使用 `renderToString` 渲染。配置为 'stream' 开启流式渲染。
29
+ - `forceCSR`:`boolean = false`,默认关闭强制 CSR 渲染。配置为 `true` 后,在页面访问时添加 `?csr=true` 即可强制 CSR。
30
+
31
+ ```ts title="modern.config.ts"
32
+ export default defineConfig({
33
+ server: {
34
+ forceCSR: true,
35
+ mode: 'stream',
36
+ },
37
+ });
38
+ ```