Skip to content

⚡ Bolt: [performance improvement] conditionally optimize LCP images in ProjectsView - #187

Open
fysp11 wants to merge 1 commit into
mainfrom
bolt-optimize-react-images-6495021936313522973
Open

⚡ Bolt: [performance improvement] conditionally optimize LCP images in ProjectsView#187
fysp11 wants to merge 1 commit into
mainfrom
bolt-optimize-react-images-6495021936313522973

Conversation

@fysp11

@fysp11 fysp11 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

💡 What: The ProjectsView.tsx component was incorrectly using Astro's built-in <Image> component, which is unsupported inside React components. We replaced it with standard HTML <img> elements, pre-computed optimized WebP paths at the server level in index.astro, and conditionally applied loading="eager" / fetchPriority="high" only to the first two above-the-fold images while lazily loading the rest.

🎯 Why: Rendering unoptimized images or improperly applying eager loading attributes to large, unbounded lists degrades page load speed (Largest Contentful Paint) and causes network waterfall contention. By computing optimizations at build time and conditionally eager loading critical assets, we substantially improve initial paint times.

📊 Impact: Expect a noticeable improvement to LCP score and reduced network bandwidth usage for off-screen images.

🔬 Measurement: Verify by running the application (pnpm run build), opening the network tab, and ensuring that initial viewport images load optimally while below-the-fold images wait to be fetched until they enter the viewport.


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

- Replaces unsupported Astro `<Image>` tags inside React components with standard `<img>` elements.
- Pre-computes WebP optimized image paths at build time in `index.astro` using `getImage` and `import.meta.glob`, passing optimized paths down to React.
- Conditionally applies `loading="eager"` and `fetchPriority="high"` only to above-the-fold images to optimize LCP without causing network contention for lazy-loaded content.

Co-authored-by: fysp11 <13081700+fysp11@users.noreply.github.com>
@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.

@kinsta

kinsta Bot commented Aug 9, 2026

Copy link
Copy Markdown

Preview deployments for fysp11.github.io ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: 016a2225d886af23f669f4811a3785aad44159ae

Deployment ID: 756116a1-6aad-437c-9b44-d4282dc756f4

Static site name: fysp11githubio-cleb3

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