-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix issue disabled modules still include less #31593
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
Fix issue disabled modules still include less #31593
Conversation
Hi @mrtuvn. 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 |
Old PR link for anyone can reference #27888 |
Just moved all labels from #27888 |
@magento run Functional Tests B2B, Functional Tests CE |
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.
✔ Approved.
Failing tests looks not related to changes form this PR.
@magento run Functional Tests B2B |
5cf97c9
to
0ee8197
Compare
Rebased 2.5-develop upstream |
@magento run all tests |
Hi guys any update on this ? |
Hi @ihor-sviziev, thank you for the review. |
Is there any progress here? Would be nice if this could get included in Magento 2.5 since it could drastically reduce the filesize of generated css in Magento |
I think this one may take a long time delivery to codebase. Quite long response from internal Meanwhile we have 2 options workaround here both affect/modify to framework area
I'm sure may still have room for a better fix Should we update for this priority to P2 ? Without workarounds i think this behavior will affect to all merchants stores |
Hi @mrtuvn, thank you for your contribution! |
@ihor-sviziev : during Magento Live in 2019 in Amsterdam, me and some buddies discussed this during the contribution day with core Magento devs and they told us that it was better to implement it this way using decorators in xml files. See #25183 (comment) Just FYI Frankly I don't mind how it gets implemented, as long as the end result is the same. |
@hostep, yeah, remember that, but still, it's better to use the KISS principle here. It will be way clearer how it works, so easier for maintaining and less potential to have some regression there. |
This one still better implements imho. But maybe should have more additional such as this comment #32922 (comment) |
Description (*)
Retarget my old PR to new branch
This PR bring the patch for fix issue modules disabled still include less files. It's should not included in output final style files. Previously styles still included in output final css styles
Use case 1: Disable module example Company_CustomCatalog in app/etc/config.php. But assume accidental add module styles in theme folder in
app/design/frontend/theme/theme_name/Company_CustomCatalog/web/css/source/_module.less
app/code/Company/CustomModule/web/css/source/_module.less
Actually after run deploy output css magento still included Company_CustomCatalog styles in file styles-m.css in pub folder
Previously magento collect files get all files less from web dir theme follow dependency but not check files belong modules enabled or not. So some files from inactive modules (file _module.less) from theme folders still be included. That's is what we don't want in real use-case world
After patch files get correctly. If module has disabled both styles from web module area and theme area will not included
Related Pull Requests
Fixed Issues (if relevant)
Keep continue works by @Echron after long inactivity
Manual testing scenarios (*)
Questions or comments
For this pr seem will take quite long period for acceptance and delivery to 2.5 branch. In the meantime we can use this patch
https://github.com/vasilii-b/magento2-frontend-improvements/blob/master/patches/composer/magento-framework/import-styles-for-enabled-modules-only.patch. for issue
Use this with your own risk! (not official patch from magento) ( but it's works)
Contribution checklist (*)