ai / size-limit

Calculate the real cost to run your JS app or lib to keep good performance. Show error in pull request if the cost exceeds the limit.
MIT License
6.56k stars 1.82k forks source link

Add statoscope plugin #217

Closed MrFlashAccount closed 3 years ago

MrFlashAccount commented 3 years ago

Hello 👋

This PR adds support of new statoscope plugin: https://github.com/smelukov/statoscope

Why: BundleAnalyzer is extremely popular and powerful tool for keeping our bundle in fit, but it doesn't have some useful features: 1) it can't tell me why some dep is added 2) it can't compare builds between each other (I'd like to compare feature branch with actual main) 3) it doesn't show me deoptimizations and why are they happened.

Statoscope covers all these cases and shows chunks map (like the BundleAnalyser does)

MrFlashAccount commented 3 years ago

@ai what do you think, it's better to use '--why statoscope' instead of '--why-statoscope'?

ai commented 3 years ago

Any reason why BundleAnalyzer is better to be the default --why viewer? :)

MrFlashAccount commented 3 years ago

I think backward compatibility might be a good reason plus statoscope is new and hasn't battle tested yet. But yes, I agree that statoscope should be the default viewer :)

ai commented 3 years ago

Let’s start with --why statoscope and we will try to change viewer in next major release

MrFlashAccount commented 3 years ago

done

ai commented 3 years ago

One more thing. We need to add docs about this awesome feature.

  1. Add option to --help
  2. Add screenshot and text about “showing why some dep is added” in README.md after Webpack Bundle Analyzer screenshot

We can add a link to Statoscope from README.md to help with tool promotion

ai commented 3 years ago

@MrFlashAccount do you want to finish this PR?

smelukov commented 3 years ago

Hi. I would like to deal with it. I'll try to done this PR in a couple of days

smelukov commented 3 years ago

@ai I can't push into this branch I've created another PR https://github.com/ai/size-limit/pull/251 Review please ☺️