Skip to content

Commit c73354c

Browse files
authored
docs: update tsChecker TypeScript 7 guidance (#8760)
1 parent 70d8300 commit c73354c

2 files changed

Lines changed: 14 additions & 46 deletions

File tree

packages/document/docs/en/configure/app/tools/ts-checker.mdx

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,16 @@ export default {
8181

8282
> Please refer to [@rsbuild/plugin-type-check](https://github.com/rstackjs/rsbuild-plugin-type-check) for more details.
8383
84-
## TypeScript Go Support
84+
## TypeScript 7+ Support
8585

86-
`tools.tsChecker` supports enabling [TypeScript Go](https://github.com/microsoft/typescript-go) for type checking. This experimental capability is provided by [`ts-checker-rspack-plugin`](https://github.com/rstackjs/ts-checker-rspack-plugin), which is integrated by [`@rsbuild/plugin-type-check`](https://github.com/rstackjs/rsbuild-plugin-type-check), and can reduce type-checking time by about 5-10x.
86+
`tools.tsChecker` supports the native checker included in TypeScript 7+. This capability is provided by [`ts-checker-rspack-plugin`](https://github.com/rstackjs/ts-checker-rspack-plugin), which is integrated by [`@rsbuild/plugin-type-check`](https://github.com/rstackjs/rsbuild-plugin-type-check), and can reduce type-checking time on large projects.
8787

88-
Install TypeScript 7.0 RC to enable TypeScript Go automatically:
88+
Install TypeScript >= 7.0.0 to enable `tsgo` automatically:
8989

90-
<PackageManagerTabs command="install typescript@rc -D" />
90+
<PackageManagerTabs command="install typescript@latest -D" />
9191

92-
You can also install `@typescript/native-preview` and set `typescript.tsgo` to `true`:
92+
When `tsgo` is enabled and `typescript.typescriptPath` is set manually, it must point to an absolute TypeScript 7+ `typescript/package.json` path or the legacy `@typescript/native-preview/package.json` path.
9393

94-
<PackageManagerTabs command="install @typescript/native-preview -D" />
94+
> The `@typescript/native-preview` path is kept only for compatibility. New setups should use TypeScript 7+ from the standard `typescript` package.
9595
96-
```ts
97-
export default {
98-
tools: {
99-
tsChecker: {
100-
typescript: {
101-
tsgo: true,
102-
},
103-
},
104-
},
105-
};
106-
```
107-
108-
When `tsgo` is enabled and `typescript.typescriptPath` is set manually, it must point to an absolute `typescript/package.json` path from TypeScript 7+ or `@typescript/native-preview/package.json`.
109-
110-
> The `@typescript/native-preview` usage is deprecated and kept only for compatibility. We recommend installing `typescript@rc` to use `tsgo`.
111-
112-
For supported options and limitations, please refer to [ts-checker-rspack-plugin - TypeScript Go support](https://github.com/rstackjs/ts-checker-rspack-plugin#typescript-go-support).
96+
For supported options and limitations, please refer to [ts-checker-rspack-plugin - TypeScript 7+ support](https://github.com/rstackjs/ts-checker-rspack-plugin#typescript-7-support).

packages/document/docs/zh/configure/app/tools/ts-checker.mdx

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,16 @@ export default {
8181

8282
> 请参考 [@rsbuild/plugin-type-check](https://github.com/rstackjs/rsbuild-plugin-type-check) 了解更多用法。
8383
84-
## TypeScript Go 支持
84+
## TypeScript 7+ 支持
8585

86-
`tools.tsChecker` 支持开启 [TypeScript Go](https://github.com/microsoft/typescript-go) 进行类型检查。该能力由 [`@rsbuild/plugin-type-check`](https://github.com/rstackjs/rsbuild-plugin-type-check) 底层集成的 [`ts-checker-rspack-plugin`](https://github.com/rstackjs/ts-checker-rspack-plugin) 提供,目前仍处于实验阶段,可以将类型检查耗时减少约 5-10 倍
86+
`tools.tsChecker` 支持使用 TypeScript 7+ 的原生检查器进行类型检查。该能力由 [`@rsbuild/plugin-type-check`](https://github.com/rstackjs/rsbuild-plugin-type-check) 底层集成的 [`ts-checker-rspack-plugin`](https://github.com/rstackjs/ts-checker-rspack-plugin) 提供,可以减少大型项目的类型检查耗时
8787

88-
安装 TypeScript 7.0 RC 后,TypeScript Go 会自动开启
88+
安装 TypeScript >= 7.0.0 后会自动启用 `tsgo`
8989

90-
<PackageManagerTabs command="install typescript@rc -D" />
90+
<PackageManagerTabs command="install typescript@latest -D" />
9191

92-
你也可以安装 `@typescript/native-preview`,并将 `typescript.tsgo` 设置为 `true`
92+
开启 `tsgo` 后,如果手动设置 `typescript.typescriptPath`,它必须指向 TypeScript 7+ 的 `typescript/package.json` 或旧版 `@typescript/native-preview/package.json` 的绝对路径。
9393

94-
<PackageManagerTabs command="install @typescript/native-preview -D" />
94+
> `@typescript/native-preview` 路径仅作为兼容保留。新项目应使用标准 `typescript` 包提供的 TypeScript 7+。
9595
96-
```ts
97-
export default {
98-
tools: {
99-
tsChecker: {
100-
typescript: {
101-
tsgo: true,
102-
},
103-
},
104-
},
105-
};
106-
```
107-
108-
开启 `tsgo` 后,如果手动设置 `typescript.typescriptPath`,它必须指向 TypeScript 7+ 的 `typescript/package.json``@typescript/native-preview/package.json` 的绝对路径。
109-
110-
> `@typescript/native-preview` 的用法已废弃,仅作为兼容保留。推荐安装 `typescript@rc` 使用 `tsgo`
111-
112-
关于 `tsgo` 模式下生效的配置项和相关限制,请参考 [ts-checker-rspack-plugin - TypeScript Go support](https://github.com/rstackjs/ts-checker-rspack-plugin#typescript-go-support)
96+
关于 `tsgo` 模式下生效的配置项和相关限制,请参考 [ts-checker-rspack-plugin - TypeScript 7+ support](https://github.com/rstackjs/ts-checker-rspack-plugin#typescript-7-support)

0 commit comments

Comments
 (0)