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 Diff budgeting in addition to maxSize budget #365

Open
kanalveli-ramachandran opened this issue Aug 26, 2020 · 5 comments
Open

Add Diff budgeting in addition to maxSize budget #365

kanalveli-ramachandran opened this issue Aug 26, 2020 · 5 comments

Comments

@kanalveli-ramachandran
Copy link

Do you want to request a feature or report a bug?
Feature

If this is a feature request, what is motivation or use case for changing the behavior?

While we can currently setup maxSize budgets for file patterns, periodic incremental changes will end up breaching the budget.
So can we also consider implementing diff budgets?

Please mention other relevant information.

  • node version
  • npm version
  • Operating system
  • bundlesize version - 0.17.1
  • CI you are using - Jenkins
@siddharthkp
Copy link
Owner

So can we also consider implementing diff budgets?

Can you tell me a little more about diff budgets? What would that look like?

@kanalveli-ramachandran
Copy link
Author

So can we also consider implementing diff budgets?

Can you tell me a little more about diff budgets? What would that look like?

Currently we have maxSize budgets,

{
  "path": "./dist/assets/feature-module*.js",
  "compression": "brotli",
  "maxSize": "30 kB"
}

In any product, each module will incrementally be worked upon. So over a period of pull request merges, the maxSize budget will be breached.

So if we can also setup a budget on the increase in size that can be allowed per request,

 {
  "path": "./dist/assets/feature-module*.js",
  "compression": "brotli",
  "diffSize": "100 B"
}

We would be able to control things at a granular level.

This will also help capture bulk increases in the asset. ie, a maxSize of 30kb will not be able to capture a dependency change that brings in a 5kb increase in size on a 23kb asset. but a 1kb diffSize will easily capture these anomalies.

@lauriro
Copy link

lauriro commented Aug 15, 2024

So you believe that gradually reaching a 15MB bloat is somehow better than at once? :p

@kanalveli-ramachandran
Copy link
Author

Nope. 'In addition to the overall size is the crux here'

  1. I wanted small manageable diffs
  2. Alert on diffs that breezed through with a large dependency just because it was lesser than the overall size.

Whoah its been 3 years 😅

@lauriro
Copy link

lauriro commented Aug 16, 2024

Oh, I didn't notice the issue date, or last commit date 😄

I just ran ...

$ cd `mktemp -d`
$ npm install bundlesize
added 111 packages in 22s
$ du -sh
15M

... and wanted to see if only I am bothered by the result.

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

3 participants