Skip to content

⚡ Bolt: Optimize image loading on projects view using build-time generation - #181

Open
fysp11 wants to merge 1 commit into
mainfrom
bolt/image-optimization-198499415907811784
Open

⚡ Bolt: Optimize image loading on projects view using build-time generation#181
fysp11 wants to merge 1 commit into
mainfrom
bolt/image-optimization-198499415907811784

Conversation

@fysp11

@fysp11 fysp11 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

💡 What: Implemented build-time WebP optimization for dynamic images in the React components, replacing the invalid usage of the Astro <Image /> component with standard <img> tags that use pre-computed optimized strings. Applied targeted fetchPriority and loading attributes.

🎯 Why: The Astro <Image /> component cannot be used natively inside .tsx files, leading to unoptimized image loading. Furthermore, assigning eager loading to all mapped images was a performance anti-pattern.

📊 Impact:

  • Reduces bundle footprint by resolving image processing completely at build time.
  • Guarantees performant WebP format via Astro build engine.
  • Optimizes LCP significantly by prioritizing only above-the-fold assets, leaving below-the-fold items appropriately deferred.

🔬 Measurement:

  • Run pnpm run build and inspect the generated HTML in /dist to confirm standard <img> tags possess /dist/_astro/*.webp sources and correct loading/priority rules for initial index values.

PR created automatically by Jules for task 198499415907811784 started by @fysp11

…ration

- Replaced incompatible Astro `<Image />` component with standard `<img>` tags in React.
- Used `import.meta.glob` and Astro's `getImage()` at the server level (`index.astro`) to pre-optimize dynamic images into WebP strings at build-time.
- Conditionally applied `fetchPriority="high"` and `loading="eager"` only to above-the-fold images to optimize LCP.

Co-authored-by: fysp11 <13081700+fysp11@users.noreply.github.com>
@kinsta

kinsta Bot commented Aug 7, 2026

Copy link
Copy Markdown

Preview deployments for fysp11.github.io ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: 8ee1938769d9b71bb9029960b335c38fa23f8ba6

Deployment ID: ae8a4214-f311-4b3b-994d-91721927ecf4

Static site name: fysp11githubio-cleb3

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant