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

feat: don't report on file size of files we can infer from the main files #865

Closed
wants to merge 5 commits into from

Conversation

pauldambra
Copy link
Member

We use automation to track bundle size but it reports on every file in the dist folder. We only care about some of the files.

The GitHub action supports inclusion and exclusion lists: https://github.com/preactjs/compressed-size-action#customizing-the-list-of-files

Let's

  • exclude the other files to improve signal to noise ratio
  • not report on very tiny file size changes

@github-actions
Copy link

github-actions bot commented Oct 29, 2023

Size Change: 0 B

Total Size: 487 kB

ℹ️ View Unchanged
Filename Size
dist/array.full.js 170 kB
dist/array.js 112 kB
dist/exception-autocapture.js 12 kB
dist/recorder-v2.js 95.1 kB
dist/recorder.js 58.4 kB
dist/surveys.js 39.7 kB

compressed-size-action

@@ -12,3 +12,7 @@ jobs:
with:
build-script: "build-rollup"
compression: "none"
# no need to report on files that aren't the interesting ones
exclude: "{./dist/es.js,./dist/module.js,./dist/array.full.js,**/*.map,**/node_modules/**}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I want one module file atleast please, very useful for PRs like these: #863

Copy link
Collaborator

Choose a reason for hiding this comment

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

(and keeps the module file size in check as well, not just the snippet)

# no need to report on files that aren't the interesting ones
exclude: "{./dist/es.js,./dist/module.js,./dist/array.full.js,**/*.map,**/node_modules/**}"
# no need to report on very small byte changes which show as 0% change
minimum-change-threshold: 300
Copy link
Collaborator

Choose a reason for hiding this comment

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

a secondary benefit of this reporting is ensuring all changes you're doing are bundled correctly, not just when size bloats up too much, so I'd like to not have this minimum threshold.

"I updated module types, but oh, the module size didn't change - what's going wrong?" oh, gotta export it too 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

#til 👍

I've never once looked at them 🙉

@pauldambra pauldambra closed this Oct 29, 2023
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