Skip to content

⚡ Bolt: Optimize project images and remove Astro <Image /> inside React - #156

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

⚡ Bolt: Optimize project images and remove Astro <Image /> inside React#156
fysp11 wants to merge 1 commit into
mainfrom
bolt/optimize-react-images-15957855057251526150

Conversation

@fysp11

@fysp11 fysp11 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

💡 What: The optimization implemented is two-fold:

  1. Replaced the invalid usage of Astro's <Image /> component inside a React component (ProjectsView.tsx) with native <img> tags.
  2. Moved the image processing logic to the server side in index.astro using import.meta.glob and getImage() to dynamically generate optimized WebP images (800w for grid, 160w for list).
  3. Applied native browser image loading attributes conditionally to prioritize loading above-the-fold images while deferring others.

🎯 Why: The performance problem it solves is eliminating unnecessary large payload sizes. Astro components shouldn't be executed in React, which previously resulted in runtime bugs or skipped build-time image optimization.

📊 Impact: Expect significantly smaller image payload sizes (often up to 80% smaller), a reduction in main-thread blocking, and faster Largest Contentful Paint (LCP) times due to correct image sizing, formatting, and prioritized loading (loading="eager" and fetchPriority="high" on LCP images, lazy loading elsewhere).

🔬 Measurement: You can verify the improvement by inspecting the network tab for .webp image formats loaded at a fraction of their original size, and observing the network waterfall to confirm deferred loading of off-screen images.


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

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 Jul 30, 2026

Copy link
Copy Markdown

Preview deployments for fysp11.github.io ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: b7c700c306ce2809a3c12a0569de8eb9ec012971

Deployment ID: b965f78d-0a5a-42e8-aee8-c05d21a44424

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