Skip to content

Bump CKEditor to 48.0#111

Merged
oliverguenther merged 2 commits intomasterfrom
feat/v48
Apr 27, 2026
Merged

Bump CKEditor to 48.0#111
oliverguenther merged 2 commits intomasterfrom
feat/v48

Conversation

@oliverguenther
Copy link
Copy Markdown
Member

@oliverguenther oliverguenther commented Apr 20, 2026

  • Upgraded CKEditor 44.3.x to 48.0.0
  • migrated away from removed/deprecated CKEditor internal references
  • added generated artifacts for OpenProject compatibility (translations/*.js + ckeditor.css) since that is no longer provided in the build itself

Core PR: opf/openproject#22837
Ticket: https://community.openproject.org/projects/openproject/work_packages/74158/activity

@myabc
Copy link
Copy Markdown
Contributor

myabc commented Apr 23, 2026

@oliverguenther code changes look ok on cursory glance. I haven't tried building locally yet however. I'd feel a bit more confident about the changes if we were able to introduce type checking (gradually perhaps? - instead of as #109 does)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates this OpenProject CKEditor build to CKEditor 5 v48 and adjusts the build/integration approach to match upstream packaging changes (notably translations and CSS assets).

Changes:

  • Bump all CKEditor 5 packages from 44.3.x to 48.0.0 and update removed/deprecated internal import paths.
  • Remove CKEditorTranslationsPlugin usage from webpack and add post-build scripts to generate translations/*.js and a combined ckeditor.css for OpenProject core consumption.
  • Update a handful of plugins/converters to use newer CKEditor engine APIs (e.g., selection/range/dom converter changes).

Reviewed changes

Copilot reviewed 19 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
webpack.config.js Removes CKEditor translation plugin + theme importer config to align with v48 build changes.
package.json Bumps CKEditor deps to 48.0.0; extends build to generate translations + CSS artifacts.
eslint.config.mjs Adds ESLint globals/rules for bin/**/*.mjs scripts.
bin/build-ckeditor-translations.mjs New script to generate translations/*.js into OpenProject core vendor directory.
bin/build-ckeditor-styles.mjs New script to generate a combined ckeditor.css into OpenProject core vendor directory.
patches/@ckeditor+ckeditor5-mention+48.0.0.patch Updates patch-package target to v48 dist layout for mention regexp tweak.
src/commonmark/commonmarkdataprocessor.js Updates engine DOM converter import/usage for v48 (ViewDomConverter).
tests/commonmark/escaping.test.js Updates view stringify helper import for CKEditor v48.
tests/commonmark/_utils/utils.js Updates view stringify helper import for CKEditor v48.
src/plugins/op-macro-wp-button/utils.js Updates widget utils import path to v48 public entry.
src/plugins/op-macro-toc-plugin.js Updates widget utils import path to v48 public entry.
src/plugins/op-macro-list-plugin.js Updates dropdown utils import path to v48 public entry.
src/plugins/op-macro-embedded-table/utils.js Updates widget utils import path to v48 public entry.
src/plugins/op-macro-child-pages/utils.js Updates widget utils import path to v48 public entry.
src/plugins/op-custom-css-classes-plugin.js Extends alignment mapping and tweaks alignment class handling for v48 behavior.
src/plugins/op-content-revisions/ui.js Updates CKEditor imports from ckeditor5/src/* to @ckeditor/* packages.
src/plugins/op-content-revisions/op-content-revisions.js Updates CKEditor imports from ckeditor5/src/* to @ckeditor/* packages.
src/plugins/op-content-revisions/command.js Updates CKEditor imports from ckeditor5/src/* to @ckeditor/* packages.
src/plugins/op-attachment-listener-plugin.js Replaces direct Selection construction with editor.model.createSelection.
src/plugins/code-block/widget.js Updates widget utils import path to v48 public entry.
src/plugins/code-block/converters.js Replaces new Range() with writer-based createRange() for v48 compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const alignmentClass = parentFigureClasses.filter(figureClass => figureClass.startsWith(config.attributesWithCustomClassesMap.alignment))[0];
const alignmentAlias = alignmentClass && alignmentClass.replace(config.attributesWithCustomClassesMap.alignment, '') || config.alignmentValuesMap.default;
const alignmentToApply = Object.keys(config.alignmentValuesMap).find(alignmentKey => config.alignmentValuesMap[alignmentKey] === alignmentAlias);
const alignmentToApply = Object.keys(config.alignmentValuesMap).find(alignmentKey => config.alignmentValuesMap[alignmentKey] === alignmentAlias) || 'center';
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback hard-codes 'center' even though the default is already defined in alignmentValuesMap. Using config.alignmentValuesMap.default here would avoid divergence if the default ever changes and keeps the logic DRY.

Suggested change
const alignmentToApply = Object.keys(config.alignmentValuesMap).find(alignmentKey => config.alignmentValuesMap[alignmentKey] === alignmentAlias) || 'center';
const defaultAlignmentToApply = Object.keys(config.alignmentValuesMap).find(alignmentKey => config.alignmentValuesMap[alignmentKey] === config.alignmentValuesMap.default);
const alignmentToApply = Object.keys(config.alignmentValuesMap).find(alignmentKey => config.alignmentValuesMap[alignmentKey] === alignmentAlias) || defaultAlignmentToApply;

Copilot uses AI. Check for mistakes.
@oliverguenther oliverguenther merged commit 5dce35a into master Apr 27, 2026
8 checks passed
@oliverguenther oliverguenther deleted the feat/v48 branch April 27, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants