[Issue] Load color picker dependencies only when it is actually used #28477
Labels
Component: Ui
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: PR in progress
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Severity: S3
Affects non-critical data or functionality and does not force users to employ a workaround.
Triage: Dev.Experience
Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
This issue is automatically created based on existing pull request: #28400: Load color picker dependencies only when it is actually used
Preconditions (*)
This is just another performance PR, which focuses on loading only the needed dependencies. This time I am optimizing color picker component and its
spectrum
andtinycolor
dependencies.Loading mentioned modules dynamically saves us 2 JavaScript requests and 123,6kB (28,3kB gzipped) from downloading and parsing.
This change is covered by unit tests that had to be adjusted to take asynchronous dependencies loading into account.
Steps to reproduce (*)
spectrum.js
andtinycolor.js
are no longer loaded by default.Actual Result: ✖️
spectrum.js
andtinycolor.js
are loaded by defaultExpected Result: ✔️
spectrum.js
andtinycolor.js
should no loaded by default.Questions or comments
While making sure this change doesn't break anything I found out that
colorPicker
binding is not used anywhere in Magento. The easiest way to get it is to for example add it toapp/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml
:and test it in category edit form.
Contribution checklist (*)
The text was updated successfully, but these errors were encountered: