Skip to content

⚡ Bolt: Optimize Astro image processing across React component boundaries - #163

Open
fysp11 wants to merge 1 commit into
mainfrom
perf-optimize-astro-react-images-8147641981445581856
Open

⚡ Bolt: Optimize Astro image processing across React component boundaries#163
fysp11 wants to merge 1 commit into
mainfrom
perf-optimize-astro-react-images-8147641981445581856

Conversation

@fysp11

@fysp11 fysp11 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

💡 What: The optimization pre-computes WebP images using Astro's getImage function and import.meta.glob inside the projects/index.astro route, replacing an unsupported Astro <Image /> component instance in the ProjectsView.tsx React component with standard <img> tags. It also introduces index-based loading strategies (loading="eager" vs "lazy", fetchPriority="high").

🎯 Why: Rendering an Astro <Image /> component inside a React .tsx component breaks optimization paths and can lead to build errors or unoptimized assets being served. Additionally, blindly applying loading="lazy" on all items (including above-the-fold content) delays Largest Contentful Paint (LCP). By resolving images ahead of time, we ensure fully optimized assets (WebP) are reliably served and render blocking is prevented via decoding="async".

📊 Impact:

  • Generates fully optimized WebP images instead of serving large source JPEGs/PNGs (significantly decreasing payload sizes).
  • Faster First Contentful Paint (FCP) and Largest Contentful Paint (LCP) since the first two images are strictly eagerly loaded (fetchPriority="high").
  • Better main-thread performance by decoupling image decoding.

🔬 Measurement: Verify image network requests via DevTools in the Projects view. You should see .webp assets being served instead of .png/.jpg extensions, and the first few items should be eagerly loaded without delay.


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

- Use `import.meta.glob` and `getImage()` to statically optimize WebP formats at build time.
- Remove unsupported Astro `<Image />` from React component and replace with `<img>`.
- Add intelligent lazy loading based on viewport index to fix LCP.

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

kinsta Bot commented Aug 1, 2026

Copy link
Copy Markdown

Preview deployments for fysp11.github.io ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: d582fd165f6995c1a82bac0c9319b3f48b20ca4a

Deployment ID: 9006a528-aca7-4402-8022-aa67a29f329d

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