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.48k stars 1.82k forks source link

The comment might be misleading when size limit fails #332

Closed ad1992 closed 12 months ago

ad1992 commented 12 months ago

Below is the result json after running size-limit

[
  {
    "name": "dist/excalidraw.production.min.js",
    "passed": false,
    "size": 286003,
    "sizeLimit": 285000,
    "running": 0.06112,
    "loading": 5.58599609375
  },
  {
    "name": "dist/excalidraw-assets/locales",
    "passed": true,
    "size": 267745,
    "sizeLimit": 270000,
    "running": 0.017186666666666666,
    "loading": 5.[229](https://github.com/excalidraw/excalidraw/actions/runs/5659242959/job/15332367714?pr=6803#step:6:230)39453125
  },
  {
    "name": "dist/excalidraw-assets/vendor*.js",
    "passed": true,
    "size": 28735,
    "sizeLimit": 30000,
    "running": 0.021683333333333336,
    "loading": 0.561[230](https://github.com/excalidraw/excalidraw/actions/runs/5659242959/job/15332367714?pr=6803#step:6:231)46875
  }
]

As you can see the size is exceeded for excalidraw.production.min.js

However in the comment posted by size-limit, this is what is shown

Screenshot 2023-07-26 at 8 45 20 AM

And its not clear as the size 279.33 kB is within the limit of excalidraw.production.min.js (285 kB)

ai commented 12 months ago

Seems like you need to open an issue in size-limit-action since that project has a different maintainer

ad1992 commented 8 months ago

@ai before I make the change for this fix in the other gh action, I would like to inform that the difference is as the gh action library uses bytes (KIB) as mentioned here so should I change it in the gh action so it considers in KB or change here so it considers in KIB ?

ai commented 8 months ago

Yes, it is better to keep the same size format for both tool

ad1992 commented 8 months ago

Yes, it is better to keep the same size format for both tool

yep so as I asked above, which repo would be better to make the change? This repo or Gh actions repo?

ai commented 8 months ago

Gh actions repo