Skip to content

fix(fileSize): Avoid tiny gzip total diffs in file size reports#6720

Merged
chenjiahan merged 3 commits intoweb-infra-dev:mainfrom
zalishchuk:fix-filesize-gzip-diff
Dec 7, 2025
Merged

fix(fileSize): Avoid tiny gzip total diffs in file size reports#6720
chenjiahan merged 3 commits intoweb-infra-dev:mainfrom
zalishchuk:fix-filesize-gzip-diff

Conversation

@zalishchuk
Copy link
Contributor

Summary

The output for file size differences in gzip format included total differences even for very small changes, resulting in noisy logs for insignificant gzip shifts.

The significance check for total gzip size differences has been reused to ensure that only meaningful changes are displayed.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings December 7, 2025 02:48
@netlify
Copy link

netlify bot commented Dec 7, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit af90cd5
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6934eca1d612b30008a34522
😎 Deploy Preview https://deploy-preview-6720--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 76 (🟢 up 21 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes noisy file size reports by suppressing insignificant gzip total size differences. The change applies the existing isSignificantDiff threshold (10 bytes) to total gzip size differences, consistent with how individual file sizes and total uncompressed sizes are already handled.

Key Changes

  • Modified gzip total diff display logic to use isSignificantDiff instead of showing all non-zero changes
  • Added a test to verify that gzip total diffs below the threshold are not displayed

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/plugins/fileSize.ts Applied significance check to total gzip size differences to prevent displaying tiny changes
e2e/cases/print-file-size/diff/index.test.ts Added test case verifying that gzip total diffs below 10 bytes threshold are not displayed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

zalishchuk and others added 2 commits December 7, 2025 04:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@chenjiahan chenjiahan merged commit fb9a309 into web-infra-dev:main Dec 7, 2025
11 checks passed
@chenjiahan chenjiahan mentioned this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants