Skip to content

perf: migrate external images to Next.js Image - #100

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
EmmyKay0026:perf/optimise_image_loading_and_caching
Jul 29, 2026
Merged

perf: migrate external images to Next.js Image#100
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
EmmyKay0026:perf/optimise_image_loading_and_caching

Conversation

@EmmyKay0026

@EmmyKay0026 EmmyKay0026 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description

Migrates all production image rendering from standard HTML <img> elements to Next.js <Image />.

The new shared image component provides explicit dimensions, lazy loading, WebP optimization for approved remote hosts, blur-up placeholders, and graceful fallbacks when remote images fail to load.

Linked Issue

Closes #62

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • UI/UX improvement
  • Performance improvement
  • Code refactoring

Summary of Changes

  • Added a reusable ImageWithFallback component with fixed dimensions, lazy loading, blur placeholders, and URL-aware error recovery.
  • Migrated ENS avatars and plugin icons from raw <img> elements to Next.js <Image />.
  • Added equal-sized fallbacks for failed ENS avatars and plugin icons to prevent layout shifts.
  • Configured WebP output and remote image patterns for CoinGecko, ENS, GitHub, and jsDelivr hosts.
  • Bypassed server-side optimization for unknown remote hosts to avoid unsafe server fetches while retaining sizing, lazy loading, and fallback behavior.
  • Added tests covering intrinsic dimensions, lazy loading, blur placeholders, optimized URLs, failed-image fallbacks, and retries when an image URL changes.
  • Confirmed that no raw <img> elements remain in production source files.

Test Evidence

The following checks were run:

npm test
npm test -- --run components/ImageWithFallback.test.tsx components/Avatar.test.tsx
npm run lint
npm run typecheck
node node_modules/next/dist/bin/next build

@Lakes41
Lakes41 merged commit 2a58d49 into Adamantine-guild:main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize Next.js Image Loading and Asset Caching

2 participants