vtex-apps / product-summary

VTEX Product Summary app
11 stars 52 forks source link

Add Fetch Priority to Product Summary Image #388

Closed gab-monteiro closed 8 months ago

gab-monteiro commented 9 months ago

What problem is this solving?

The aim of this change is to enhance the LCP performance metric on search pages for both desktop and mobile devices.

This is achieved by setting the fetchpriority property of Shelf Images, allowing users the freedom to decide the priority they desire.

Motivation

The inclusion of this option aims to provide flexibility and control over loading showcase images. By introducing the ability to define image search priority, users will have the option of deciding whether or not to use their options, adapting loading according to the needs of the context of use.

Proposed Implementation

The 'fetchPriority' property will be an additional option for showcase images. It will accept values ​​that represent search priorities, allowing developers and users to choose between "low", "auto" and "high" image loading priorities.

Conclusion

Adding 'fetchPriority' support to storefront images will provide a flexible and controlled way of handling image loading, improving both performance and user experience.

I am available for any further questions regarding how it is implemented and I am also leaving 2 reports from the lighthouse (mobile) with the impacts of our performance with the prop and what it is currently like.

lighthouse-loja.electrolux.com.br-mobile-atualmente.pdf lighthouse-loja.electrolux.com.br-mobile-com-a-prop.pdf

How to test it?

Aplicado-na-loja

Aplicado-na-loja-segunda-opção

Workspace

Screenshots or example usage:

How does this PR make you feel? :link:

vtex-io-ci-cd[bot] commented 9 months ago

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.

vtex-io-docs-bot[bot] commented 9 months ago

Beep boop :robot:

Thank you so much for keeping our documentation up-to-date :heart: