Background
The FY25'26 annual plan PES1.4 KR (Codex adoption increase) seeks to achieve the following:
"By the end of Q4, we'll see a 10% adoption rate increase for Codex among P&T teams."
One of the main projects under this effort is releasing a 1.0 version of Codex PHP.
@Catrope is the primary engineer in this effort, however, he needs code-review support to realize this project.
Since the Reader Experience team has some responsibility towards maintaining the Codex library, and, the Codex PHP project is uniquely valuable to the skin ecosystem, the team should be involved in providing code-review for this code.
Requirements
Provide code review for the following patches related to Codex PHP
- Introduce new API with named parameters and magic toString
- Convert sandbox and tests to new API
- Update various examples and tests (lower priority)
- HtmlSnippet: Add backwards compatibility for the old API
- Button: Remove ariaLabel and ariaLabelKey vars (lower priority)
- Merge IRenderer and AttributeResolver into Renderer
- CardRenderer: Fix double escaping, remove unused Thumbnail template var (lower priority)
- Pager: Remove double cdx-select class from dropdowns (lower priority)
- TextArea: Rename setTextAreaAttributes to setInputAttributes
i18n specifics
- Remove i18n Mustache helper
- MediaWikiLocalization: Accept MessageLocalizer instead of RequestContext
- Allow a localizer to be passed into the Codex constructor
The rest of the patches are not included in the task, and we can ask Roan to remove the lower priority patches from the chain if needed.
Acceptance criteria for done
Requirements
Provide code review for the following patches related to Codex PHP
- Introduce new API with named parameters and magic toString
- Convert sandbox and tests to new API
- Update various examples and tests (lower priority)
- HtmlSnippet: Add backwards compatibility for the old API
- Button: Remove ariaLabel and ariaLabelKey vars (lower priority)
- Merge IRenderer and AttributeResolver into Renderer
- CardRenderer: Fix double escaping, remove unused Thumbnail template var (lower priority)
- Pager: Remove double cdx-select class from dropdowns (lower priority)
- TextArea: Rename setTextAreaAttributes to setInputAttributes
i18n specifics
- Remove i18n Mustache helper
- MediaWikiLocalization: Accept MessageLocalizer instead of RequestContext
- Allow a localizer to be passed into the Codex constructor
Also fix shortcomings while there:
- Failing phan tests – fixed as part of a Outreachy volunteer patch same time
- Enforcing PHP 8.1+ multiline trailing comma requirement by help of phpcs for better developer experience and consistency throughout codebase