feat(perf): optimize image loading with WebP conversion and next/imag…#59
Merged
meshackyaro merged 1 commit intoJun 29, 2026
Merged
Conversation
|
@Akatenvictor is attempting to deploy a commit to the Meshack Yaro 's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
meshackyaro
approved these changes
Jun 29, 2026
meshackyaro
left a comment
Contributor
There was a problem hiding this comment.
Well done and thanks for contributing to this project
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.
Summary
Changes
┌─────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────┐
│ File │ What changed │
├─────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ assets/avatar.webp │ WebP replacement for avatar.png (1.5 KB → 940 B, −40%) │
├─────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ assets/example.webp │ WebP replacement for example.png (123 KB → 6.1 KB, −95%) │
├─────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ next.config.js │ Added images.formats, deviceSizes, and imageSizes config │
├─────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ components/organisms/campaign/index.tsx │ Imports WebP assets; added sizes + priority to hero image │
├─────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ components/atoms/author-info/index.tsx │ Added sizes="36px" to fixed-size avatar │
├─────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ scripts/convert-to-webp.js │ Reusable conversion script — run npm run convert:assets for new images │
├─────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ package.json │ Added sharp devDependency and convert:assets script │
└─────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────┘
Why priority on the campaign image?
The campaign image is above the fold and was being lazy-loaded, which blocked LCP. Marking it priority injects a in the document head so the browser fetches it immediately.
Test plan
Dependencies introduced
┌─────────┬─────────┬────────────────────────────────────────────────────────────────────┐
│ Package │ Version │ Role │
├─────────┼─────────┼────────────────────────────────────────────────────────────────────┤
│ sharp │ ^0.35.2 │ devDependency — WebP/AVIF conversion in scripts/convert-to-webp.js │
└─────────┴─────────┴────────────────────────────────────────────────────────────────────┘
Closes #7