perf: lazy-load country flag images to reduce initial page load (#128) - #132
Merged
smrithipiedy merged 1 commit intoJul 7, 2026
Merged
Conversation
…thipiedy#128) - Remove legacy `unoptimized` prop from flag `<Image>` components - Re-enables Next.js default image optimization and lazy loading behavior - Add explicit `loading="lazy"` to CountrySelector list images - Fixes eager loading of below-the-fold flag images, reducing initial LCP
|
@Mohammad-Hassan027 is attempting to deploy a commit to the Smrithi P's projects Team on Vercel. A member of the Team first needs to authorize it. |
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
Resolves #128.
Country flag
<Image>components were using theunoptimizedprop, a legacyworkaround from the Cloud Run deployment. This prop bypasses Next.js image
optimisation and also disables its built-in lazy loading, causing all flag images
to load eagerly — even those far below the fold — on initial page load.
With the Vercel migration, this workaround is no longer needed.
Changes Made
src/app/choose-path/page.tsx: Removedunoptimizedfrom the selected-countryflag
<Image>. Next.js<Image>defaults tolazy, so no extra attribute needed.src/components/Location/CountrySelector.tsx: Removedunoptimizedand addedexplicit
loading="lazy"to country list flag images — the primary source ofunnecessary network requests on initial load.
Performance Impact
format conversion, CDN caching)
Testing