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-158142 [MEP] check for MEP placeholders as fragmentless content is inserted #2919

Merged
merged 10 commits into from
Sep 19, 2024

Conversation

AdobeLinhart
Copy link
Contributor

Now that MEP supports fragmentless content, people are going to use MEP placeholders more. To prevent the performance hit of using placeholders in section 1, we should update content as we insert it.

Inside the function called "createContent" there is an if statement that triggers when when the new content is not a fragment. If you run getConfig() there is a node called placeholders if there were MEP specific placeholders. I want to check the content string for placeholders and if they exist check the MEP placholders to do a replace before replace or insertion.

Resolves: MWPW-158142

QA Instructions: Load the before and after links and check the performance tab in dev tools for when placeholders.json is downloaded. In the before link it is before LCP, in the after link it is after.

Test URLs:

@AdobeLinhart AdobeLinhart requested a review from a team as a code owner September 19, 2024 17:25
Copy link
Contributor

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

@AdobeLinhart AdobeLinhart requested a review from a team September 19, 2024 17:26
Copy link
Contributor

aem-code-sync bot commented Sep 19, 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 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.24%. Comparing base (71416c8) to head (2e917ad).
Report is 1 commits behind head on mepnestedplaceholders.

Additional details and impacted files
@@                  Coverage Diff                   @@
##           mepnestedplaceholders    #2919   +/-   ##
======================================================
  Coverage                  96.24%   96.24%           
======================================================
  Files                        236      236           
  Lines                      54273    54278    +5     
======================================================
+ Hits                       52236    52241    +5     
  Misses                      2037     2037           

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

@aem-code-sync aem-code-sync bot temporarily deployed to placeholderperformance September 19, 2024 17:56 Inactive
@denlight
Copy link
Contributor

denlight commented Sep 19, 2024

Looks good. Just needs some love to make ESlint happy and to make sure new code is tested. @AdobeLinhart

Copy link
Contributor

@JasonHowellSlavin JasonHowellSlavin left a comment

Choose a reason for hiding this comment

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

Looks good. Any unit tests to update?

@aem-code-sync aem-code-sync bot temporarily deployed to placeholderperformance September 19, 2024 18:09 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to placeholderperformance September 19, 2024 18:15 Inactive
@AdobeLinhart
Copy link
Contributor Author

Linting should be fixed.

@JasonHowellSlavin This utilizes a reusable function that's also part of one of Viv's branches. The unit test is the same (parseNestedPlaceholders.test).

@markpadbe markpadbe requested a review from a team September 19, 2024 19:05
@vgoodric vgoodric merged commit 130b5e0 into mepnestedplaceholders Sep 19, 2024
12 of 13 checks passed
@vgoodric vgoodric deleted the placeholderperformance branch September 19, 2024 19:11
milo-pr-merge bot pushed a commit that referenced this pull request Sep 19, 2024
* MWPW-158674 [MEP] Support nested placholders in MEP placeholders

* unit test

* move match functionality to reusable function

* add default value for info in getManifestConfig declaration

* MWPW-158142 [MEP] check for MEP placeholders as fragmentless content is inserted (#2919)

* Initial checkin. Working state.

* Code refactor.

* Unit test initial checkin.

* Refactor into reusable function.

* Removed old code.

* Linting.

* update unit test to call create content

---------

Co-authored-by: vgoodric <[email protected]>

---------

Co-authored-by: Dave Linhart <[email protected]>
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.

5 participants