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-157555: Remove useless logic and putting import commerce.js top. #2906

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

Conversation

Copy link
Contributor

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

@seanchoi-dev seanchoi-dev added the run-nala Run Nala Test Automation against PR label Sep 18, 2024
Copy link

codecov bot commented Sep 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.21%. Comparing base (54c3cc0) to head (50b29d8).
Report is 33 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #2906      +/-   ##
==========================================
+ Coverage   96.24%   98.21%   +1.97%     
==========================================
  Files         236       67     -169     
  Lines       54233     8074   -46159     
==========================================
- Hits        52196     7930   -44266     
+ Misses       2037      144    -1893     

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

@seanchoi-dev seanchoi-dev marked this pull request as ready for review September 18, 2024 22:56
@seanchoi-dev seanchoi-dev requested a review from a team as a code owner September 18, 2024 22:56
@seanchoi-dev seanchoi-dev marked this pull request as draft September 18, 2024 22:57
@seanchoi-dev seanchoi-dev marked this pull request as ready for review September 18, 2024 23:01
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.

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.

looks good to me :) may be some more talkative commit message would be great :)

@seanchoi-dev seanchoi-dev changed the title Mwpw 157555 [Mwpw 157555] Remove useless logic and putting import commerce.js top. Sep 19, 2024
@seanchoi-dev seanchoi-dev changed the title [Mwpw 157555] Remove useless logic and putting import commerce.js top. MWPW 157555: Remove useless logic and putting import commerce.js top. Sep 19, 2024
@seanchoi-dev seanchoi-dev changed the title MWPW 157555: Remove useless logic and putting import commerce.js top. MWPW-157555: Remove useless logic and putting import commerce.js top. Sep 19, 2024
@@ -2,6 +2,7 @@ import {
createTag, getConfig, loadArea, loadScript, loadStyle, localizeLink,
} from '../../utils/utils.js';
import { replaceKey } from '../../features/placeholders.js';
import '../../deps/mas/commerce.js';
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed? This is also being imported in L427

Copy link
Contributor Author

@seanchoi-dev seanchoi-dev Sep 25, 2024

Choose a reason for hiding this comment

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

Yes, we want to start to load this ASAP when merch.js get loaded.
This is what task's description says:
"Remove the related logic and move import of commerce.js to the top."

commerceLibPath = `${getMasBase(hostname, maslibs)}/libs/commerce.js`;
}
}
const commerceLibPath = '../../deps/mas/commerce.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think line and next one is not needed anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After remove those, how do you want to define commerceLib.init() from next line?

Copy link
Contributor

Choose a reason for hiding this comment

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

moving it to line 5 should work no?

Copy link
Contributor Author

@seanchoi-dev seanchoi-dev Sep 26, 2024

Choose a reason for hiding this comment

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

Maybe I am not getting it but, my question is,

The function scope goes like initService() -> initService.promise.then() -> commerceLib.init().
And the commerceLib is defined relying on importing ('../../deps/mas/commerce.js')
I am not sure how we want to define commerceLib.
image

Are you saying I should just put const commerceLib = await import('../../deps/mas/commerce.js'); on top instead import '../../deps/mas/commerce.js'; ?

@yesil
Copy link
Contributor

yesil commented Sep 26, 2024

@seanchoi-dev the following test should be removed.

Merch Block > M@S consumption > maslibs parameter > should load commerce.js via maslibs, it is failing.

Copy link
Contributor

@yesil yesil left a comment

Choose a reason for hiding this comment

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

will block to prevent accidental merge until the test is fixed and comments are resolved.

@seanchoi-dev
Copy link
Contributor Author

@seanchoi-dev the following test should be removed.

Merch Block > M@S consumption > maslibs parameter > should load commerce.js via maslibs, it is failing.

I removed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commerce run-nala Run Nala Test Automation against PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants