-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The image loading attribute depends only on the fetchpriority value #393
base: master
Are you sure you want to change the base?
The image loading attribute depends only on the fetchpriority value #393
Conversation
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
Hi @cavaglieridomenico , first of all, thanks for the PR. To accept that, we will have to discuss some points.
|
Hi @iago1501, thanks for your feedback and insight into the performance topic. I usually work on many VTEX accounts (itwhirlpool, frwhirlpool, bauknecht, etc.). Otherwise many other PLPs do not contain any banner image and the first product-card image is the LCP element. To analyze the second case we can use this URL as an example: Before 2024-07-30: After 2024-07-30: The aim of this PR is to achieve the possibility of managing the following cases:Case of PLP without banner image Case of PLP with banner image Case of product-card image on shelf CLS in rendering product-card images is usually quite controlled using min-height rules. |
What problem is this solving?
Currently resizing the images in the product-summary automatically sets the images to load lazy.
This behavior represents a performance issue especially in PLPs since the first product-summary image is usually the LCP element and if width and height are specified (obtaining the correct image size via CDN) the LCP element loads lazy (degrading LCP score).
The suggestion is to connect the
loading
value (without new props via CMS) to thefetchpriority
value (which already has correct logic and props via CMS).Furthermore, this feature removes the
auto
value that is not present in the possibleloading
attribute values (HTMLImageElement: loading property).How to test it?
Workspace
Screenshots or example usage:
Production
Workspace