⚡ Bolt: Optimize image rendering in ProjectsView - #159
Conversation
💡 What: - Pre-compute Astro optimized images (grid & list variants) using `getImage()` in `src/pages/projects/index.astro`. - Replaced the Astro `<Image />` component with standard `<img>` tags in `src/components/ProjectsView.tsx`. - Implemented `loading="eager"` and `fetchPriority="high"` attributes for above-the-fold images and `loading="lazy"` for others. - Documented findings in `.jules/bolt.md`. 🎯 Why: Astro's built-in `<Image />` component does not work correctly for React UI components. Doing this manually with `<img>` drops build-time webp conversion and scaling. This allows us to have both the interactive React UI and the build-time optimizations. Applying optimal attributes further speeds up initial viewport loads. 📊 Impact: - Regains build-time webp conversions, reducing bandwidth usage. - Improves LCP (Largest Contentful Paint) for above-the-fold images via eager loading and high fetch priority. - Offloads below-the-fold image loads via lazy loading. 🔬 Measurement: Run `pnpm run build` and inspect the `dist` folder network requests to ensure webp assets are correctly requested by the browser, and loading attributes are properly set in the DOM. Co-authored-by: fysp11 <13081700+fysp11@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Preview deployments for fysp11.github.io ⚡️
Commit: Deployment ID: Static site name: |
⚡ Bolt: Optimize image rendering in ProjectsView
💡 What:
getImage()insrc/pages/projects/index.astro.<Image />component with standard<img>tags insrc/components/ProjectsView.tsx.loading="eager"andfetchPriority="high"attributes for above-the-fold images andloading="lazy"for others..jules/bolt.md.🎯 Why:
Astro's built-in
<Image />component does not work correctly for React UI components. Doing this manually with<img>drops build-time webp conversion and scaling. This allows us to have both the interactive React UI and the build-time optimizations. Applying optimal attributes further speeds up initial viewport loads.📊 Impact:
🔬 Measurement:
Run
pnpm run buildand inspect thedistfolder network requests to ensure webp assets are correctly requested by the browser, and loading attributes are properly set in the DOM.PR created automatically by Jules for task 16698535432108647905 started by @fysp11