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

Add build size bot workflow #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add build size bot workflow #1

wants to merge 1 commit into from

Conversation

jcs98
Copy link
Owner

@jcs98 jcs98 commented Nov 4, 2020

Motivation

(Write your motivation here.)

Have you read the Contributing Guidelines on pull requests?

(Write your answer here.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@github-actions
Copy link

github-actions bot commented Nov 4, 2020

Size Change: -2 B (0%)

Total Size: 156 kB

ℹ️ View Unchanged
Filename Size Change
website/build/blog/2017/12/14/introducing-docusaurus/index.html 20.7 kB -2 B (0%)
website/build/docs/introduction/index.html 180 B 0 B
website/build/index.html 5.83 kB 0 B
website/build/main.********.js 111 kB 0 B
website/build/styles.********.css 18.3 kB 0 B

compressed-size-action

@slorber
Copy link

slorber commented Nov 5, 2020

Hi

This looks like a good start but you should figure out options to make this way less verbose.

The js chunk hash is constantly changing (due to Webpack 4, webpack5 will be more deterministic afaik).
There's a option to "ignore" that hash: https://github.com/preactjs/compressed-size-action#dealing-with-hashed-filenames

Also, it's not useful to compare all HTML files with their previous versions, only a representative sample is enough (homepage, one doc, one blog post...)

What probably matters most are some specific js bundles, the heavy ones (like website/build/main.cd895b3b.js)

@jcs98
Copy link
Owner Author

jcs98 commented Nov 6, 2020

Thank you for the tips @slorber
Working on them now

@jcs98 jcs98 force-pushed the jcs98/build-size-bot branch 2 times, most recently from bb8eb90 to 7349a1d Compare November 9, 2020 16:40
@jcs98 jcs98 force-pushed the jcs98/build-size-bot branch from 7349a1d to 3d32594 Compare November 9, 2020 18:24
@jcs98
Copy link
Owner Author

jcs98 commented Nov 9, 2020

Hi

This looks like a good start but you should figure out options to make this way less verbose.

The js chunk hash is constantly changing (due to Webpack 4, webpack5 will be more deterministic afaik).
There's a option to "ignore" that hash: https://github.com/preactjs/compressed-size-action#dealing-with-hashed-filenames

Also, it's not useful to compare all HTML files with their previous versions, only a representative sample is enough (homepage, one doc, one blog post...)

What probably matters most are some specific js bundles, the heavy ones (like website/build/main.cd895b3b.js)

Hi @slorber
I figured out the regex to avoid the hash changes

I've also picked 5 representative files for tracking the build size:

1. website/build/main.____.js
2. website/build/styles.____.css
3. website/build/index.html
4. website/build/docs/introduction/index.html
5. website/build/blog/2017/12/14/introducing-docusaurus/index.html

Please see the #1 (comment) above
Does this work as a part of the solution for facebook#3521 ?

@slorber
Copy link

slorber commented Nov 13, 2020

thanks @jcs98 that looks nice. enough to be merged

can you open this pr to the main repo please?

@jcs98
Copy link
Owner Author

jcs98 commented Nov 13, 2020

Thank you @slorber!
I was unable to point this PR to facebook:master so I opened a new PR here: facebook#3744

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.

2 participants