Rationale
There are new Less.js v3 capabilities that frontend developers can't yet use in MediaWiki, as they are released between Less.js v2.6 and v3.13. Our Less.php package currently ports Less.js v2.5.
Examples
The below is summarised from https://lesscss.org/functions/, https://lesscss.org/features/, and https://lesscss.org/ (look for text that says "added since" or "released"). As well as https://github.com/less/less.js/blob/v3.13.1/CHANGELOG.md.
- v3.0.0 Added: Support for CSS grid syntax.
- v3.0.0 Changed: calc() exception.
- Ref https://lesscss.org/#operations-calc-exception
- This change is likely important to Codex. A related issue was worked around in change 896197, and is part of what motivated this Less.php upgrade task.
- Ref https://github.com/less/less.js/pull/3163 (3.x merge, change default to strictMath: false).
- Ref https://github.com/less/less.js/pull/3493
- v3.0.0: Added: Support for CSS @property and @layer syntax
- v3.0.0 Added: Logical Functions if() and boolean().
- New functions to use in Less mixin definitions, similar to the when expression functions default(), and(), and or(), which we support already.
- Community interest: https://github.com/wikimedia/less.php/issues/111
- Ref https://lesscss.org/functions/#logical-functions-if, https://lesscss.org/functions/#logical-functions-boolean
- Ref https://github.com/less/less.js/pull/3079
- Ref https://github.com/less/less.js/pull/3532
- v3.7.0 Added: List Functions each().
- v3.8.1 Added: CSS4 color support (#RRGGBBAA syntax and embedding CSS Variables)
- Community interest: https://github.com/wikimedia/less.php/issues/98
- Ref https://github.com/less/less.js/pull/3291
- v3.9.0 Added: List Functions range().
Background
Currently, as of Aug 2021, less.php is supporting 2.5.3, which was released in 2016. In the meantime, there has been a Less.js v3 release and Less.js v4 release, which add various new capabilities (upstream changelog).
The Less spec is quite stable, and most upstream Less.js changes don't require any changes to our less.php to stay comliant (e.g. most change seem to be fixing JS-specific bugs, changing JS-specific features such as eval() or Node.js-based runtime plugins, or deal with JS-specific packaging for npm).
The above list are examples list changes that we do need to port. (This is not an exhaustive list. Full compliance and any fixes for upstream bugs that we copied, will come from passing the upstream test suite. Fixes for upstream bugs can be found in spec commits under https://github.com/less/less.js/commits/v3.13.0/test/less)
Acceptance criteria
- less.php pass the upstream's test suite for Less.js v3.13, enforced by PHPUnit in CI, with a handful of known behaviour differences marked and documented (similar to current 2.5.3 spec differences).