We provide the Bundle Diff feature, which allows you to compare and analyze the changes between two build bundles.
Currently, we offer the following usage methods:
First, you need to prepare 2 copies of the manifest.json produced by Rsdoctor. Then, install @rsdoctor/cli and use the CLI command bundle-diff
. For detailed command usage, see command usage tutorial.
We plan to provide an online page for Bundle Diff analysis. You can upload 2 copies of the manifest.json produced by Rsdoctor on the page, one as the Baseline and the other as the Current. By clicking Start Diff, you can enter our analysis page.
In the Bundle Diff module, you can see the comparison of information between the two build bundles, including:
In addition to the above data overview, we can also perform more in-depth data query and analysis through the details list module at the bottom of the page.
Term | Description |
---|---|
Baseline | Represents the reference data source |
Current | Represents the target data source to be compared with the Baseline |
Asset / Assets | Represents the build files |
Bundle Size | Represents the total size of all files in the build |
Total JS | Represents the total size of all .js files in the build |
Initial JS | Represents the total size of all first screen .js files in the build |
Total CSS | Represents the total size of all .css files in the build |
Initial CSS | Represents the total size of all first screen .css files in the build |
Image | Represents the total size of all .png /.jpg /.svg /.webp /.jpeg /.gif /.bmp files in the build |
Font | Represents the total size of all .ttf /.fnt /.fon /.otf files in the build |
Media | Represents the total size of all .mp3 /.mp4 /.avi /.wav /.flv /.mov /.mpg /.mpeg files in the build |
HTML | Represents the total size of all .html files in the build |
Duplicate Packages | Represents the total number of duplicate packages in the build |
Modules | Represents the total number of modules in the build |
Packages | Represents the total number of NPM Packages in the build |
New | Represents newly added items, i.e., not present in Baseline but present in Current |
Deleted | Represents removed items, i.e., present in Baseline but not in Current |
Changed | Represents items that only changed in content, i.e., present in both Baseline and Current but with content changes |
Parsed Size | Represents the final size of the build bundles |
At the top of the page, we can see many data points composed of different cards, including the following information:
In the Overview module, we can see the size, quantity, and change rate of different file types.
When displaying Asset names, Rsdoctor tries to remove the hash values from the build file names to facilitate comparison.
In the Assets module, we can see the size and change rate of the build files.
By clicking the "+" button in front of the list items, you can expand to see the list of modules contained in the corresponding Asset (i.e., Modules of "xxx"
), which shows the size and change rate of the modules.
Rsdoctor is compatible with the situation where Assets files have the same name but different hashes. However, for Assets with different names generated by splitting packages, Rsdoctor cannot identify their comparison objects.
Therefore, the Rsdoctor Assets module also provides a select component, allowing you to manually select the Assets resources you want to compare.
In the Modules module, we can see the name, size, and change rate of all modules contained in the two builds.
The New
/ Deleted
/ Changed
tags indicate whether the module is newly added, deleted, or just changed in the Current
build.
The node_modules
tag indicates that the module's path contains /node_modules/
.
On the right side of the list items, you can view the module code changes by clicking the corresponding "View Changes" button.
Code comparison includes several types of data:
Normal
mode, not available in Lite
mode, and not available in Brief
mode.Normal
mode, available in Lite
mode, and not available in Brief
mode.In the Packages module, we can see the list of all NPM Packages contained in the two builds. Each list item includes the Package Name, Version, and Parsed Size (final size after packaging).