Skip to content

chore(deps): Replace filesize with DIY function - #2589

Merged
aklinker1 merged 1 commit into
mainfrom
replace-filesize
Aug 8, 2026
Merged

aklinker1 merged 1 commit into
mainfrom
replace-filesize

Conversation

@aklinker1

@aklinker1 aklinker1 commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

Overview

58 kB → 178 B

Manual Testing

Related Issue

Apart of #2523

@netlify

netlify Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 30e0242
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6a7765cec6a0250008508547
😎 Deploy Preview https://deploy-preview-2589--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@github-actions github-actions Bot added the pkg/wxt Includes changes to the `packages/wxt` directory label Aug 8, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@2589

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@2589

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@2589

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@2589

@wxt-dev/is-background

npm i https://pkg.pr.new/@wxt-dev/is-background@2589

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@2589

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@2589

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@2589

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@2589

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@2589

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@2589

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@2589

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@2589

wxt

npm i https://pkg.pr.new/wxt@2589

commit: 30e0242

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.52%. Comparing base (55b79e8) to head (30e0242).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2589      +/-   ##
==========================================
+ Coverage   79.42%   79.52%   +0.09%     
==========================================
  Files         134      134              
  Lines        4000     4004       +4     
  Branches      927      929       +2     
==========================================
+ Hits         3177     3184       +7     
+ Misses        730      727       -3     
  Partials       93       93              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aklinker1
aklinker1 marked this pull request as ready for review August 8, 2026 17:25

export function getBytesDisplay(bytes: number): string {
if (bytes < 1000) return `${bytes} B`;
if (bytes < 999995) return `${(bytes / 1e3).toFixed(2)} kB`;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Using standard scientific notation for file size, not the base 2 one. So 1 kilobytes (kB) = 1000 bytes, not 1 kibibyte (KiB) = 1024 bytes.

https://en.wikipedia.org/wiki/Kilobyte

Comment on lines +49 to +50
if (bytes < 1000) return `${bytes} B`;
if (bytes < 999995) return `${(bytes / 1e3).toFixed(2)} kB`;

@aklinker1 aklinker1 Aug 8, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Using an odd cutoff here so 999,999 bytes is displayed as 1 MB instead of 1000 kB, given how toFixed works. See tests for founding and unit behavior.

@aklinker1
aklinker1 merged commit d95b34e into main Aug 8, 2026
20 checks passed
@aklinker1
aklinker1 deleted the replace-filesize branch August 8, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/wxt Includes changes to the `packages/wxt` directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant