Skip to content
New issue

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

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

Already on GitHub? # to your account

[Docs] How to display the size difference relative to master #22

Closed
noalbalint opened this issue Jul 26, 2021 · 8 comments
Closed

[Docs] How to display the size difference relative to master #22

noalbalint opened this issue Jul 26, 2021 · 8 comments

Comments

@noalbalint
Copy link

noalbalint commented Jul 26, 2021

Great package, overall it's working really well!

In your docs you have a screenshot of the GitHub Checks that includes the note: 0.2kb larger than master, careful!

I would also like to highlight the size difference relative to Master in my Check message, but I don't see how this is possible as there's nothing in the docs about it?

I can only figure out how to check if the files are under a certain threshold– currently the check just says 50 checks passed because all 50 checked files are below their stated limit. This is good but not great– it would be much more useful to see how much is has increased rather than just a binary pass/fail. I see that this is possible, but I don't see how to do it.

My bundlesize.config.json is basically just:

  "files": [
    {
      "path": "<path1>",
      "path": "<path2>",
      "maxSize": "400kb"
    },
    {
      "path": "<path3>",
      "maxSize": "200kb"
    },
    {
      "path": "<path4>",
      "maxSize": "150kb"
    },
    {
      "path": "<path5>",
      "maxSize": "50kb"
    }
  ]

Thank you!

(path names made generic because I don't think it adds anything)

@siddharthkp
Copy link
Owner

Hi!

Right now, the diff from main branch is only shown when there's only 1 file (or only 1 file that failed), would it be interesting to see the sum of diffs (+-) from main branch?

@noalbalint
Copy link
Author

Hey, thanks for the quick response! Yeah I would definitely +1 for a total diff sum :)

Another reason for this is that we don't want to necessarily block merging if the check fails, but it would still be nice to see the difference. Thanks for your consideration!

@siddharthkp
Copy link
Owner

Cool, I'll add it to the list 👍

@siddharthkp
Copy link
Owner

siddharthkp commented Aug 3, 2021

Hi!

I just added total diff from base branch to the title. Would love to see how that looks in your repo :)

Released in bundlesize2@0.0.30

@noalbalint
Copy link
Author

noalbalint commented Aug 6, 2021

hey @siddharthkp! super impressed with how quickly you implemented this, and sorry to bother you again but we tried updating from 0.0.28 to 0.0.30, but still just seeing the same message as before:

Screen Shot 2021-08-06 at 1 50 07 PM

Is there any other change that needs to be made for this to work? Like a flag somewhere maybe?

@siddharthkp
Copy link
Owner

I have a hunch, this might have something to do with the file names. Can you show me the long report from CI?

@noalbalint
Copy link
Author

here's the full output with from CI with file names:


─ ./public/clients/js/chunk-*.js
   ./public/clients/js/chunk-0528233a.962d99d1.js                                                   388.45KB < 400kb gzip
   ./public/clients/js/chunk-06b555ba.6620df67.js                                                   98.69KB < 400kb gzip
   ./public/clients/js/chunk-2d0ba1e2.23fd9887.js                                                   6.65KB < 400kb gzip
   ./public/clients/js/chunk-b68d2c44.365a690e.js                                                   38.38KB < 400kb gzip
   ./public/clients/js/chunk-common.569138ad.js                                                     44.63KB < 400kb gzip
   ./public/clients/js/chunk-vendors.b9664e94.js                                                    277.38KB < 400kb gzip

─ ./public/clients/js/vueMarkdown.*.js
   ./public/clients/js/vueMarkdown.9876d51c.js                                                      176.42KB < 200kb gzip

─ ./public/clients/js/assetsHomeView.*.js
   ./public/clients/js/assetsHomeView.d31058f5.js                                                   144.03KB < 150kb gzip

─ ./public/clients/js/!(chunk-*|vueMarkdown.*|assetsHomeView.*).js
   ./public/clients/js/ActionCell.1ff5034f.js                                                       1.04KB < 50kb gzip
   ./public/clients/js/app.ddeba576.js                                                              17.19KB < 50kb gzip
   ./public/clients/js/assets.e22e5b66.js                                                           17.82KB < 50kb gzip
   ./public/clients/js/assetsDetailsView.1642c449.js                                                4.95KB < 50kb gzip
   ./public/clients/js/assetsDetailsView~assetsGroupsView~assetsHomeView~assetsMatchesView~results.bf5fd28c.js    9.92KB < 50kb gzip
   ./public/clients/js/assetsGroupsView.77831882.js                                                 4.4KB < 50kb gzip
   ./public/clients/js/assetsMatchesView.077426ac.js                                                22.76KB < 50kb gzip
   ./public/clients/js/assetsMatchesView~platformApiDocs~results~searchHistory.ff813d05.js          5.76KB < 50kb gzip
   ./public/clients/js/assetsMatchesView~results.326475ee.js                                        8.26KB < 50kb gzip
   ./public/clients/js/assetsNavigation.800eaa77.js                                                 2.65KB < 50kb gzip
   ./public/clients/js/assetsNotificationsView.2f154fc3.js                                          370B < 50kb gzip
   ./public/clients/js/assetsViewsWrapper.b9092173.js                                               363B < 50kb gzip
   ./public/clients/js/auth.c58c4e33.js                                                             2.42KB < 50kb gzip
   ./public/clients/js/ChipCell.cb938b8d.js                                                         703B < 50kb gzip
   ./public/clients/js/compliance.c116753b.js                                                       6.92KB < 50kb gzip
   ./public/clients/js/echosec.2a69c247.js                                                          29.88KB < 50kb gzip
   ./public/clients/js/echosecInfo.fa6a9c68.js                                                      1.13KB < 50kb gzip
   ./public/clients/js/home.5886abdc.js                                                             8.18KB < 50kb gzip
   ./public/clients/js/home~results.571535c1.js                                                     25.84KB < 50kb gzip
   ./public/clients/js/IconCell.79e5adee.js                                                         952B < 50kb gzip
   ./public/clients/js/jsonViewer.9a71509a.js                                                       10.14KB < 50kb gzip
   ./public/clients/js/logout.2fe2f7e2.js                                                           409B < 50kb gzip
   ./public/clients/js/MultiheaderCell.0a74da5d.js                                                  769B < 50kb gzip
   ./public/clients/js/NewAssetsModal.513dd138.js                                                   10.57KB < 50kb gzip
   ./public/clients/js/platform-api.b7322413.js                                                     4.6KB < 50kb gzip
   ./public/clients/js/platformApiAccount.57490db9.js                                               3.38KB < 50kb gzip
   ./public/clients/js/platformApiCaseStudies.d95a665f.js                                           8.56KB < 50kb gzip
   ./public/clients/js/platformApiDocs.0ba3175c.js                                                  9.55KB < 50kb gzip
   ./public/clients/js/results.d06dd450.js                                                          16.02KB < 50kb gzip
   ./public/clients/js/searchHistory.6594f8ee.js                                                    35.94KB < 50kb gzip
   ./public/clients/js/searchHistory~vueMarkdown.79a59a64.js                                        6.88KB < 50kb gzip
   ./public/clients/js/SelectionCell.e651b343.js                                                    873B < 50kb gzip
   ./public/clients/js/settings.4202e398.js                                                         5.28KB < 50kb gzip
   ./public/clients/js/sharedSettings-accountSettings.0373d5c8.js                                   1.31KB < 50kb gzip
   ./public/clients/js/sharedSettings-deviceSettings.1052fde2.js                                    10.01KB < 50kb gzip
   ./public/clients/js/sharedSettings-organizationMembersMain.e158a9fb.js                           4.54KB < 50kb gzip
   ./public/clients/js/sharedSettings-passwordSettings.c63a3fb2.js                                  3.26KB < 50kb gzip
   ./public/clients/js/sharedSettings-secrets.dd950215.js                                           1.54KB < 50kb gzip
   ./public/clients/js/sharedSettings-socialIntegrationSettings.e7c261c5.js                         1.76KB < 50kb gzip
   ./public/clients/js/sharedSettings-usageSettings.a5ee7447.js                                     9.62KB < 50kb gzip
   ./public/clients/js/TextCell.02bd9ea7.js                                                         784B < 50kb gzip
   ./public/clients/js/ToggleCell.cdad80f5.js

we're also using webpack chunking (as you can probably tell)– so that might be an issue?

@siddharthkp
Copy link
Owner

siddharthkp commented Aug 10, 2021

Oh yeah, that's the trouble.

There are 2 types of files here:

  1. Some of these files are easier to match with previous builds like /js/TextCell.02bd9ea7.js or /js/ToggleCell.cdad80f5.js, it might work out if we can fuzzy match with previous builds because the hashed names are predictable.

  2. then some of them like chunk-0528233a.962d99d1.js and chunk-06b555ba.6620df67.js are impossible to match with their versions from previous builds, which would make the summation incorrect and less useful?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants