Skip to content

Commit

Permalink
feat: bff doc add shared source (#6575)
Browse files Browse the repository at this point in the history
  • Loading branch information
keepview authored Nov 28, 2024
1 parent b6e1be7 commit 2ef496c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/fast-frogs-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/main-doc': patch
---

feat: bff doc add shared source

feat: bff 文档增加共享源码
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,8 @@ export default () => {

import ExtendBFF from "@site-docs-en/components/extend-bff-function"

<ExtendBFF/>
<ExtendBFF/>

## Code Sharing

Besides the BFF functions in the `api/` directory, which can be referenced in the `src/` directory through an integrated calling method, the `src/` and `api/` directories cannot directly reference each other's code by default. To achieve code sharing, a [`shared`](/en/apis/app/hooks/shared.html) directory can be created at the root of the project for both `src/` and `api/` to use commonly.
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,8 @@ export default () => {

import ExtendBFF from "@site-docs/components/extend-bff-function"

<ExtendBFF/>
<ExtendBFF/>

## 代码共享

`api/` 目录下的 BFF 函数可在 `src/` 中通过一体化调用方式引用,项目中 `src/``api/` 目录默认不能直接引用对方代码。为实现代码共享,可在项目根目录创建 [`shared`](/apis/app/hooks/shared.html) 目录,供 `src/``api/` 共同引用。

0 comments on commit 2ef496c

Please sign in to comment.