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

MWPW-142435 -Fix for fetching the correct LCP #176

Closed
wants to merge 8 commits into from
Closed

MWPW-142435 -Fix for fetching the correct LCP #176

wants to merge 8 commits into from

Conversation

Ruchika4
Copy link
Contributor

@Ruchika4 Ruchika4 commented Feb 8, 2024

  • Fix for fetching the correct LCP

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

Copy link

aem-code-sync bot commented Feb 8, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link

aem-code-sync bot commented Feb 8, 2024

@Ruchika4 Ruchika4 marked this pull request as ready for review February 9, 2024 16:21
@@ -59,21 +59,22 @@ function getDecorateAreaFn() {
};

async function loadLCPImage(area = document, { fragmentLink = null } = {}) {
const firstBlock = area.querySelector('body > main > div > div');
Copy link
Collaborator

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?

Copy link
Contributor Author

@Ruchika4 Ruchika4 Feb 21, 2024

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.

@honstar
Copy link
Contributor

honstar commented Mar 11, 2024

@Ruchika4 , what's the status on this? LCP is pretty important so merging this in would be great.

@Ruchika4
Copy link
Contributor Author

@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

@salonijain3
Copy link
Collaborator

Closing this @Ruchika4 as it seems stale. Can you reopen this if this is still needed?

@Ruchika4 Ruchika4 deleted the lcp branch October 17, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants