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

The comment might be misleading when size limit fails #106

Open
ad1992 opened this issue Aug 3, 2023 · 2 comments
Open

The comment might be misleading when size limit fails #106

ad1992 opened this issue Aug 3, 2023 · 2 comments

Comments

@ad1992
Copy link

ad1992 commented Aug 3, 2023

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)

@ad1992
Copy link
Author

ad1992 commented Aug 14, 2023

Any update on this ?

@ad1992
Copy link
Author

ad1992 commented Sep 7, 2023

Alright so digged more in to this and this line seems to be the culprit
https://github.com/andresz1/size-limit-action/blob/master/src/SizeLimit.ts#L32

bytes npm package considers 1KB = 1024 bytes where as

1KB = 1000 bytes
1KIB = 1024 bytes

and since size-limit itself accepts in KB so its better if we just divide by 1000 here instead to sync with the actual size-limit 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

1 participant