Rsdoctor v0.1 Release Note

Rsdoctor Banner

We are excited to announce the release of Rsdoctor v0.1!

Rsdoctor is a one-stop build analysis tool for Rspack and Webpack. It allows for detailed analysis of the build process and bundles, making the build process more visual and transparent.

📌 Why Rsdoctor?

When encountering build errors or needing to optimize the build process in a project, it is often difficult to capture the behavior of the build process or analyze the relationships between the generated bundles. In such cases, Rsdoctor provides a visual representation of the project's build behavior and detailed build information, allowing for a deeper analysis of project issues, such as:

  • Visualizing the upstream dependency chain of duplicate packages.
  • Analyzing the invocation process and build time of loaders, including Rspack's builtin:swc-loader.
  • Clearer view of the relationship between assets and modules in the build artifacts, as well as the bundled module code within assets.
  • Visualizing the behavior and time taken by the Resolver for module resolution.
  • ... ...

🔥 Features

  • Compilation Visualization: Rsdoctor visualizes the compilation behavior and time consumption, making it easy to view build issues.
  • Multiple Analysis Capabilities: Rsdoctor supports build artifact, build-time analysis, and anti-degradation capabilities:
    • Build artifact support for resource lists and module dependencies, etc.
    • Build-time analysis supports Loader, Plugin, and Resolver building process analysis, including: Rspack's builtin:swc-loader.
    • Build rules support duplicate package detection and ES Version Check, etc.
    • Currently, bundle Diff capabilities are also available.
  • Support Custom Rules: In addition to built-in build scan rules, Rsdoctor also supports users adding custom component scan rules based on the build data of Rsdoctor.
  • Framework-Independent: Rsdoctor support all projects built on Webpack or Rspack.

🛠️ Introduction

⭐️ Overview

  • The overview page (i.e. the home page) can know project configuration, diagnostic information, compilation information, and product status.

Overall

  • In addition to the project overview, we also provide diagnostic functions, including compilation diagnostics and duplicate packages diagnostics. If your compilation and products hit the diagnostic rules we defined, the corresponding warning alerts will appear on the tool's home page. where you can see the detailed reference path of duplicate packages:

Overall-Alerts

⭐️ Compilation Analysis

Provides corresponding data and analysis functions for Loaders, Plugins, and Module Resolve to help you analyze problems in the compilation process.

Loader Analysis

  • This module mainly provides the function of data analysis such as input and output, estimated time consumption, and parameters within Rspack or Webpack Loaders.

Plugin Analysis

  • This module mainly intercepts and collects data information such as the number of calls and estimated time consumption of Plugins.

bundle

Resolve Analysis

  • This module mainly provides path data and estimated time consumption for module resolution in a single file within the project. Rspack does not currently support this module.

bundle

⭐️ Product Analysis

  • In the Bundle Size page, we can see an overview of the product data information of the current project, as well as analyze the size and reasons for duplicate package imports.

  • In addition, we can also use the Bundle Analysis page to further analyze the relationship between the product and module in the current product, size data and other information, as well as the reasons for module introduction.

bundle

📚 Quick Start

You can refer to the Quick Start to get started with Rsdoctor.

💡 Next Steps

Improve Rsdoctor build analysis efficiency: Currently, enabling Rsdoctor plugin increases project build time. In the next step, we will extract and convert some of Rsdoctor's build analysis logic into a rust plugin, built-in to Rspack, in order to improve Rsdoctor's build analysis efficiency.

Acknowledgements

Rsdoctor has been inspired by outstanding projects in the community, and we would like to express our gratitude to them: