Problem/Motivation
When CKEditor 5 plugins are built with watch
, it provides more easily debugged versions of the files. That on its own is good! It also performs this rebuild without waiting for the files to change. That's also good on it's own, it makes the build developer-friendly without having to change files to trigger the rebuild
The problem
In core yarn watch
is used for transpiling more than just CKEditor 5. .es6.js and .pcss.css files are transpiled too. Developers working on CSS or non-CKEditor JS are accustomed to having watch take care of their transpiling needs when making changes to core. However, with CKEditor 5 present, yarn watch
will also transpile changed versions several CKEditor5 files
modified: core/modules/ckeditor5/js/build/drupalEmphasis.js
modified: core/modules/ckeditor5/js/build/drupalHtmlEngine.js
modified: core/modules/ckeditor5/js/build/drupalImage.js
modified: core/modules/ckeditor5/js/build/drupalMedia.js
These wind up being added to git staging alongside any expected changes. If the contributor doesn't remember to restore these changes, they wind up part of the MR/patch.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#2 | 3251034-2.patch | 859 bytes | lauriii |
Comments
Comment #2
lauriiiThis is because
yarn watch:ckeditor5
is calling webpack with--mode development
. We don't have explicit configuration for the development mode so I'm not sure what are the exact differences in the built files. However, what I could see that in both cases the files are minified and there aren't source maps so AFAIK this isn't making development more difficult. Here's patch that removes it.Comment #3
longwaveConfirmed locally. Comparing the development output shows that it seems to contain longer variable names and slightly less minified code (lots of whitespace and newlines remain in some kind of debug output), but it's still unreadable as-is, so there seems no benefit in using development mode when watching for changes.
Comment #5
ckrinaCommitted 567f483 and pushed to 9.4.x. Thanks!
Comment #6
ckrinaThe changes makes a lot of sense to solve this issue, and probably if we really want to debug it in the future a command like
watch:ckeditor5-dev
could be created, following the existing pattern set bywatch:js-dev
one.Comment #7
lauriiiI think we would potentially want to backport this to 9.3.x to keep the tooling consistent across the different branches. This is also low risk because this only impacts developer tooling.
Comment #10
catchWent ahead and did the backport here.