[Issue] Put division calculations in less files in parentheses if they were not there alr… #38351
Closed
2 of 5 tasks
Labels
Area: UI Framework
Component: Frontend
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: ready for confirmation
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: done
Reported on 2.4.x
Indicates original Magento version for the Issue report.
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
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: #38335: Put division calculations in less files in parentheses if they were not there alr…
…eady, this fixes generating correct css again after the upgrade to less.js v4 in AC-8098 & AC-9713.
Description (*)
This PR comes from discussion in #38109 (comment), just some notes:
v4 of the less.js library is not backwards compatible with v3, all division calculations should be put in parentheses now.
I've only tested with Magento Open Source, it's likely that more changes will be needed for Magento Commerce and B2B (and whatever other products are out there)
I currently forgot to look into all the other modules that aren't included in this core Magento one, like pagebuilder, MSI, security-package, ... Those might need work as well...Update: only pagebuilder was affected, I created PR 860 on the magento2-page-builder repo to fix it thereUpdate 2: it turns out this wasn't need, so all is good here
I've tested this with the 3 themes included in Magento Opensource: Magento/blank, Magento/luma & Magento/backend, I know that Magento Commerce comes with a 4th theme as well and maybe there are more themes in the other products, I have no idea, so all should be tested
Update: I've also tested
bin/magento setup:static-content:deploy
(which uses a different less compiler) and compared the compiled css before these changes and after these changes and could see no differences, which is good 👍About the flagstrictMath
that was changed indev/tools/grunt/configs/less.js
, my idea was that this would highlight problematic code faster to custom theme developers, but from working on this PR, it only detects a very little amount of problems, so not sure if this is a good idea or notUpdate: this wasn't a good idea, this has been reverted now
The change inlib/web/css/source/lib/_utilities.less
to@{_property}: (@_value);
was a quick way to fix a bunch of different issues at the same time, not sure if that's the best way, also not sure if still needed, this was one of my first fixes, and I didn't want to re-test after all the hours I already spent on thisUpdate: I've removed this fix, and fixed the root causes instead
The majority of failing static tests are bugs in the coding standards (example 1, example 2, the other ones haven't been reported yet I think) and in my opinion we shouldn't fix those in this scope of this PR. And the PR should be approved even with those failing.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
package.json.sample
file, in the other copy, downgrade it back to version v3, like this:*.css
files inpub/static
from both copies. The output should be identical.bin/magento setup:static-content:deploy
and compare the compiled css before these changes and after these changes and see that there are no differencesContribution checklist (*)
The text was updated successfully, but these errors were encountered: