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 · 2 comments
Open

Add Diff budgeting in addition to maxSize budget #365

kanalveli-ramachandran opened this issue Aug 26, 2020 · 2 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.

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