@modern-js/main-doc 0.0.0-nightly-20240103170618 → 0.0.0-nightly-20240105170635

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.
File without changes
@@ -228,9 +228,21 @@ function ErrorElement() {
228
228
  }
229
229
  ```
230
230
 
231
+ ## Waiting for all content to load for spiders
232
+
233
+ Streaming offers a better user experience because the user can see the content as it becomes available.
234
+
235
+ However, when a spider visits your page, you might want to let all of the content load first and then produce the final HTML output instead of revealing it progressively.
236
+
237
+ Modern.js uses [isbot](https://www.npmjs.com/package/isbot) to examine the user-agent of requests, determining whether they come from a crawler.
238
+
231
239
  :::info More
232
240
 
233
241
  1. [Deferred Data](https://reactrouter.com/en/main/guides/deferred)
234
242
  2. [New Suspense SSR Architecture in React 18](https://github.com/reactwg/react-18/discussions/37)
235
243
 
236
244
  :::
245
+
246
+ import StreamSSRPerformance from '@site-docs/components/stream-ssr-performance';
247
+
248
+ <StreamSSRPerformance />
@@ -184,8 +184,6 @@ Under the application root directory, create the `config/html/` directory, which
184
184
  <!DOCTYPE html>
185
185
  <html>
186
186
  <head>
187
- <%= meta %>
188
- <title><%= title %></title>
189
187
  <%= topTemplate %>
190
188
  <%= headTemplate %>
191
189
  {/* webpack inject css */}
File without changes
@@ -232,9 +232,21 @@ function ErrorElement() {
232
232
  }
233
233
  ```
234
234
 
235
+ ## 为爬虫等待所有内容加载完毕
236
+
237
+ 流式传输可以提高用户体验,因为当页面内容可用时,用户可以及时感知到它们。
238
+
239
+ 然而,当一个爬虫访问该页面时,它可能需要先加载所有内容,直接输出整个 HTML,而不是渐进式地加载它。
240
+
241
+ Modern.js 使用 [isbot](https://www.npmjs.com/package/isbot) 对请求的 `uesr-agent`, 以判断请求是否来自爬虫。
242
+
235
243
  :::info 补充信息
236
244
 
237
245
  1. [Deferred Data](https://reactrouter.com/en/main/guides/deferred)
238
246
  2. [New Suspense SSR Architecture in React 18](https://github.com/reactwg/react-18/discussions/37)
239
247
 
240
248
  :::
249
+
250
+ import StreamSSRPerformance from '@site-docs/components/stream-ssr-performance';
251
+
252
+ <StreamSSRPerformance />
@@ -187,8 +187,6 @@ Modern.js 也支持通过 HTML(EJS) 语法来生成 HTML 文件。
187
187
  <!DOCTYPE html>
188
188
  <html>
189
189
  <head>
190
- <%= meta %>
191
- <title><%= title %></title>
192
190
  <%= topTemplate %>
193
191
  <%= headTemplate %>
194
192
  {/* webpack inject css */}
@@ -40,7 +40,7 @@ export interface IPluginContext {
40
40
 
41
41
  ### 文件类型
42
42
 
43
- 生成器插件将文件类型分为撕四类:
43
+ 生成器插件将文件类型分为四类:
44
44
 
45
45
  - 文本文件
46
46
 
package/package.json CHANGED
@@ -15,17 +15,17 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-nightly-20240103170618",
18
+ "version": "0.0.0-nightly-20240105170635",
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",
21
21
  "access": "public",
22
22
  "provenance": true
23
23
  },
24
24
  "dependencies": {
25
- "@modern-js/sandpack-react": "0.0.0-nightly-20240103170618"
25
+ "@modern-js/sandpack-react": "0.0.0-nightly-20240105170635"
26
26
  },
27
27
  "peerDependencies": {
28
- "@modern-js/builder-doc": "0.0.0-nightly-20240103170618"
28
+ "@modern-js/builder-doc": "0.0.0-nightly-20240105170635"
29
29
  },
30
30
  "devDependencies": {
31
31
  "classnames": "^2",
@@ -35,12 +35,12 @@
35
35
  "ts-node": "^10.9.1",
36
36
  "typescript": "^5",
37
37
  "fs-extra": "^10",
38
- "rspress": "1.8.4",
39
- "@rspress/shared": "1.8.4",
38
+ "rspress": "1.9.3",
39
+ "@rspress/shared": "1.9.3",
40
40
  "@types/node": "^16",
41
41
  "@types/fs-extra": "9.0.13",
42
- "@modern-js/builder-doc": "0.0.0-nightly-20240103170618",
43
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-nightly-20240103170618"
42
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-nightly-20240105170635",
43
+ "@modern-js/builder-doc": "0.0.0-nightly-20240105170635"
44
44
  },
45
45
  "scripts": {
46
46
  "dev": "rspress dev",
@@ -1,9 +0,0 @@
1
- ---
2
- sidebar_label: inspector
3
- ---
4
-
5
- # tools.inspector
6
-
7
- import Main from '@modern-js/builder-doc/docs/en/config/tools/inspector.md';
8
-
9
- <Main />
@@ -1,9 +0,0 @@
1
- ---
2
- sidebar_label: inspector
3
- ---
4
-
5
- # tools.inspector
6
-
7
- import Main from '@modern-js/builder-doc/docs/zh/config/tools/inspector.md';
8
-
9
- <Main />