-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
fixes requireJS mixins racecondition with require calls in dom #39097
base: 2.4-develop
Are you sure you want to change the base?
Conversation
… loads before dom parse
…bapiui jquery-mixin load before require calls in dom
Hi @AndresInSpace. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento give me test instance
…On Thu, Aug 22, 2024, 10:16 PM m2-assistant[bot] ***@***.***> wrote:
Hi @AndresInSpace <https://github.com/AndresInSpace>. Thank you for your
contribution!
Here are some useful tips on how you can test your changes using Magento
test environment.
Add the comment under your pull request to deploy test or vanilla Magento
instance:
- @magento give me test instance - deploy test instance based on PR
changes
- @magento give me 2.4-develop instance - deploy vanilla Magento
instance
❗ Automated tests can be triggered manually with an appropriate comment:
- @magento run all tests - run or re-run all required tests against
the PR changes
- @magento run <test-build(s)> - run or re-run specific test build(s)
For example: @magento run Unit Tests
<test-build(s)> is a comma-separated list of build names.
Allowed build names are:
1. Database Compare
2. Functional Tests CE
3. Functional Tests EE
4. Functional Tests B2B
5. Integration Tests
6. Magento Health Index
7. Sample Data Tests CE
8. Sample Data Tests EE
9. Sample Data Tests B2B
10. Static Tests
11. Unit Tests
12. WebAPI Tests
13. Semantic Version Checker
You can find more information about the builds here
<https://github.com/magento/magento2/wiki/Magento-Automated-Testing>
ℹ️ Run only required test builds during development. Run all test builds
before sending your pull request for review.
------------------------------
For more details, review the Code Contributions
<https://developer.adobe.com/commerce/contributor/guides/code-contributions/>
documentation.
Join Magento Community Engineering Slack
<https://developer.adobe.com/open/magento/slack> and ask your questions
in #github <https://magentocommeng.slack.com/messages/C7KB93M32> channel.
—
Reply to this email directly, view it on GitHub
<#39097 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNQ47QTMLXF2NWF4BSYBDDZS2LQDAVCNFSM6AAAAABM7IWNX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWGA2TSMJTGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @AndresInSpace. Thank you for your request. I'm working on Magento instance for you. |
Hi @AndresInSpace, here is your Magento Instance: https://0a05fa17a7983d4b098002b067de8a5d.instances-prod.magento-community.engineering |
@magento give me 2.4-develop instance |
Hi @AndresInSpace. Thank you for your request. I'm working on Magento instance for you. |
Hi @AndresInSpace, here is your Magento Instance: https://45243a10eb203fde7e8eedf63293cfe1.instances-prod.magento-community.engineering |
@magento run all tests |
@magento give me test instance |
Hi @AndresInSpace. Thank you for your request. I'm working on Magento instance for you. |
Hi @AndresInSpace, here is your Magento Instance: https://0a05fa17a7983d4b098002b067de8a5d.instances-prod.magento-community.engineering |
@magento give me test instance |
Hi @AndresInSpace. Thank you for your request. I'm working on Magento instance for you. |
Hi @AndresInSpace, here is your Magento Instance: https://0a05fa17a7983d4b098002b067de8a5d.instances-prod.magento-community.engineering |
@magento give me 2.4-develop instance |
Hi @AndresInSpace. Thank you for your request. I'm working on Magento instance for you. |
Hi @AndresInSpace, here is your Magento Instance: https://45243a10eb203fde7e8eedf63293cfe1.instances-prod.magento-community.engineering |
@magento give me 2.4-develop instance |
Hi @AndresInSpace. Thank you for your request. I'm working on Magento instance for you. |
@magento give me test instance |
Hi @AndresInSpace. Thank you for your request. I'm working on Magento instance for you. |
Hi @AndresInSpace, here is your Magento Instance: https://45243a10eb203fde7e8eedf63293cfe1.instances-prod.magento-community.engineering |
Hi @AndresInSpace, here is your Magento Instance: https://0a05fa17a7983d4b098002b067de8a5d.instances-prod.magento-community.engineering |
based on acceptance of requirejs/requirejs/pull/1859 removes nextTick cause of race condition
@magento give me 2.4.7 instance with extensions adyen/module-payment:9.5.3 |
Hi everyone, any ideas of when this will be merged? We've been suffering lately due to this with the page builder module and generally mixins not always loading preventing saving cms blocks and pages. Applying this patch temporarily seems to solve the issues. |
@Den4ik you self-requested a review 2 months ago -- is there anything left to be reviewed to push this fix forward? Thank you. |
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.
Hi @AndresInSpace
Could you please resolve merge conflict
Description (*)
Fixes the race condition with DOM require calls parsing before
require(['mixins'],{...});
replacing require function.Resolves mixins not applying.
Ensures jquery-mixin from security https://github.com/magento/security-package/blob/develop/ReCaptchaWebapiUi/view/frontend/requirejs-config.js#L10 is mixed in before jquery called
How to Confirm You Have This Issue:
add to custom block output in top of page of cart closest to body opening tag, visit empty cart page
/checkout/cart/index
context should be from wrapper (mixin applied) not from customer-data (mixin not applied)
Original Process:
requirejs makeRequire calls nexTick (setTimeout) freeing thread to parse DOM
requirejs/mixins.js loads and define call is made
DOM require calls race condition - if calls happen require context is from requirejs/require.js and not mixins.js
requirejs/mixins.js require fired and now instantiating and replacing require call context to mixins.js
Changes:
Moves requirejs-config.js before mixins.js ensures configurations are loaded
Remove context.nextTick wrap from makeRequire return localRequire function (this was freeing thread to DOM) **
Remove redundant intakeDefines();
Move require calls out of require-configs. Only one is for jquery no conflict. Remove from https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Theme/view/base/requirejs-config.js#L87 and move to end of
require(['mixins], function(..) { ... {beforeClosingtag} });
ensures mixin replaces require function so jquery-mixin is properly applied**
checkLoaded()
has all the setTimeout functionality we needmagento2/lib/web/requirejs/require.js
Line 717 in 9124539
See more information in my comment on the issue this PR should fix below.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
See the above issue for steps to reproduce mixins not loading issue caused from this race condition
additionally can
Questions or comments
Contribution checklist (*)