-
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
Fixed js dependencies in the blank theme #10916
Conversation
@orlangur done, missed that point, thank you. |
Despite the fact that this PR is a backport of #8982 after discovering the content of The problem is that JS files operate with HTML nodes introduced by not a @rogyar Let us know are you interested to continue work on this issue according to the described goal or this task should be moved to Up for Grabs board. |
@vkublytskyi the main purpose of this PR was to fix the issue using the same (or similar) approach as it used in the core at the moment. That's why the architecture changes are not taken into account here. So, changing the approach is more like another PR with the architecture improvements purpose but not a bugfix. if ($('body').hasClass('checkout-cart-index')) {
if ($('#co-shipping-method-form .fieldset.rates').length > 0 &&
$('#co-shipping-method-form .fieldset.rates :checked').length === 0
) {
$('#block-shipping').on('collapsiblecreate', function () {
$('#block-shipping').collapsible('forceActivate');
});
}
} could be placed into a new JS file located in the Magento_Checkout theme module. In the same way, the JS logic that is responsible for product additional information could be placed in the Magento_Catalog theme module. What do you think? Thank you. |
@rogyar, sorry for the delay with response. Proposed changes look relevant. We are trying to treat JS modules as public API so moving them is a backward incompatible change. That's why it's better to do this change in one PR. |
Hi @rogyar. Are you going to continue work on this PR? |
Hi @rogyar |
Description
There's an issue with creating a new theme that does not have
blank
theme in the fallback. The RequireJs is looking for the following dependencies:in the theme's web directory. The mentioned JS files are present in the
blank
theme but not in the newly created theme. As result, RequireJs throwing a couple of errors and JS logic can be broken on some pages (checkout) because of that.The fix moves the dependencies from the global theme scope to the
Magento_Theme
RequireJS config of theblank
theme. In that way, theblank
theme still have the mentioned dependencies. But a clean theme withoutblank
theme in the fallback will not request these dependencies.The similar approach is used for further Magento versions in the
develop
branch.Fixed Issues
Manual testing scenarios
Current behaviour
Fixed behaviour