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-142878 add events for milo post lcp & milo delayed #2881

Open
wants to merge 10 commits into
base: stage
Choose a base branch
from

Conversation

vhargrave
Copy link
Contributor

@vhargrave vhargrave requested a review from a team as a code owner September 16, 2024 14:28
Copy link
Contributor

aem-code-sync bot commented Sep 16, 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
Contributor

aem-code-sync bot commented Sep 16, 2024

Page Scores Audits Google
📱 /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.24%. Comparing base (264c998) to head (ab52103).
Report is 51 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #2881      +/-   ##
==========================================
+ Coverage   95.89%   96.24%   +0.34%     
==========================================
  Files         173      236      +63     
  Lines       46316    54255    +7939     
==========================================
+ Hits        44415    52218    +7803     
- Misses       1901     2037     +136     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mokimo mokimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not particularly fond of the idea of consumers hooking into the milo rendering pipeline.
This event previously has been removed https://github.com/adobecom/milo/pull/1282/files#diff-28218f239d8d9c4d41e1924854440b50964619e56058fdd0ae243ff5ff6c616dL126 I can imagine with a tight coupling, this would have broken consumer code.

Can you not run your code after loadArea? https://github.com/adobecom/bacom/blob/stage/scripts/scripts.js#L189

Also to add to this postLCP might not really be postLCP. This method might go away or get refactored - from a performance standpoint, we also have the 2nd section popping up as LCP or other elements, currently we have a very late LCP due to congestion shortly after loading the first section. We can migrate the event, but it makes change harder if you have consuming code relying on something that comes from milo core.

libs/scripts/delayed.js Outdated Show resolved Hide resolved
libs/utils/utils.js Outdated Show resolved Hide resolved
@vhargrave
Copy link
Contributor Author

I'm not particularly fond of the idea of consumers hooking into the milo rendering pipeline. This event previously has been removed https://github.com/adobecom/milo/pull/1282/files#diff-28218f239d8d9c4d41e1924854440b50964619e56058fdd0ae243ff5ff6c616dL126 I can imagine with a tight coupling, this would have broken consumer code.

Can you not run your code after loadArea? https://github.com/adobecom/bacom/blob/stage/scripts/scripts.js#L189

Also to add to this postLCP might not really be postLCP. This method might go away or get refactored - from a performance standpoint, we also have the 2nd section popping up as LCP or other elements, currently we have a very late LCP due to congestion shortly after loading the first section. We can migrate the event, but it makes change harder if you have consuming code relying on something that comes from milo core.

Hey @mokimo ,
Especially regarding the load delayed event, no we cannot. We have to execute the code before the google-yolo code on your end runs, and this is the only way to hook ourselves in.
To be honest I also disagree with what you're saying about clients being able to hook themselves in. I think this is actually very useful and allows important things to be done at the right time. Otherwise you're forcing clients as you said to run their code before or after loadArea is called. There are times though, when code must be executed during because it's a long wait in between.
Yes, we can't remove without breaking things, but that's kind of the case with most things in utils no?
I'd conclude by saying that we discussed this with the previous milo core team at the beginning of this migration. -https://wiki.corp.adobe.com/pages/viewpage.action?pageId=3091611394

@aem-code-sync aem-code-sync bot temporarily deployed to vhargrave/MWPW-142878-events September 16, 2024 18:32 Inactive
Copy link
Contributor

@npeltier npeltier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vhargrave @mokimo i think i stand in the middle :) i agree with Victor that giving hooks to consumer is great, but with Okan that running code before some pretty structural milo processes are run might lead to surprises.
another thing: is it something we could do in loadPostLCP to cut event dispatch from main thread with timeout?

libs/utils/utils.js Outdated Show resolved Hide resolved
libs/utils/utils.js Show resolved Hide resolved
@aem-code-sync aem-code-sync bot temporarily deployed to vhargrave/MWPW-142878-events September 17, 2024 13:41 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to vhargrave/MWPW-142878-events September 17, 2024 14:25 Inactive
@vhargrave
Copy link
Contributor Author

For fresh eyes looking at the PR, I've talked with with Okah & Rares and agreed to remove the events and instead add a callback to the google login function due to the concern of keeping these events maintainable.
Maybe we can can come back to the topic of hooks for consumers at some later point in time though.
cc: @mokimo @narcis-radu @npeltier @overmyheadandbody @fullcolorcoder

libs/utils/utils.js Show resolved Hide resolved
libs/features/google-login.js Outdated Show resolved Hide resolved
@aem-code-sync aem-code-sync bot temporarily deployed to vhargrave/MWPW-142878-events September 17, 2024 18:08 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to vhargrave/MWPW-142878-events September 18, 2024 09:44 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to vhargrave/MWPW-142878-events September 18, 2024 09:44 Inactive
@overmyheadandbody
Copy link
Contributor

I've removed the Ready for Stage label, as I didn't see any QA performed for this. We usually get either @SilviuLCF or @NadiiaSokolova involved to test and apply the label. The story is on a different board, so if you have QEs of your own, they can definitely help out, but I want to avoid pushing untested code.

Copy link
Contributor

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

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.

8 participants