Skip to content
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

fix(templates): adds priority to hero images #10003

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

jacobsfletch
Copy link
Member

@jacobsfletch jacobsfletch commented Dec 16, 2024

Hero images should use the priority property so that browsers will preload them. This is because hero images, by definition, are rendered "above the fold" and should be treated as such, optimizing LCP. This also means these images should not define a loading strategy, as this disregards the priority flag.

@jacobsfletch jacobsfletch force-pushed the fix/templates-hero-priority branch from cc979d4 to a247f40 Compare December 16, 2024 21:11
@jacobsfletch jacobsfletch merged commit f54e180 into main Dec 16, 2024
21 checks passed
@jacobsfletch jacobsfletch deleted the fix/templates-hero-priority branch December 16, 2024 21:21
Copy link
Contributor

🚀 This is included in version v3.8.0

@hkn-wt
Copy link
Contributor

hkn-wt commented Dec 17, 2024

But there is an error because ImageMedia component set loading='lazy' and it throw an error when combining with priority. Fixed here : #10023

@jacobsfletch
Copy link
Member Author

Ahh thank you for catching this @hkn-wt, I see your PR coming in now. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants