ember-cli-bundlesize icon indicating copy to clipboard operation
ember-cli-bundlesize copied to clipboard

Support relative size assertions

Open simonihmig opened this issue 6 years ago • 1 comments

Currently the addon supports only absolute size assertions. From the beginning of working on this I had the idea that supporting relative assertions (e.g. max increase of 1%) would be really cool, but semantics and implementation is not clear to me yet:

  • Compare the current size to what?
    • previous commit? (useless with a git style of having many small commits)
    • master branch
    • previous release (git tag matching /v\d+\.\d+\.\d+/)
  • how to get that previous size?
    • recalculate each and every time by checkout out the old git commit and running the build again (slow)
    • somehow persist the history of calculated sizes?
      • but where? In git, but how to automate that this gets checked in? Somewhere externally? (don't want to operate any kind of infrastructure for it, eventually privacy issues)
      • would allow some even cooler features, like a complete size history / charts.

simonihmig avatar Jun 27 '19 09:06 simonihmig

I don't think we can easily persist the information over multiple builds without creating data which has to be committed.

With addons, we could check the published artifact to compare versions.

makepanic avatar Jun 27 '19 10:06 makepanic