aem-core-wcm-components
aem-core-wcm-components copied to clipboard
[Image v3] #2263: Add fetchpriority attribute support
| Q | A |
|---|---|
| Fixed Issues? | Fixes #2263 |
| Patch: Bug Fix? | no |
| Minor: New Feature? | Yes |
| Major: Breaking Change? | no |
| Tests Added + Pass? | Yes |
| Documentation Provided | Yes (code comments and or markdown) |
| Any Dependency Changes? | No |
| License | Apache License, Version 2.0 |
Add fetchpriority attribute support to Image component (v3)
Implements fetchpriority attribute for the Image component to optimize Largest Contentful Paint (LCP) performance.
Changes:
- Added policy-level configuration in design dialog (default fetchpriority + override toggle)
- Added component-level override in edit dialog
- Implemented decision logic: component value overrides policy value (if allowed)
- Added getFetchPriority() method and updated getHtmlAttributes() in Image interface
- Added 5 unit tests covering all scenarios
Usage:
Template authors can set default fetchpriority ("high", "low", "auto") in policies and optionally allow content authors to override per component. Useful for marking hero images as "high" priority to improve LCP.
Fixes #2263
Here is the checkbox to allow the authors to change the fetchpriority attribute:
The fetch priority on the image:
The final result:
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code