-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Load draggable and resizable jquery-ui chunks for dialog widget only if needed #32802
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
Load draggable and resizable jquery-ui chunks for dialog widget only if needed #32802
Conversation
Hi @martasiewierska. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
cc: Hi @martasiewierska Just have a question ? |
@mrtuvn Yes, I pasteed the wrong reference in the documentation, I am sorry. The proper one is: https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/widgets/widget_dialog.html So we have:
The first one is based on dialog.js and is used in minicart, msrp module and checkout sidebar (but is not resizable or draggable there) and the second one is much lighter and used in some other places. I will adjust the description. |
Thank you for response! And great improvements |
Hi @ptylek, thank you for the review. |
@martasiewierska thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Agreed with ptylek |
@magento create issue |
… widget only if needed #32802
Hi @martasiewierska, thank you for your contribution! |
Description (*)
As in our shops we often struggle with huge javascript files, and quite a big amount of unused code, which lowers speed test results, I looked for some opportunity to remove not used code. Magento dropdownDialog widget (docs here: https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/widgets/widget_dialog.html) is based on dialog widget. In dialog widget, there are available options: draggable and resizable, but in dropdown they are set to false and even not mentioned in the documentation or covered in tests. Besides dropdownDialog, dialog widget is also used in inline translation functionality, but this functionality is not used by end-users in the shop.
To decrease the amount of unnecessary code I added dependency only for dialog widget that really needs resizable and draggable jquery-ui chunks.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)
Resolved issues: