A build step was recently added to CodeMirror in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CodeMirror/+/961145.
This is similar to what is done for Extension:Popups, MobileFrontend, among other extensions.
In these extensions, the build step has proved to be a significant hindrance to developers:
- Ensuring the build step is run before each commit
- Making simple rebases impossible without checking out the code and re-building
- Makes almost every patch conflict with every other patch after merging
- Makes backport deployments more complex
- Security concerns with compiling code directly from npm
With RL support for ES6 and packageFiles, these repos are looking to remove their build steps: T315929: Reconsider build step in Popups and MobileFrontend
Due to packaging constraints with CodeMirror 6, we now use Webpack to bundle the files,
CodeMirror provides a CJS distribution which should be compatible with ResourceLoader packageFiles: https://github.com/codemirror/basic-setup
If this isn't feasible, the build step should be limited to as few files as possible, i.e. just the CodeMirror library, so that only library updates result in having the run the rebuild scripts.