Problem/Motivation

Update to CKEditor 5 v35.1.0 in core when this URL no longer 404s: https://github.com/ckeditor/ckeditor5/releases/tag/v35.1.0 (should be on August 31 per https://github.com/ckeditor/ckeditor5/issues/12107).

35.1.0 will bring fixes for almost all known accessibility problems:

  1. #3283800: [upstream] CKE5 dropdowns keyboard support
  2. #3283801: [upstream] CKE5 dropdown focus handling is not fully accessible
  3. #3283803: [upstream] CKE5 toggleable toolbar items not enough contrast
  4. #3283804: [upstream] CKE5 dropdown screenreader support

— all four of these are stable blockers! See #3238333: Roadmap to CKEditor 5 stable in Drupal 9.

Steps to reproduce

N/A

Proposed resolution

  1. core/package.json
  2. Apply the code review patch for the relevant branch
  3. cd core
  4. yarn install
  5. yarn run vendor-update
  6. yarn run build:ckeditor5
  7. yarn run build:ckeditor5-types

Remaining tasks

  1. Update to 35.1.0
  2. But investigate before then whether Drupal core's CKEditor 5 plugins are affected by API changes, using https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/updating/migra...
  3. Get tests to pass
  4. Review/RTBC
  5. Go relax on a virtual or actual beach

User interface changes

N/A

API changes

None.

Data model changes

None.

Release notes snippet

Drupal core was updated to use CKEditor 5 version 35.1.0.

Issue fork drupal-3306153

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Issue summary: View changes

Oops!

longwave’s picture

Issue tags: -stable blockerDrupal 10 beta blocker +stable blocker, +Drupal 10 beta blocker

Fixing tags.

lauriii’s picture

Assigned: Unassigned » lauriii
Status: Postponed » Active
wim leers’s picture

22 minutes ago: https://github.com/ckeditor/ckeditor5/releases/tag/v35.1.0

EDIT: cross-posted 😄

lauriii’s picture

Status: Active » Needs review
StatusFileSize
new2.54 MB
new1.96 KB

Teasing the bot with a 10.1.x patch first.

The last submitted patch, 6: 3306153-6-10x.patch, failed testing. View results

lauriii’s picture

StatusFileSize
new2.55 MB
new2.55 MB
new2.18 KB
new3.6 KB

This should address the failing test 🤞

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.18 KB
new4.2 KB
  1. 👍 Confirmed to be fixed by accessibility maintainer @bnjmnm:
  2. +++ b/core/modules/ckeditor5/js/ckeditor5_plugins/drupalMedia/src/drupalmediacaption/drupalmediacaptionui.js
    @@ -70,6 +70,7 @@ export default class DrupalMediaCaptionUI extends Plugin {
    +        editor.editing.view.focus();
    

    👍 This is a change that was added for accessibility purposes, to be in line with the (many!) accessibility fixes in the 35.1.0 release.

    Accessibility maintainer @bnjmnm reviewed this together with @lauriii, so … 👍

  3. +++ b/core/modules/ckeditor5/js/ckeditor5_plugins/drupalMedia/src/mediaimagetextalternative/mediaimagetextalternativeediting.js
    @@ -74,10 +74,6 @@ export default class MediaImageTextAlternativeEditing extends Plugin {
    -          const tooltip = new TooltipView();
    -          tooltip.text = message;
    -          tooltip.position = 'sw';
    -
               const html = new Template({
                 tag: 'span',
                 children: [
    @@ -85,9 +81,9 @@ export default class MediaImageTextAlternativeEditing extends Plugin {
    
    @@ -85,9 +81,9 @@ export default class MediaImageTextAlternativeEditing extends Plugin {
                     tag: 'span',
                     attributes: {
                       class: 'drupal-media__metadata-error-icon',
    +                  'data-cke-tooltip-text': message,
                     },
                   },
    -              tooltip,
                 ],
    

    👍 This is matching the upstream change of adopting the new tooltip API: https://github.com/ckeditor/ckeditor5/commit/002c96be1e910aeee4a4b7f0d97... + https://github.com/ckeditor/ckeditor5/commit/89f78f45995a23022207e6bc808....

    The new API: https://github.com/ckeditor/ckeditor5/commit/1acdf50abc397aa5d0b0f1c3e5b....

    To be precise:

    MINOR BREAKING CHANGE (ui): The TooltipView UI component has been removed, please use the new tooltip API instead. Please note that this change does not affect integrations that configure tooltips using ButtonView#tooltip property.
    

    Apparently there is no explicit documentation for this change, because the CKEditor 5 team considers to be a transparent change for 98% of integrators (of which Drupal is one). We're one of the very rare exceptions, because we did use the TooltipView class which now no longer exists. I was pointed to https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/api/module_ui_....

  4. +++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5OffCanvasTest.php
    @@ -42,7 +42,7 @@ public function testOffCanvasStyles() {
    -    $this->assertEquals('rgb(250, 250, 250)', $ckeditor_toolbar_bg_color, 'Toolbar background-color should be unaffected by off-canvas');
    +    $this->assertEquals('rgb(255, 255, 255)', $ckeditor_toolbar_bg_color, 'Toolbar background-color should be unaffected by off-canvas');
    

    👍 This is an upstream change, to improve contrast.

    Before
    After
  5. 🥳 And of course, the very thorough test suite still passes!
wim leers’s picture

Update for #9.3: they're now working to expand their "migration guide" (to migrate/upgrade to 35.1.0), see https://github.com/ckeditor/ckeditor5/pull/12385/files. That confirms the changes made here! 👍

(Please credit @oleq for making that happen upstream!)

lauriii credited bnjmnm.

lauriii’s picture

Adding credit for @bnjmnm for pairing on this with me.

xjm’s picture

+++ b/core/package.json
@@ -39,28 +39,28 @@
+    "@ckeditor/ckeditor5-dev-utils": "~30.4.0",

Why does this have a weird constraint?

lauriii’s picture

Why does this have a weird constraint?

@xjm clarified on Slack that she meant to ask why is the version constraint different from the rest of the CKEditor 5 packages. The @ckeditor/ckeditor5-dev-utils package is not part of the same monorepo with the rest of the packages. See that it's hosted here: https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5.... For that reason its release cadence is disjointed with the rest of the packages. If you check https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-utils, you can see that it's pinned to the latest minor of that package, and that it's not a mistake. 😊

xjm’s picture

Issue summary: View changes

Adding to the STR -- one needs to apply the media fixes before rebuilding the assets. :)

  • xjm committed 45904f2 on 10.1.x
    Issue #3306153 by lauriii, Wim Leers, bnjmnm: Update CKEditor 5 to 35.1....

  • xjm committed 0b83868 on 10.0.x
    Issue #3306153 by lauriii, Wim Leers, bnjmnm: Update CKEditor 5 to 35.1....
xjm’s picture

  1. Reviewed the fixes for the update.
  2. Confirmed that I get the same build for the D10 patch.
  3. Double-checked unminified module assets in both HEAD and the patch. Confirmed what @lauriii said:

    Also, I already confirmed that there aren’t any direct changes to our compiled code as a result of the update
    all of the changes in the built code are coming from the changes we needed to make in our code
    (that’s why there’s no diff for the minified code)

Looks great. Committed to 10.1.x and cherry-picked to 10.0.x. Will be back to review the 9.5.x patch in a bit.

  • xjm committed 74c6519 on 9.5.x
    Issue #3306153 by lauriii, Wim Leers, xjm, bnjmnm: Update CKEditor 5 to...
xjm’s picture

Version: 9.5.x-dev » 9.4.x-dev
Assigned: lauriii » Unassigned
Status: Reviewed & tested by the community » Needs work
Issue tags: +9.4.6 release notes

Repeated #18 for the 9.5.x patch and committed there too.

Let's also backport this to 9.4.x prior to 9.4.6 next week. (If/when we do that, it will actually not go in the beta1 release notes, since we're doing those as an overview of all changes from 9.4.x rather than since the last alpha.)

lauriii’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new2.55 MB

Moving to RTBC since this is essentially same patch as the one for 9.5.x because we have kept 9.4.x CKEditor 5 mostly in sync with 9.5.x.

wim leers’s picture

StatusFileSize
new6.46 KB

Doing

curl -O https://www.drupal.org/files/issues/2022-08-31/3306153-8-95x.patch
curl -O https://www.drupal.org/files/issues/2022-09-01/3306153-21-94x.patch
diff 3306153-8-95x.patch 3306153-21-94x.patch

yields a tiny diff, which shows that it's only the context in core/package.json that is slightly different (see output attached).

This is confirmed by doing git diff origin/9.4.x origin/9.5.x -- core/package.json — or rather by using the latest 9.4.x and the 9.5.x just prior to the above commit: git diff f20c0a2030cb19bafa2f54d7e5da8c75459410fd 74c6519^ -- core/package.json, which outputs:

diff --git a/core/package.json b/core/package.json
index 950c9da8e0..81d9d34910 100644
--- a/core/package.json
+++ b/core/package.json
@@ -70,8 +70,7 @@
     "chromedriver": "^98.0.1",
     "ckeditor5": "35.0.x",
     "cross-env": "^7.0.2",
-    "cross-env": "^7.0.2",
-    "cspell": "^5.0.0",
+    "cspell": "^6.0.0",
     "css.escape": "1.5.x",
     "dotenv-safe": "^8.2.0",
     "es6-promise": "4.2.x",

IOW the 9.4.x patch in #21 is perfect! 💯

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.4.x, thanks!

Status: Fixed » Closed (fixed)

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