size-limit icon indicating copy to clipboard operation
size-limit copied to clipboard

Add customisation for improving performance culture

Open jochemvogel opened this issue 2 years ago • 6 comments

I recently thought about this and maybe others agree on this. Why not add customisation to the messages shown in the CLI and CI.

For example. I updated line 156 of create-report.js to:

if (typeof check.loadTime !== 'undefined') {
 rows.push(['Loading time', formatTime(check.loadTime), 'for ~1000 users per month'])
}

Can't find a way to modify the loading time. Currently it's set to Slow 3G (400kb/s & 2000ms latency). I would like to update it to the speed of our users.

This issue is not about solving this particular wish, it's about others as well. When possible to customise those messages, it will help to create awareness for the engineers.

image

Could elaborate on this and dive deeper into it, but I first want to see if people agree on this.

Possibly add it to the package.json. Just a rough draft:

"size-limit": [
  {  
     "path": "./clients/dashboard/build/static/js/vendorsMain.*.bundle.js",
     "customConfig": {
         "downloadSpeed": "1200 kb",
         "latency": "800 ms",
         "audienceMessage": "for ~600 users"
  }
],

jochemvogel avatar Jun 07 '23 10:06 jochemvogel

The best way to do it right now is to use JSON output and generate text output by custom JS code.

If you have a simple way to add a customization to Size Limit (for instance, by plugins), send PR.

ai avatar Jun 07 '23 10:06 ai

Ah ok, thanks. Makes sense. Is there any way to modify the Slow 3G settings? I've been looking for it for a while now, but looks like it's nowhere configured (which I don't believe).

I could update the docs so others can find it as well.

jochemvogel avatar Jun 07 '23 10:06 jochemvogel

No, we did not plan to make it customizable.

ai avatar Jun 07 '23 10:06 ai

Will have a look the coming days to see if it's worth my time. Otherwise I'll close this issue. Thank you.

jochemvogel avatar Jun 07 '23 10:06 jochemvogel

@ai Sorry, why isn't it customizable? 99% of our clients are not on slow 3G so it'd be really helpful to have a more realistic metrics

zernie avatar Jun 03 '24 14:06 zernie

@zernie if nobody want to send PR, it means that feature is not very popular.

ai avatar Jun 03 '24 14:06 ai