Optimize GitHub Avatars with Next.js Image Component#8184
Open
kanishka-2007-tech wants to merge 1 commit into
Open
Optimize GitHub Avatars with Next.js Image Component#8184kanishka-2007-tech wants to merge 1 commit into
kanishka-2007-tech wants to merge 1 commit into
Conversation
Contributor
|
@kanishka-2007-tech is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
This PR enhances the performance of GitHub avatar rendering by leveraging Next.js's built-in image optimization capabilities. It addresses issues related to bandwidth usage and loading performance, which is crucial for user experience. Additionally, it aligns with previous decisions made to improve performance and caching strategies in the repository. Thank you for your contribution, and I look forward to your updates! |
Contributor
📦 Next.js Bundle Size Report (Gzipped Sizes)
📊 Summary of Totals
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
GitHub avatar images across 7 components were rendered using raw HTML
tags, bypassing Next.js built-in image optimization. This resulted in:
No automatic WebP/AVIF format conversion
No lazy loading out of the box
No responsive sizing
Higher bandwidth usage and slower LCP (Largest Contentful Paint) scores
The next.config.ts already had both avatars.githubusercontent.com and github.com configured under remotePatterns, meaning the optimization infrastructure was ready — just not being used.
Every GitHub avatar across the dashboard, leaderboard, burnout analyzer, and developer arena will now be:
Served as WebP/AVIF automatically where the browser supports it
)
Lazy loaded by default (images below the fold don't block rendering)
Properly sized to avoid layout shift (explicit width/height on every
Fixes #3696
Pillar
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.