@bleedingdev/modern-js-main-doc 3.2.0-ultramodern.119 → 3.2.0-ultramodern.120

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.
@@ -2,6 +2,8 @@
2
2
  title: tsChecker
3
3
  ---
4
4
 
5
+ import { PackageManagerTabs } from '@theme';
6
+
5
7
  # tools.tsChecker
6
8
 
7
9
  - **Type:** `Object | Function`
@@ -14,6 +16,8 @@ const defaultOptions = {
14
16
  memoryLimit: 8192,
15
17
  // use tsconfig of user project
16
18
  configFile: tsconfigPath,
19
+ // use TypeScript Go checker by default
20
+ tsgo: true,
17
21
  // use TS-Go native preview of user project
18
22
  typescriptPath: require.resolve('@typescript/native-preview/package.json'),
19
23
  },
@@ -35,7 +39,7 @@ const defaultOptions = {
35
39
  },
36
40
  ```
37
41
 
38
- By default, Modern.js type checking is aligned with the TS-Go native preview used by this fork. You can use `output.disableTsChecker` config to disable build-time checking.
42
+ By default, the [@rsbuild/plugin-type-check](https://github.com/rstackjs/rsbuild-plugin-type-check) is enabled for type checking. You can use `output.disableTsChecker` config to disable it.
39
43
 
40
44
  ## Example
41
45
 
@@ -53,4 +57,28 @@ export default {
53
57
  };
54
58
  ```
55
59
 
56
- > This fork keeps the TypeScript toolchain on `@typescript/native-preview` / `tsgo`; do not install the classic `typescript` compiler for application type checking.
60
+ ## TypeScript Go by Default
61
+
62
+ Type checking runs on [TypeScript Go](https://github.com/microsoft/typescript-go) (`tsgo`) by default in this fork. The 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 reduces type-checking time by about 5-10x.
63
+
64
+ `@typescript/native-preview` ships with the builder, so no extra install is needed. To pin your own version, install it in your project:
65
+
66
+ <PackageManagerTabs command="install @typescript/native-preview -D" />
67
+
68
+ When `tsgo` is enabled, the default `typescript.typescriptPath` resolves to `@typescript/native-preview/package.json`. If you manually set `typescript.typescriptPath`, it must be an absolute path to `@typescript/native-preview/package.json`.
69
+
70
+ To fall back to the classic TypeScript checker, set `typescript.tsgo` to `false` and make sure `typescript` is installed in your project:
71
+
72
+ ```ts
73
+ export default {
74
+ tools: {
75
+ tsChecker: {
76
+ typescript: {
77
+ tsgo: false,
78
+ },
79
+ },
80
+ },
81
+ };
82
+ ```
83
+
84
+ 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).
@@ -2,6 +2,8 @@
2
2
  title: tsChecker
3
3
  ---
4
4
 
5
+ import { PackageManagerTabs } from '@theme';
6
+
5
7
  # tools.tsChecker
6
8
 
7
9
  - **类型:** `Object | Function`
@@ -14,6 +16,8 @@ const defaultOptions = {
14
16
  memoryLimit: 8192,
15
17
  // use tsconfig of user project
16
18
  configFile: tsconfigPath,
19
+ // use TypeScript Go checker by default
20
+ tsgo: true,
17
21
  // use TS-Go native preview of user project
18
22
  typescriptPath: require.resolve('@typescript/native-preview/package.json'),
19
23
  },
@@ -35,7 +39,7 @@ const defaultOptions = {
35
39
  },
36
40
  ```
37
41
 
38
- 默认情况下,Modern.js 会开启 [@rsbuild/plugin-type-check](https://github.com/rspack-contrib/rsbuild-plugin-type-check) 进行类型检查。你可以通过 `output.disableTsChecker` 配置项来关闭类型检查。
42
+ 默认情况下,Modern.js 会开启 [@rsbuild/plugin-type-check](https://github.com/rstackjs/rsbuild-plugin-type-check) 进行类型检查。你可以通过 `output.disableTsChecker` 配置项来关闭类型检查。
39
43
 
40
44
  ## 示例
41
45
 
@@ -53,4 +57,28 @@ export default {
53
57
  };
54
58
  ```
55
59
 
56
- > 请参考 [@rsbuild/plugin-type-check](https://github.com/rspack-contrib/rsbuild-plugin-type-check) 了解更多用法。
60
+ ## TypeScript Go 默认开启
61
+
62
+ 类型检查默认使用 [TypeScript Go](https://github.com/microsoft/typescript-go)(`tsgo`)。该能力由 [`@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 倍。
63
+
64
+ `@typescript/native-preview` 已随构建器内置,无需额外安装。如需固定版本,可在项目中自行安装:
65
+
66
+ <PackageManagerTabs command="install @typescript/native-preview -D" />
67
+
68
+ 开启 `tsgo` 后,默认的 `typescript.typescriptPath` 会解析到 `@typescript/native-preview/package.json`。如果你手动设置了 `typescript.typescriptPath`,它必须是指向 `@typescript/native-preview/package.json` 的绝对路径。
69
+
70
+ 如需回退到经典 TypeScript 检查器,请将 `typescript.tsgo` 设置为 `false`,并确保项目中安装了 `typescript`:
71
+
72
+ ```ts
73
+ export default {
74
+ tools: {
75
+ tsChecker: {
76
+ typescript: {
77
+ tsgo: false,
78
+ },
79
+ },
80
+ },
81
+ };
82
+ ```
83
+
84
+ 关于 `tsgo` 模式下生效的配置项和相关限制,请参考 [ts-checker-rspack-plugin - TypeScript Go support](https://github.com/rstackjs/ts-checker-rspack-plugin#typescript-go-support)。
package/package.json CHANGED
@@ -18,24 +18,24 @@
18
18
  "modern",
19
19
  "modern.js"
20
20
  ],
21
- "version": "3.2.0-ultramodern.119",
21
+ "version": "3.2.0-ultramodern.120",
22
22
  "publishConfig": {
23
23
  "registry": "https://registry.npmjs.org/",
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
27
  "mermaid": "^11.15.0",
28
- "@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.2.0-ultramodern.119"
28
+ "@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.2.0-ultramodern.120"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@rsbuild/plugin-sass": "1.5.3",
32
- "@rspress/core": "2.0.13",
33
- "@rspress/plugin-llms": "2.0.13",
34
- "@rspress/shared": "2.0.13",
35
- "@shikijs/transformers": "^4.1.0",
32
+ "@rspress/core": "2.0.14",
33
+ "@rspress/plugin-llms": "2.0.14",
34
+ "@rspress/shared": "2.0.14",
35
+ "@shikijs/transformers": "^4.2.0",
36
36
  "@types/fs-extra": "11.0.4",
37
- "@types/node": "^25.9.1",
38
- "@typescript/native-preview": "7.0.0-dev.20260606.1",
37
+ "@types/node": "^25.9.3",
38
+ "@typescript/native-preview": "7.0.0-dev.20260610.1",
39
39
  "classnames": "^2.5.1",
40
40
  "clsx": "^2.1.1",
41
41
  "fs-extra": "^11.3.5",