@modern-js/main-doc 0.0.0-next-1686710299692 → 0.0.0-next-1686751653401

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,41 +1,42 @@
1
1
  # @modern-js/main-doc
2
2
 
3
- ## 0.0.0-next-1686710299692
3
+ ## 0.0.0-next-1686751653401
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 8a932767f0: docs(main): update basic features alias doc
7
+ - 8a932767f: docs(main): update basic features alias doc
8
8
 
9
9
  docs(main): 更新基础功能 -- 别名文档
10
10
 
11
- - 7e6fb5fc16: chore: publishConfig add provenance config
11
+ - 7e6fb5fc1: chore: publishConfig add provenance config
12
12
 
13
13
  chore: publishConfig 增加 provenance 配置
14
14
 
15
- - 372b950c12: docs(main): update plugin config doc
15
+ - 372b950c1: docs(main): update plugin config doc
16
16
 
17
17
  docs(main): 更新插件配置文档
18
18
 
19
- - f28b4855c2: docs(main): update faq doc
19
+ - f28b4855c: docs(main): update faq doc
20
20
 
21
21
  docs(main): 更新 faq 文档
22
22
 
23
- - f264c4a7f8: docs(main): update html template doc
23
+ - f264c4a7f: docs(main): update html template doc
24
24
 
25
25
  docs(main): 更新 HTML 模板文档
26
26
 
27
- - 5cba7c46b7: docs(main): update bff config doc
27
+ - 5cba7c46b: docs(main): update bff config doc
28
28
 
29
29
  docs(main): 更新 BFF 配置文档
30
30
 
31
- - ef865f285b: docs(main): update config server doc
31
+ - ef865f285: docs(main): update config server doc
32
32
 
33
33
  docs(main): 更新 server 配置文档
34
34
 
35
- - 8bb0e146f2: chore: review code split docs
35
+ - 8bb0e146f: chore: review code split docs
36
36
  chore: 审查代码分割文档
37
- - Updated dependencies [7e6fb5fc16]
38
- - @modern-js/builder-doc@0.0.0-next-1686710299692
37
+ - Updated dependencies [7e6fb5fc1]
38
+ - Updated dependencies [692cc0ed2]
39
+ - @modern-js/builder-doc@0.0.0-next-1686751653401
39
40
 
40
41
  ## 2.22.1
41
42
 
@@ -3,7 +3,7 @@ title: bootstrap
3
3
  ---
4
4
  # bootstrap
5
5
 
6
- Used to start and mount App, usually without manual calls. This API is only required when using [Custom Bootstrap](/guides/concept/entries#custom-bootstrap).
6
+ Used to start and mount App, usually not manually called. This API is only required when using [Custom Bootstrap](/guides/concept/entries#custom-bootstrap).
7
7
 
8
8
  ## Usage
9
9
 
@@ -32,10 +32,10 @@ type BootStrap<T = unknown> = (
32
32
 
33
33
  ### Input
34
34
 
35
- - `AppComponent`: reactElement instance created by [`createApp`](./create-app).
36
- - `rootId`: DOM root element id to mount, like `"root"`.
37
- - `root`: ReactDOM.create the return value, which is used in the scenario where the root needs to destroy the component outside the bootstrap function.
38
- - `ReactDOM`: ReactDOM object for distinguishing between React 18 and React 17 APIs.
35
+ - `AppComponent`: The ReactElement instance created by [`createApp`](./create-app).
36
+ - `rootId`: DOM root element id to mount, such as `"root"`.
37
+ - `root`: The return value of ReactDOM.createRoot, used for scenarios where the root needs to be destroyed outside of the bootstrap function.
38
+ - `ReactDOM`: The ReactDOM object, used to differentiate between React 18 and React 17 APIs.
39
39
 
40
40
  ## Example
41
41
 
@@ -3,10 +3,10 @@ title: useLoader
3
3
  ---
4
4
  # useLoader
5
5
 
6
- Isomorphic API, usually used to make asynchronous requests. When SSR, the server level uses `useLoader` to prefetch the data, and the browser side also reuses this part of the data.
6
+ `useLoader` is an Isomorphic API, usually used to make asynchronous requests. During Server-Side Rendering (SSR), the server uses `useLoader` to prefetch the data, which is then reused on the client side.
7
7
 
8
8
  :::tip
9
- When using Rspack as the bundler, the useLoader API is not currently supported.
9
+ The `useLoader` API is currently not supported when using Rspack as the bundler.
10
10
  :::
11
11
 
12
12
  ## Usage
@@ -3,7 +3,7 @@ title: useModuleApps
3
3
  ---
4
4
  # useModuleApps
5
5
 
6
- Returns the React components of all micro-front-end sub-applications for freely controlled routing.
6
+ Returns the React components of all micro-front-end sub-applications, allowing for flexible control over routing.
7
7
 
8
8
  ## Usage
9
9
 
@@ -107,7 +107,7 @@ After starting the application in this way, accessing the `/dashboard` route wil
107
107
 
108
108
  ## Load Animation
109
109
 
110
- The transition animation of the component loading process can be customized in the following ways.
110
+ You can customize the transition animation of the component loading process as follows.
111
111
 
112
112
  ```tsx title=App.tsx
113
113
  function App() {
@@ -3,7 +3,7 @@ title: useRuntimeContext
3
3
  ---
4
4
  # useRuntimeContext
5
5
 
6
- This function is mainly used to get the runtime context and can only be used in function components.
6
+ Used to get the runtime context and can only be used in function components.
7
7
 
8
8
  ## Usage
9
9
 
@@ -41,7 +41,7 @@ function render(ui: React.ReactElement<any>, options: Options): RenderResult;
41
41
  - `options`: render options.
42
42
  - `container`: the dom which component mounted. by default create a `div` element, and auto append to `document.body`. the default value is `document.body.append(document.createElement('div'))`.
43
43
  - `baseElement`: Used to specify the `basename` used in `queries`. If `container` is specified, the default value is the value of `container`, otherwise it is `document.body`.
44
- - `hydrate`: If set to `true`, the [ReactDOM.hydrate](https://reactjs.org/docs/react-dom.html#hydrate) rendering component is used. The default value is `false`.
44
+ - `hydrate`: If set to `true`, the [ReactDOM.hydrate](https://react.dev/reference/react-dom/hydrate) rendering component is used. The default value is `false`.
45
45
  - `wrapper`: a react component that can be used to customize rendering logic.
46
46
  - `queries`: customize some own `queries`.
47
47
 
@@ -54,7 +54,7 @@ function MyComponent() {
54
54
  }
55
55
  ```
56
56
 
57
- For details, see [React lazy](https://reactjs.org/docs/code-splitting.html#reactlazy).
57
+ For details, see [React lazy](https://react.dev/reference/react/lazy).
58
58
 
59
59
  ## Loadable
60
60
 
@@ -75,7 +75,7 @@ Warning: Expected server HTML to contain a matching <div> in <div>.
75
75
  This is caused by the inconsistency between the rendering result and the SSR rendering result when React executes the hydrate logic on the client side. Although the page performs normally, in complex applications, it is likely to cause problems such as DOM hierarchy confusion and style confusion.
76
76
 
77
77
  :::info
78
- For hydrate logic, please refer to [here](https://reactjs.org/docs/react-dom.html#hydrate).
78
+ For hydrate logic, please refer to [here](https://react.dev/reference/react-dom/hydrate).
79
79
 
80
80
  :::
81
81
 
@@ -455,7 +455,7 @@ export default Page;
455
455
  ```
456
456
 
457
457
  `Await` needs to be wrapped inside the `Suspense` component. The `resolve` of `Await` passes in the data acquired asynchronously by the Data Loader. When the data acquisition is completed,
458
- the obtained data is rendered through the [Render Props](https://reactjs.org/docs/render-props.html) mode. When the data acquisition is in pending status, the
458
+ the obtained data is rendered through the [Render Props](https://react.dev/reference/react/cloneElement#passing-data-with-a-render-prop) mode. When the data acquisition is in pending status, the
459
459
  content set by the `fallback` property of the `Suspense` component will display.
460
460
 
461
461
 
@@ -41,7 +41,7 @@ function render(ui: React.ReactElement<any>, options: Options): RenderResult;
41
41
  - `options`:render 可选配置。
42
42
  - `container`:表示组件所要挂载到的 DOM 节点,默认是会创建一个 `div` 元素,并自动添加到 `document.body` 上。这个 `div` 元素就是组件要挂载的节点。默认值是 `document.body.append(document.createElement('div'))`。
43
43
  - `baseElement`:用于指定 `queries` 中使用到的 `basename`。如果指定了 `container`, 则默认值为 `container` 的值,否则就是 `document.body`。
44
- - `hydrate`:如果设置为 `true`,则会使用 [ReactDOM.hydrate](https://reactjs.org/docs/react-dom.html#hydrate) 渲染组件。默认值为 `false`。
44
+ - `hydrate`:如果设置为 `true`,则会使用 [ReactDOM.hydrate](https://zh-hans.react.dev/reference/react-dom/hydrate) 渲染组件。默认值为 `false`。
45
45
  - `wrapper`:是一个 react 组件,可用于自定义渲染逻辑。
46
46
  - `queries`:自定义一些自己的 `queries`。
47
47
 
@@ -54,7 +54,7 @@ function MyComponent() {
54
54
  }
55
55
  ```
56
56
 
57
- `React.lazy` 更多用法请见 [React 官网文档](https://zh-hans.reactjs.org/docs/code-splitting.html#reactlazy)。
57
+ `React.lazy` 更多用法请见 [React 官网文档](https://zh-hans.react.dev/reference/react/lazy)。
58
58
 
59
59
  ## Loadable
60
60
 
@@ -74,7 +74,7 @@ Warning: Expected server HTML to contain a matching <div> in <div>.
74
74
  这是 React 在客户端执行 hydrate 逻辑时,发现渲染结果与 SSR 渲染结果不一致造成的。虽然页面表现正常,但在复杂应用中,很有可能因此出现 DOM 层级混乱、样式混乱等问题。
75
75
 
76
76
  :::info
77
- 关于 hydrate (注水)逻辑请参考[这里](https://reactjs.org/docs/react-dom.html#hydrate)。
77
+ 关于 hydrate (注水)逻辑请参考[这里](https://zh-hans.react.dev/reference/react-dom/hydrate)。
78
78
 
79
79
  :::
80
80
 
@@ -447,7 +447,7 @@ export default Page;
447
447
  ```
448
448
 
449
449
  `Await` 需要包裹在 `Suspense` 组件内部,`Await` 的 `resolve` 传入的是 Data Loader 异步获取的数据,当数据获取完成后,
450
- 通过 [Render Props](https://reactjs.org/docs/render-props.html) 模式,渲染获取到的数据。在数据的获取阶段,将展示
450
+ 通过 [Render Props](https://zh-hans.react.dev/reference/react/cloneElement#passing-data-with-a-render-prop) 模式,渲染获取到的数据。在数据的获取阶段,将展示
451
451
  `Suspense` 组件 `fallback` 属性设置的内容。
452
452
 
453
453
  :::warning 注意
package/package.json CHANGED
@@ -15,14 +15,14 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-1686710299692",
18
+ "version": "0.0.0-next-1686751653401",
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",
21
21
  "access": "public",
22
22
  "provenance": true
23
23
  },
24
24
  "peerDependencies": {
25
- "@modern-js/builder-doc": "0.0.0-next-1686710299692"
25
+ "@modern-js/builder-doc": "0.0.0-next-1686751653401"
26
26
  },
27
27
  "devDependencies": {
28
28
  "classnames": "^2",
@@ -34,9 +34,9 @@
34
34
  "fs-extra": "^10",
35
35
  "@types/node": "^16",
36
36
  "@types/fs-extra": "^9",
37
- "@modern-js/builder-doc": "0.0.0-next-1686710299692",
38
- "@modern-js/doc-tools": "0.0.0-next-1686710299692",
39
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1686710299692"
37
+ "@modern-js/builder-doc": "0.0.0-next-1686751653401",
38
+ "@modern-js/doc-tools": "0.0.0-next-1686751653401",
39
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1686751653401"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "modern dev",