Bump CKEditor to 48.0#111
Conversation
fa02d2b to
33ce4dd
Compare
|
@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) |
There was a problem hiding this comment.
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
CKEditorTranslationsPluginusage from webpack and add post-build scripts to generatetranslations/*.jsand a combinedckeditor.cssfor 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'; |
There was a problem hiding this comment.
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.
| 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; |
Core PR: opf/openproject#22837
Ticket: https://community.openproject.org/projects/openproject/work_packages/74158/activity