@modern-js/main-doc 0.0.0-nightly-20240827170702 → 0.0.0-nightly-20240828170710

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.
@@ -380,7 +380,7 @@ export default () => {
380
380
 
381
381
  In each directory under `routes/`, developers can also define an `error.tsx` file that exports an `<ErrorBoundary>` component by default.
382
382
 
383
- When this component exists in the routes directory, any rendering errors will be caught by the `ErrorBoundary` component. When the `layout.tsx` file is not defined in the directory, the `<ErrorBoundary>` component will not take effect.
383
+ When this component exists in the routes directory, any rendering errors will be caught by the `ErrorBoundary` component.
384
384
 
385
385
  `<ErrorBoundary>` can return the UI view when an error occurs. When the `<ErrorBoundary>` component is not declared in the current level, the error will bubble up to a higher-level component until it is caught or thrown. At the same time, when a component has an error, it will only affect the route component and its child components that catch the error. The status and view of other components are not affected and can continue to interact.
386
386
 
@@ -67,9 +67,9 @@ export const loader = async (): Promise<ProfileData> => {
67
67
 
68
68
  :::
69
69
 
70
- 在 CSR 环境下,`loader` 函数会在客户端执行,`loader` 函数内可以使用浏览器的 API(但通常不需要,也不推荐)。
70
+ 在 CSR 项目中,`loader` 函数会在客户端执行,`loader` 函数内可以使用浏览器的 API(但通常不需要,也不推荐)。
71
71
 
72
- 在 SSR 环境下,不管是首屏,还是在客户端的导航,`loader` 函数只会在服务端执行,这里可以调用任意的 Node.js API,同时这里使用的任何依赖和代码都不会包含在客户端的 bundle 中。
72
+ 在 SSR 项目中,不管是首屏,还是在客户端的导航,`loader` 函数只会在服务端执行,这里可以调用任意的 Node.js API,同时这里使用的任何依赖和代码都不会包含在客户端的 bundle 中。
73
73
 
74
74
  :::info
75
75
  在以后的版本中,Modern.js 可能会支持在 CSR 环境下,`loader` 函数也在服务端运行,以提高性能和安全性,所以这里建议尽可能地保证 `loader` 的纯粹,只做数据获取的场景。
@@ -381,7 +381,7 @@ export default () => {
381
381
 
382
382
  `routes/` 下每一层目录中,开发者同样可以定义一个 `error.tsx` 文件,默认导出一个 `<ErrorBoundary>` 组件。
383
383
 
384
- 当有路由目录下存在该组件时,组件渲染出错会被 `ErrorBoundary` 组件捕获。当目录未定义 `layout.tsx` 文件时,`<ErrorBoundary>` 组件不会生效。
384
+ 当有路由目录下存在该组件时,组件渲染出错会被 `ErrorBoundary` 组件捕获。
385
385
 
386
386
  `<ErrorBoundary>` 可以返回出错时的 UI 视图,当前层级未声明 `<ErrorBoundary>` 组件时,错误会向上冒泡到更上层的组件,直到被捕获或抛出错误。同时,当组件出错时,只会影响捕获到该错误的路由组件及子组件,其他组件的状态和视图不受影响,可以继续交互。
387
387
 
package/package.json CHANGED
@@ -15,17 +15,17 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-nightly-20240827170702",
18
+ "version": "0.0.0-nightly-20240828170710",
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-20240827170702"
25
+ "@modern-js/sandpack-react": "0.0.0-nightly-20240828170710"
26
26
  },
27
27
  "peerDependencies": {
28
- "@modern-js/builder-doc": "0.0.0-nightly-20240827170702"
28
+ "@modern-js/builder-doc": "0.0.0-nightly-20240828170710"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@rspress/shared": "1.27.0",
@@ -39,7 +39,7 @@
39
39
  "rspress": "1.27.0",
40
40
  "ts-node": "^10.9.1",
41
41
  "typescript": "^5",
42
- "@modern-js/builder-doc": "0.0.0-nightly-20240827170702"
42
+ "@modern-js/builder-doc": "0.0.0-nightly-20240828170710"
43
43
  },
44
44
  "scripts": {
45
45
  "dev": "rspress dev",