Skip to content

fix(rolldown): use decimal bytes for file sizes#269

Open
webfansplz wants to merge 1 commit intomainfrom
fix/filesize
Open

fix(rolldown): use decimal bytes for file sizes#269
webfansplz wants to merge 1 commit intomainfrom
fix/filesize

Conversation

@webfansplz
Copy link
Copy Markdown
Member

@webfansplz webfansplz commented Mar 27, 2026

Close #268

DevTools was using binary (1024) conversion while labeling sizes as KB/MB. By convention, kB/MB should be decimal (1000), while binary units should be labeled KiB/MiB.

This change switches DevTools to decimal-based size formatting, and also align with the rolldown_plugin_vite_reporter.

Copilot AI review requested due to automatic review settings March 27, 2026 05:00
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 27, 2026

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@269

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@269

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@269

@vitejs/devtools-rpc

npm i https://pkg.pr.new/@vitejs/devtools-rpc@269

@vitejs/devtools-self-inspect

npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@269

commit: 6772144

Copy link
Copy Markdown
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 updates DevTools file size formatting to use decimal (1000-based) conversion so the displayed units (kB/MB/GB…) match SI conventions and align with rolldown_plugin_vite_reporter.

Changes:

  • Switch bytesToHumanSize from 1024-based to 1000-based scaling and update unit label to kB.
  • Update unit tests to reflect 1000-based thresholds.
  • Adjust FileSizeBadge thresholds from 1024 to 1000.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/rolldown/src/app/utils/format.ts Converts byte formatting to decimal (1000) and updates displayed units.
packages/rolldown/src/app/utils/tests/format.test.ts Updates expectations for decimal thresholds and kB unit label.
packages/rolldown/src/app/components/display/FileSizeBadge.vue Aligns size thresholds with decimal kilobytes (1000).

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File sizes don't match the ones reported by Vite on build

2 participants