You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Detect LCP images after soft navigations in NgOptimizedImage #71812
Which @angular/* package(s) are relevant/related to the feature request?
common
Description
NgOptimizedImage warns during development when an LCP image is not marked as priority. I think it would be useful to extend this diagnostic to soft navigations, so it also covers images displayed after navigating between routes without reloading the page.
e.g navigating from a product list to a product detail page can introduce a different LCP image.
Developers should receive the same missing-priority warning when the browser identifies that image as the LCP of the soft navigation.
Proposed solution
Extend LCPImageObserver to observe soft-navigation and interaction-contentful-paint entries when supported, associating them through interactionId.
Only paints associated with a detected soft navigation should trigger this diagnostic. An unrelated interaction that displays another large image should not be treated as a new navigation.
Keep the existing initial-page-load observation and use feature detection so browsers without these entry types continue to work as they do today.
Alternatives considered
I previously opened #69963 if someone can take care of it or suggest an better alternative
Activity