@rsdoctor/docs 1.2.2 → 1.2.4-beta.0

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.
@@ -46,7 +46,7 @@ Based on the above situation, we decided to develop a build analyzer focused on
46
46
 
47
47
  We designed an intuitive user interface for Rsdoctor, and Rsdoctor extends the **loader profiling capability** by combining the advantages of multiple tools to more deeply analyze the loader behavior in the compilation phase, **built-in the scanning and detection rules for artifacts and compilation**, and supports user **custom rules**.
48
48
 
49
- Rsdoctor not only supports Rspack and webpack, but also supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/rspack-contrib/storybook-rsbuild), [Next.js](https://nextjs.org/), [Nuxt](https://nuxt.com/), [Re.Pack](https://re-pack.dev/), [Modern.js](https://modernjs.dev/), [Rsbuild](https://rsbuild.rs/), [Rspress](https://rspress.rs/) and [Rslib](https://lib.rsbuild.rs/).
49
+ Rsdoctor not only supports Rspack and webpack, but also supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/rspack-contrib/storybook-rsbuild), [Next.js](https://nextjs.org/), [Nuxt](https://nuxt.com/), [Re.Pack](https://re-pack.dev/), [Modern.js](https://modernjs.dev/), [Rsbuild](https://rsbuild.rs/), [Rspress](https://rspress.rs/) and [Rslib](https://rslib.rs/).
50
50
 
51
51
  Rsdoctor can be used to:
52
52
 
@@ -148,7 +148,7 @@ new RsdoctorRspackPlugin({
148
148
 
149
149
  ### 🛠️ New scanning rules
150
150
 
151
- - [Duplicate packages detecting](/guide/rules/rules#e1002-cross-chunks-package): Added a rule for detecting duplicate packages across chunks, which can scan for duplicate packages in different `chunks`. These duplicate packages may cause redundant code in the build.
151
+ - [Duplicate package detection](/guide/rules/rules#e1002-cross-chunks-package): Added a rule for detecting duplicate packages across chunks, which can scan for duplicate packages in different `chunks`. These duplicate packages may cause redundant code in the build.
152
152
  - [ECMA version checking](/guide/rules/rules#e1004-ecma-version-check): Enhanced the ECMA version detection rule, used to detect incompatible advanced syntax.
153
153
 
154
154
  ```ts
@@ -4,7 +4,7 @@
4
4
 
5
5
  ### manifest.json
6
6
 
7
- When your project integrates with plugins provided by **Rsdoctor** (such as `@rsdoctor/webpack-plugin`, etc.), Rsdoctor will write **build-related data information** into a local JSON file:
7
+ When your project integrates with plugins provided by **Rsdoctor** (such as `@rsdoctor/webpack-plugin`, etc.), Rsdoctor will write **build-related data** into a local JSON file:
8
8
 
9
9
  - The **filename is `manifest.json`**
10
10
  - The output path of this file is `output directory of the project/.rsdoctor/manifest.json`
@@ -12,9 +12,9 @@ new RsdoctorRspackPlugin({
12
12
  });
13
13
  ```
14
14
 
15
- ## Loader time-consuming data is inaccurate?
15
+ ## Loader timing data is inaccurate?
16
16
 
17
- The time-consuming data provided by Rsdoctor for loaders is an **estimated time**. Why can't it accurately measure the timing? It's because we know that loader execution can be both **asynchronous** and **synchronous**.
17
+ The timing data provided by Rsdoctor for loaders is an **estimated time**. Why can't it accurately measure the timing? It's because we know that loader execution can be both **asynchronous** and **synchronous**.
18
18
  Additionally, the bundler will **parallelize the execution** of multiple non-conflicting loader functions. Since JavaScript is single-threaded, multiple loader functions can **compete for the current task queue**.
19
19
  Furthermore, the asynchronous logic within loader functions cannot be recognized, causing a single loader function to potentially span across the execution of multiple other loaders. As a result, there are three possible cases, as shown in the following diagram:
20
20
 
@@ -96,19 +96,19 @@ export default {
96
96
  - In the rspeedy project, configure it in `rspeedy.config.ts`:
97
97
 
98
98
  ```js rspeedy.config.ts
99
- export default {
100
- tools: {
101
- rspack(config, { env }) {
102
- if (process.env.RSDOCTOR === 'true') {
103
- config.optimization = {
104
- ...config.optimization,
105
- concatenateModules: false,
106
- },
107
- return config
108
- }
109
- },
99
+ export default {
100
+ tools: {
101
+ rspack(config, { env }) {
102
+ if (process.env.RSDOCTOR === 'true') {
103
+ config.optimization = {
104
+ ...config.optimization,
105
+ concatenateModules: false,
106
+ };
107
+ return config;
108
+ }
110
109
  },
111
- };
110
+ },
111
+ };
112
112
  ```
113
113
 
114
114
  ## The loader of CssExtractRspackPlugin takes too long
@@ -4,7 +4,7 @@ Rsdoctor is a build analyzer tailored for the [Rspack](https://rspack.rs/) ecosy
4
4
 
5
5
  Rsdoctor is committed to being a one-stop, intelligent build analyzer that makes the build process transparent, predictable, and optimizable through visualization and smart analysis, helping development teams precisely identify bottlenecks, optimize performance, and improve engineering quality.
6
6
 
7
- Rsdoctor supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/rspack-contrib/storybook-rsbuild), [Next.js](https://nextjs.org/), [Nuxt](https://nuxt.com/), [Re.Pack](https://re-pack.dev/), [Modern.js](https://modernjs.dev/), [Rsbuild](https://rsbuild.rs/), [Rspress](https://rspress.rs/) and [Rslib](https://lib.rsbuild.rs/).
7
+ Rsdoctor supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/rspack-contrib/storybook-rsbuild), [Next.js](https://nextjs.org/), [Nuxt](https://nuxt.com/), [Re.Pack](https://re-pack.dev/), [Modern.js](https://modernjs.dev/), [Rsbuild](https://rsbuild.rs/), [Rspress](https://rspress.rs/) and [Rslib](https://rslib.rs/).
8
8
 
9
9
  <video
10
10
  src="https://assets.rspack.rs/others/assets/rsdoctor/rsdoctor-1.0-ui.mp4"
@@ -8,7 +8,7 @@ import { PackageManagerTabs } from '@theme';
8
8
 
9
9
  ### Rspack projects
10
10
 
11
- For projects based on Rspack or Rsbuild, install the following dependencies:
11
+ For projects based on Rspack, such as Rsbuild or Rslib, install the following dependencies:
12
12
 
13
13
  <PackageManagerTabs command="add @rsdoctor/rspack-plugin -D" />
14
14
 
@@ -5,7 +5,7 @@
5
5
  **Rsdoctor** provides the `Bundle Size` module, which is mainly used to analyze the information of the build artifacts of **Webpack** or **Rspack**, including the **size of resources**, **duplicate packages**, and **module reference relationships**:
6
6
 
7
7
  - **Bundle Overview**: Displays the total number and size of artifacts, as well as the number and size of each file type. It also shows the duplicate packages and their reference chains.
8
- - **Bundle Analysis Module**: Analyzes the size and code information of the build artifacts' resources (**Assets**) and the included **Modules**. In this module, you can view the **actual code size of modules after packaging** in the Assets, as well as the original code or **packaged code segments** and **module reference relationships**.
8
+ - **Bundle Analysis Module**: Analyzes the size and code information of the build artifacts (**Assets**) and the included **Modules**. In this module, you can view the **actual code size of modules after packaging** in the Assets, as well as the original code or **packaged code segments** and **module reference relationships**.
9
9
 
10
10
  <img
11
11
  src="https://assets.rspack.rs/others/assets/rsdoctor/bundle-size-overall.png"
@@ -46,7 +46,7 @@ Rsdoctor 致力于成为一站式、智能化的构建分析工具,通过可
46
46
 
47
47
  我们为 Rsdoctor 设计了直观的用户界面,将构建数据可视化。同时,Rsdoctor 在结合多种工具的基础上,额外扩展了 loader 分析能力以更深入 loader 的编译行为,内置了产物及编译的扫描和检测规则,并支持用户自定义规则。
48
48
 
49
- Rsdoctor 不仅支持 Rspack 和 webpack,也支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/rspack-contrib/storybook-rsbuild)、[Next.js](https://nextjs.org/)、[Nuxt](https://nuxt.com/)、[Re.Pack](https://re-pack.dev/)、[Modern.js](https://modernjs.dev/)、[Rsbuild](https://rsbuild.rs/)、[Rspress](https://rspress.rs/) 和 [Rslib](https://lib.rsbuild.rs/) 等。
49
+ Rsdoctor 不仅支持 Rspack 和 webpack,也支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/rspack-contrib/storybook-rsbuild)、[Next.js](https://nextjs.org/)、[Nuxt](https://nuxt.com/)、[Re.Pack](https://re-pack.dev/)、[Modern.js](https://modernjs.dev/)、[Rsbuild](https://rsbuild.rs/)、[Rspress](https://rspress.rs/) 和 [Rslib](https://rslib.rs/) 等。
50
50
 
51
51
  Rsdoctor 可以被用于:
52
52
 
@@ -94,19 +94,19 @@ export default {
94
94
  - rspeedy 项目中,在 `rspeedy.config.ts` 中配置:
95
95
 
96
96
  ```js rspeedy.config.ts
97
- export default {
98
- tools: {
99
- rspack(config, { env }) {
100
- if (process.env.RSDOCTOR === 'true') {
101
- config.optimization = {
102
- ...config.optimization,
103
- concatenateModules: false,
104
- },
105
- return config
106
- }
107
- },
97
+ export default {
98
+ tools: {
99
+ rspack(config, { env }) {
100
+ if (process.env.RSDOCTOR === 'true') {
101
+ config.optimization = {
102
+ ...config.optimization,
103
+ concatenateModules: false,
104
+ };
105
+ return config;
106
+ }
108
107
  },
109
- };
108
+ },
109
+ };
110
110
  ```
111
111
 
112
112
  ## CssExtractRspackPlugin 的 loader 耗时过长问题
@@ -4,7 +4,7 @@ Rsdoctor 是一款为 [Rspack](https://rspack.rs/) 生态量身打造的构建
4
4
 
5
5
  Rsdoctor 致力于成为一站式、智能化的构建分析工具,通过可视化与智能分析,使整个构建流程变得透明、可预测和可优化,从而帮助开发团队精准定位瓶颈、优化性能并提升工程质量。
6
6
 
7
- Rsdoctor 支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/rspack-contrib/storybook-rsbuild)、[Next.js](https://nextjs.org/)、[Nuxt](https://nuxt.com/)、[Re.Pack](https://re-pack.dev/)、[Modern.js](https://modernjs.dev/)、[Rsbuild](https://rsbuild.rs/)、[Rspress](https://rspress.rs/) 和 [Rslib](https://lib.rsbuild.rs/) 等。
7
+ Rsdoctor 支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/rspack-contrib/storybook-rsbuild)、[Next.js](https://nextjs.org/)、[Nuxt](https://nuxt.com/)、[Re.Pack](https://re-pack.dev/)、[Modern.js](https://modernjs.dev/)、[Rsbuild](https://rsbuild.rs/)、[Rspress](https://rspress.rs/) 和 [Rslib](https://rslib.rs/) 等。
8
8
 
9
9
  <video
10
10
  src="https://assets.rspack.rs/others/assets/rsdoctor/rsdoctor-1.0-ui.mp4"
@@ -8,7 +8,7 @@ import { PackageManagerTabs } from '@theme';
8
8
 
9
9
  ### Rspack 项目
10
10
 
11
- 基于 Rspack Rsbuild 的项目,安装以下依赖:
11
+ 基于 Rspack 的项目(比如 Rsbuild 或 Rslib),安装以下依赖:
12
12
 
13
13
  <PackageManagerTabs command="add @rsdoctor/rspack-plugin -D" />
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/docs",
3
- "version": "1.2.2",
3
+ "version": "1.2.4-beta.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -30,11 +30,12 @@
30
30
  "rsbuild-plugin-open-graph": "^1.0.2",
31
31
  "rspress-plugin-font-open-sans": "^1.0.0",
32
32
  "rspress-plugin-sitemap": "^1.1.4",
33
- "typescript": "^5.2.2",
34
- "@rsdoctor/types": "1.2.2"
33
+ "typescript": "^5.9.2",
34
+ "@rsbuild/plugin-sass": "^1.3.3",
35
+ "@rsdoctor/types": "1.2.4-beta.0"
35
36
  },
36
37
  "dependencies": {
37
- "@rstack-dev/doc-ui": "1.10.8",
38
+ "@rstack-dev/doc-ui": "1.11.0",
38
39
  "react-markdown": "^9.1.0",
39
40
  "rspress": "2.0.0-beta.6"
40
41
  },