Skip to content

Conversation

@Giov7
Copy link

@Giov7 Giov7 commented Jan 22, 2026

This PR fixes a problem on the Image block which doesn't allow eager loading. That's happening because of vtex render runtime non-handling the image prop correctly.

How to test it? *

I tested this behaviour here: https://www.whirlpool.it/?workspace=testkg65

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures that images explicitly marked for eager loading are not overridden by the render-runtime’s lazy-loading behavior, so the Image block’s eager-loading configuration works as intended.

Changes:

  • Introduces an isEager check in MaybeLazyImage based on imageProps.loading === 'eager'.
  • Skips applying both native lazy-loading (loading="lazy") and the lazysizes logic when the image is eager, while preserving the existing preload (data-vtex-preload) behavior.

Copy link
Contributor

@vmourac-vtex vmourac-vtex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Giov7 thanks for submitting your PR!

Your change makes sense and seems in line with loading behavior in components like ProductImage, InfoCard, etc.

@iago1501 @vsseixaso what do you think?

Regardless, I would ask you to:

  • Modify the CHANGELOG file with your proposed change
  • Add tests to validate your changes

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.

2 participants