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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bnjmnm created an issue. See original summary.

lauriii’s picture

Status: Active » Needs review
FileSize
859 bytes

This 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.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed 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.

  • ckrina committed 567f483 on 9.4.x
    Issue #3251034 by lauriii, bnjmnm, longwave: Core Yarn watch builds CK5...
ckrina’s picture

Status: Reviewed & tested by the community » Fixed

Committed 567f483 and pushed to 9.4.x. Thanks!

ckrina’s picture

The 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 by watch:js-dev one.

lauriii’s picture

Version: 9.4.x-dev » 9.3.x-dev
Status: Fixed » Reviewed & tested by the community

I 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.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

  • catch committed 72d1585 on 9.3.x authored by ckrina
    Issue #3251034 by lauriii, bnjmnm, longwave: Core Yarn watch builds CK5...
catch’s picture

Version: 9.4.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

Went ahead and did the backport here.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.