Skip to content

⚡ Bolt: [performance improvement] Pre-optimize project images and fix React DOM attributes - #184

Open
fysp11 wants to merge 1 commit into
mainfrom
bolt/fix-react-astro-image-3815546033150229987
Open

⚡ Bolt: [performance improvement] Pre-optimize project images and fix React DOM attributes#184
fysp11 wants to merge 1 commit into
mainfrom
bolt/fix-react-astro-image-3815546033150229987

Conversation

@fysp11

@fysp11 fysp11 commented Aug 8, 2026

Copy link
Copy Markdown
Owner
  • 💡 What: Removed the unsupported Astro Image component from the ProjectsView.tsx React component, mapped optimized images at the server level in index.astro using import.meta.glob and getImage(), and updated the React view to use standard img tags with loading, fetchPriority, and decoding attributes.
  • 🎯 Why: Using Astro's built-in Image component inside React UI components is unsupported and can lead to build/hydration issues. Generating the optimized WebP images on the server preserves the build-time optimizations, and manually setting loading and fetchPriority fixes LCP performance for above-the-fold content.
  • 📊 Impact: Prevents hydration warnings and build issues, guarantees WebP optimization for project cards, and improves LCP and Core Web Vitals on the projects page.
  • 🔬 Measurement: Observe the DOM on the /projects page. The first two images will have loading="eager" and fetchPriority="high", while subsequent images will correctly have loading="lazy". All images will have decoding="async" and link to optimized WebP resources.

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

Fixes an anti-pattern where Astro's `<Image>` was used inside a React UI component, causing hydration and optimization issues.
Moves the image resolving to `index.astro` at build time using `getImage()`.
Updates the React component to use native HTML `<img>` with lazy loading, fetch priorities, and async decoding attributes.

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 8, 2026

Copy link
Copy Markdown

Preview deployments for fysp11.github.io ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: cd4ab9bfa3506d20901bb6faba504a9f59dd1760

Deployment ID: bab9ca71-f36f-4049-a3f3-a8e64310f072

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