anuraghazra / github-readme-stats

:zap: Dynamically generated stats for your github readmes
https://github-readme-stats.vercel.app
MIT License
66.69k stars 21.66k forks source link

Language icons #1380

Open RakeshPotnuru opened 2 years ago

RakeshPotnuru commented 2 years ago

Describe the solution you'd like Add icons to languages like github stats icons.

FayasNoushad commented 2 years ago

Its a good suggestion

rickstaa commented 2 years ago

@RakeshPotnuru I think this is a cool feature. We could use https://github.com/devicons/devicon/pulls to pull the icons.

DIvkov575 commented 1 year ago

could I be assigned to this?

rickstaa commented 1 year ago

@DIvkov575 I am happy to assign you to this issue, but I'm not sure it can be implemented without slowing the cards down too much. As explained by @anuraghazra in https://github.com/anuraghazra/github-readme-stats/pull/2099#discussion_r990822112, PRs should be mostly self-contained to prevent the Vercel function or GitHub from timing out. The devicon npm package is 139 MB and can, therefore, not be used. We could fetch the icon SVGs directly from the Devicon CDN, but this will still end us up with around 500kb of SVG data per icon. So I don't think implementing this feature is possible given the current Vercel and GitHub timeout limits. Maybe let's check what @anuraghazra thinks.

DIvkov575 commented 1 year ago

@anuraghazra @rickstaa Do you think it would be possible to add images by adding them to the person's readme repo and passing image paths into the card?

rickstaa commented 1 year ago

@anuraghazra @rickstaa Do you think it would be possible to add images by adding them to the person's readme repo and passing image paths into the card?

I think this is not desirable since GRS is meant to be easy to install. It is not a matter of where these icons are stored, the Devicons CDN is very fast, but more a matter of the total size of 10 icon SVGs on the card and the effect on the initial card loading speed. I did not test this out myself, but just a hypothesis. You can of course still create a PR so we can test it out. 👍🏻

rickstaa commented 1 year ago

@DIvkov575 To give you a bit more context. The timeout I'm talking about is the Vercel maxDuration timeout we must adhere to (see https://vercel.com/docs/concepts/limits/overview). That said, we might be able to include this as an opt-in feature that can be enabled using an environment variable. This would allow us to enable language icons for the GitHub action where these timeouts do not exist (see https://github.com/anuraghazra/github-readme-stats/issues/2179). This GitHub action has, however, not yet been implemented.