Skip to content

⚡ Bolt: Pre-optimize project images for React compatibility - #165

Open
fysp11 wants to merge 1 commit into
mainfrom
perf/pre-optimize-project-images-7157884871533264315
Open

⚡ Bolt: Pre-optimize project images for React compatibility#165
fysp11 wants to merge 1 commit into
mainfrom
perf/pre-optimize-project-images-7157884871533264315

Conversation

@fysp11

@fysp11 fysp11 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

💡 What: Pre-computes optimized WebP image URLs server-side using Astro's getImage function and passes them to standard HTML <img> tags in the React ProjectsView component.
🎯 Why: Utilizing Astro's <Image /> component inside a React .tsx file causes build and hydration errors in this codebase. Defaulting to raw <img> tags sacrifices critical WebP compression and resizing benefits. This change fixes the component compatibility while preserving the performance gains.
📊 Impact: Ensures images are served in optimal WebP format, significantly reducing payload size and improving LCP without triggering hydration errors.
🔬 Measurement: Verify by running pnpm run check to ensure builds complete successfully, and inspect the rendered image src on the Projects page to confirm it references the compressed WebP asset rather than the raw static image.


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

Refactored the `ProjectsView` React component to utilize standard `<img>` tags instead of Astro's unsupported `<Image>` component to resolve build/hydration errors.

Performance optimization: To retain the build-time optimizations (WebP format conversion and image resizing), the optimized image URLs are now pre-computed on the server inside `src/pages/projects/index.astro` utilizing Astro's `getImage()` API and `import.meta.glob`. The resulting optimized URLs are passed as string props to the client React component.

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

Copy link
Copy Markdown

Preview deployments for fysp11.github.io ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: 457e49a0d3ee9270a75fd0404b3c1dac5f01054b

Deployment ID: 7acb582b-0cd6-4d4b-a6e8-051efb4ad80f

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