Project Information
- Name of project: mck89/peast
- Project home page:
- Name of team requesting review: MediaWiki-Platform-Team
- Primary contact: @Krinkle
- Target date for deployment:
- Link to source code: https://gerrit.wikimedia.org/r/c/mediawiki/vendor/+/959373
- Link to scc output for general sizing of codebases (https://github.com/boyter/scc):
peast$ git l -1 * 982271d99d - (HEAD, origin/HEAD) Fixed parsing of async keyword as class method (2023-08-16) <Marco Marchiò> peast$ scc doc/ lib/ ─────────────────────────────────────────────────────────────────────────────── Language Files Lines Blanks Comments Code Complexity ─────────────────────────────────────────────────────────────────────────────── PHP 151 20940 1670 8887 10383 1184 Markdown 5 623 105 0 518 0 ─────────────────────────────────────────────────────────────────────────────── Total 156 21563 1775 8887 10901 1184 ─────────────────────────────────────────────────────────────────────────────── Estimated Cost to Develop (organic) $331,844 Estimated Schedule Effort (organic) 9.04 months Estimated People Required (organic) 3.26 ─────────────────────────────────────────────────────────────────────────────── Processed 575240 bytes, 0.575 megabytes (SI) ───────────────────────────────────────────────────────────────────────────────
Description of the tool/project: Tokenizer and validator of JavaScript syntax.
Description of how the tool will be used at WMF:
In ResourceLoader as part of MediaWiki core, to determine the structural integrity of site scripts (like MediaWiki:Common.js) and gadgets (like MediaWiki:Gadget-foo.js) before minifying and concatenating them with other scripts. This prevents deployment of syntax errors, and ensures consistent browser support (i.e. only deploy code that is known-compatible with all browsers this payload is cached for and delivered to).
The status quo is that integrity check is carried out by calling JsMinPlus.php, which is a library checked into mediawiki/core.git/:/includes/libs/, predating use of Composer and mediawiki/vendor. There are three main problems with this library:
- The last upstream release was more than ten years ago in 2011.
- Upstream homepage and contact no longer online. Unofficial mirrors preserve copies of the code, but are equally inactive/frozen, e.g. https://github.com/JSMinPlus/JSMinPlus/blob/master/changelog.txt.
- JsMinPlus validates the ES5 specification for JavaScript code. ResourceLoader supports ES6 ("ES2015") and ES7 ("ES2016") code as of T272882: Upgrade ResourceLoader JS minifier to support ES6, T178356, and T277675. MediaWiki core and extension already make use of these capabilities. However, user scripts and gadgets are unable to use these capabilities as the validator considers the unknown/modern syntax as invalid.
The replacement of this internal dependency thus blocks the resolution of these two goals:
- T75714: Update JavaScript syntax checker for gadgets and user-scripts for ES6 and later
- T313945: [EPIC] Enable gadget and user-script developers to use Vue and Codex
Dependencies: None! ✔️
Has this project been reviewed before? No.
Working test environment:
- MediaWiki vendor patch for auditing: https://gerrit.wikimedia.org/r/c/mediawiki/vendor/+/959373
- MediaWiki core patch to replace JSMinPlus with Peast: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/962739
- MediaWiki core patch that removes JSMinPlus: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/962740
Post-deployment:
Primary contact for this dependency's listing at https://www.mediawiki.org/wiki/Upstream_projects will be MediaWiki-Platform-Team (@Krinkle).