Skip to content

Commit 958f2f9

Browse files
authored
docs: optimize routes docs (#3693)
1 parent 2c3f566 commit 958f2f9

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

packages/document/main-doc/docs/en/guides/advanced-features/bff/function.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const post = async () => {
130130
};
131131
```
132132

133-
- Modern.js supports 9 definitions for HTTP Method: `GET``POST``PUT``DELETE``CONNECT``TRACE``PATCH``OPTION``HEAD`, can be exported using these methods as functions.
133+
- Modern.js supports 9 definitions for HTTP Method: `GET``POST``PUT``DELETE``CONNECT``TRACE``PATCH``OPTIONS``HEAD`, can be exported using these methods as functions.
134134

135135
- The name is size insensitive, if `GET`, can write `get``Get``GEt``GET`, can be accurately identified. But default export as `export default xxx` will be map to `Get`.
136136

packages/document/main-doc/docs/en/guides/basic-features/data-fetch.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ export default async (): Promise<ProfileData> => {
343343

344344
### FAQ
345345

346-
1. Relationship between loader and bff functions
346+
1. Relationship between loader and BFF functions
347347

348-
In a CSR project, the loader is executed on the client side and the bff function can be called directly from the loader to make a request.
348+
In a CSR project, the loader is executed on the client side and the bff function can be called directly in the loader to make a request.
349349

350350
In an SSR project, each loader is also a server-side API, and we recommend using loader instead of the BFF function which http method is `get` to avoid one more layer of forwarding and execution.
351351

packages/document/main-doc/docs/en/guides/basic-features/routes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ To further improve the user experience and reduce time of loading, Modern.js sup
375375
- With `render`, static resources are loaded only when they are idle and do not hog the network with first-screen static resources.
376376
- When using server side rendering, data is also prefetched.
377377

378-
import Motivation from '@site-docs-en/components/convention-routing-movitation'
378+
import Motivation from '@site-docs-en/components/convention-routing-motivation'
379379

380380
<Motivation/>
381381

packages/document/main-doc/docs/zh/guides/advanced-features/bff/function.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const post = async () => {
135135
};
136136
```
137137

138-
- 对应 HTTP Method,Modern.js 也支持了 9 种定义,即:`GET``POST``PUT``DELETE``CONNECT``TRACE``PATCH``OPTION``HEAD`,即可以用这些 Method 作为函数导出的名字。
138+
- 对应 HTTP Method,Modern.js 也支持了 9 种定义,即:`GET``POST``PUT``DELETE``CONNECT``TRACE``PATCH``OPTIONS``HEAD`,即可以用这些 Method 作为函数导出的名字。
139139

140140
- 名字是大小不敏感的,如果是 `GET`,写成 `get``Get``GEt``GET`,都可以准确识别。而默认导出,即 `export default xxx` 则会被映射为 `Get`
141141

packages/document/main-doc/docs/zh/guides/basic-features/data-fetch.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ export default async (): Promise<ProfileData> => {
341341

342342
### 常见问题
343343

344-
1. loader 和 bff 函数的关系
344+
1. loader 和 BFF 函数的关系
345345

346-
在 CSR 项目中,loader 在客户端执行,在 loader 可以直接调用 bff 函数进行接口请求。
346+
在 CSR 项目中,loader 在客户端执行,在 loader 可以直接调用 BFF 函数进行接口请求。
347347

348348
在 SSR 项目中,每个 loader 也是一个服务端接口,我们推荐使用 loader 替代 http method 为 `get` 的 BFF 函数,作为接口层,避免多一层转发和执行。
349349

packages/document/main-doc/docs/zh/guides/basic-features/routes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ export const init = (context: RuntimeContext) => {
473473
- 使用 `render`,仅在空闲时对静态资源进行加载,不会与首屏静态资源抢占网络。
474474
- 在 SSR 场景下,也会对数据进行预取。
475475

476-
import Motivation from '@site-docs/components/convention-routing-movitation'
476+
import Motivation from '@site-docs/components/convention-routing-motivation'
477477

478478
<Motivation/>
479479

0 commit comments

Comments
 (0)