-
Notifications
You must be signed in to change notification settings - Fork 163
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
base: stage
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
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. |
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.
looks good to me :) may be some more talkative commit message would be great :)
@@ -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'; |
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.
Is this needed? This is also being imported in L427
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.
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'; |
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 think line and next one is not needed anymore.
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.
After remove those, how do you want to define commerceLib.init()
from next line?
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.
moving it to line 5 should work no?
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.
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
.
Are you saying I should just put const commerceLib = await import('../../deps/mas/commerce.js');
on top instead import '../../deps/mas/commerce.js';
?
@seanchoi-dev the following test should be removed.
|
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.
will block to prevent accidental merge until the test is fixed and comments are resolved.
I removed it. |
Resolves: MWPW-157555
Test URLs: