Skip to content

Commit 6672aff

Browse files
authored
docs: add runtime api type hints tip (#3186)
1 parent 6db4c5f commit 6672aff

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

apps/website-new/docs/en/guide/basic/type-prompt.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ add `paths` to `tsconfig.json`:
2222
"paths": {
2323
"*": ["./@mf-types/*"]
2424
}
25-
}
25+
},
2626
}
2727
```
2828

@@ -40,7 +40,13 @@ After modifying the producer code, the consumer will automatically pull the prod
4040

4141
### Federation Runtime API type prompt
4242

43-
Using `Federation Runtime`'s `loadRemote` can also enjoy type hints and type hot reloading:
43+
It needs to add `./@mf-types/*` in the `include` field to enjoy `Federation Runtime` `loadRemote` type hints and type hot reloading
44+
45+
```json title="tsconfig.json"
46+
{
47+
"include": ["./@mf-types/*"]
48+
}
49+
```
4450

4551
![hot-types-reload](@public/guide/type-prompt/hot-types-reload.gif)
4652

apps/website-new/docs/zh/guide/basic/type-prompt.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@
4040

4141
### Federation Runtime API 类型提示
4242

43-
使用 `Federation Runtime` `loadRemote` 同样可以享有类型提示以及类型热重载:
43+
需要在 `include` 字段增加 `./@mf-types/*` 以享有 `Federation Runtime` `loadRemote` 类型提示以及类型热重载
44+
45+
```json title="tsconfig.json"
46+
{
47+
"include": ["./@mf-types/*"]
48+
}
49+
```
4450

4551
![hot-types-reload](@public/guide/type-prompt/hot-types-reload.gif)
4652

0 commit comments

Comments
 (0)