Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report aggregate stats by folder and file type? #111

Open
slorber opened this issue Sep 4, 2024 · 3 comments
Open

Report aggregate stats by folder and file type? #111

slorber opened this issue Sep 4, 2024 · 3 comments

Comments

@slorber
Copy link
Contributor

slorber commented Sep 4, 2024

I'm using this project on Docusaurus, a static site generator, to monitor the build output size

Example PR comment: facebook/docusaurus#10470 (comment)

Monitoring by file size is great, but in our case, we emit too many output files to monitor them all without creating noise, so I only added a "representative" list of output files.

What would be a great addition for us would be to have the ability to compare the before/after size of a whole folder. Eventually be able to break it down by file type, so that we could detect if JS, CSS, or HTML total output size increases after a PR.

I'm wondering if this could be part of this project, or if it's out of scope and should be a separate tool.

@rschristian
Copy link
Member

Interesting, would you only want the folder and file types inside of it, replacing individual files altogether then? Something like the following maybe:

Directory Type Size Change
compat/dist/foo CSS 3.53 kB -567 B (-13.83%) 👏
compat/dist/foo JS 3.44 kB -582 B (-14.46%) 👏
compat/dist/foo HTML 3.6 kB -571 B (-13.71%) 👏

Or perhaps:

Directory Type Size Change
compat/dist/foo All 9.53 kB -567 B (-13.83%) 👏
CSS 3.53 kB -567 B (-13.83%) 👏
JS 3.44 kB -582 B (-14.46%) 👏
HTML 3.6 kB -571 B (-13.71%) 👏
compat/dist/bar All 9.53 kB -567 B (-13.83%) 👏

(Ignore the nonsensical sizes that don't add up, I quickly copy/pasted from Preact 😄)

Or in addition to the existing output? Just thinking if it's a toggled either/or situation or just a new output table.


I think it would be a reasonable addition though!

@slorber
Copy link
Contributor Author

slorber commented Sep 4, 2024

Thanks!

I think a separate table makes more sense. I guess something like this could be nice, with the ability to count the number of files and the change too.

For flexibility, I'd break it down by extension and not just CSS/JS/HTML.

Folders Count Size Change
website/build1 278 (+1 ⚠️) 666 kB +34 B (+0.01%)
website/build2 10 (+0) 10 kB +34 B (+0.01%)
TOTAL 288 (+1 ⚠️) 676 kB +34 B (+0.01%)
ℹ️ Break down by extension
Extension Count Size Change
.js 100 (+0) 2 B 0 B
.css 100 (+1 ⚠️) 27.9 kB 0 B
.html 100 (+0) 27.9 kB 0 B
.jpg 100 (+0) 30.2 kB 0 B

@rschristian
Copy link
Member

For flexibility, I'd break it down by extension and not just CSS/JS/HTML.

Yeah that was just for a quick example, albeit using the names instead of the proper extension.

But this seems reasonable and I can see how many might want this. I'll take a look at this later this week if I get some time.

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

No branches or pull requests

2 participants