-
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
MWPW-142435 -Fix for fetching the correct LCP #176
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
|
@@ -59,21 +59,22 @@ function getDecorateAreaFn() { | |||
}; | |||
|
|||
async function loadLCPImage(area = document, { fragmentLink = null } = {}) { | |||
const firstBlock = area.querySelector('body > main > div > div'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ruchika4 In Milo also, the first div is getting selected : const firstDiv = document.querySelector('body > main > div:nth-child(1) > div');
Does this change need to go in Milo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this @salonijain3 . However as most of our pages will breadcrumb as first div we'll not be able to load the LCP eagerly if we look for first div to be marquee.
@Ruchika4 , what's the status on this? LCP is pretty important so merging this in would be great. |
Hi @honstar , I am waiting for approvals. However recently team has suggested authors to move breadcrumbs down and not be the first block for other performance reasons. We did this code update initially because the code was looking for first div for LCP which was breadcrumbs. cc @salonijain3 @aishwaryamathuria |
Closing this @Ruchika4 as it seems stale. Can you reopen this if this is still needed? |
Resolves: MWPW-142435
Test URLs:
Note: this is interim fix to make sure we load the correct LCP image for performance improvement. loadLCPImage function needs more optimizations
Need to work with team to discuss all the checks we have added for loadLCPImage and optimize more