Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve exports conflicts in ckeditor5 package. #15511

Closed
pszczesniak opened this issue Dec 11, 2023 · 2 comments · Fixed by #15515
Closed

Resolve exports conflicts in ckeditor5 package. #15511

pszczesniak opened this issue Dec 11, 2023 · 2 comments · Fixed by #15515
Assignees
Labels
squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@pszczesniak
Copy link
Contributor

pszczesniak commented Dec 11, 2023

In the new installation methods, the ckeditor5 package will be used to re-export content of all open source packages. We have found that there are name conflicts that need to be resolved first.

Export name Package 1 Package 2 Suggestions
icons core ui Move colorPaletteIcon, previousArrow, and nextArrow icons from ui to core. These icons should be added to the icons object exported from the core package.
Model engine ui In ui, rename to ViewModel (only re-export).
View engine ui In engine, rename to EditingView (only re-export).
Position engine (class) utils (interface) Rename interface to DomPoint.
findOptimalInsertionRange engine widget Move implementation in engine to the Schema class as findOptimalInsertionRange method (add @internal).
UploadAdapter upload (interface) adapter-ckfinder (class) Rename re-export to CKFinderUploadAdapter.
@pszczesniak pszczesniak added type:task This issue reports a chore (non-production change) and other types of "todos". squad:core Issue to be handled by the Core team. labels Dec 11, 2023
@pszczesniak pszczesniak self-assigned this Dec 11, 2023
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Dec 12, 2023
@pszczesniak
Copy link
Contributor Author

pszczesniak commented Dec 14, 2023

Problem

Unfortunately, suggested way of resolving name conflict with findOptimalInsertionRange has failed.

After merging findOptimalInsertionRange from widget and engine package and moved it to the Schema as a method, one more function ( getTypeAroundFakeCaretPosition ) was needed to be imported from widgettypearound/utils.
After createing an export in index.ts in widget package:

export { getTypeAroundFakeCaretPosition } from './widgettypearound/utils';

and trying to import it in Schema we get an errors (unable to run anything with widget) - it was caused by that widget has imports from engine and engine has imports from widget.

Solution

We decided to change the way how we will handle it: move findOptimalInsertionRange from engine to the Schema as a method, but leave findOptimalInsertionRange in widget but not import it from engine but use model.schema.findOptimalInsertionRange(). 👉 7875f7f

@filipsobol
Copy link
Member

We needed to move more icons that we initially expected, because they are used by more than one package.

Icons moved to the @ckeditor/ckeditor5-core package:

  • undo.svg and redo.svg from the undo package.
  • bulletedlist.svg, numberedlist.svg, and todolist.svg from the list package.
  • codeblock.svg from the code-block package.
  • browse-files.svg from the ckbox and ckfinder packages.
  • heading1.svg, heading2.svg, heading3.svg, heading4.svg, heading5.svg, and heading6.svg from the heading package.
  • horizontalline.svg from the horizontal-line package.
  • html.svg from the html-embed package.
  • indent.svg and outdent.svg from the indent package.
  • table.svg from the table package.

Icons moved to the ckeditor5-collaboration package:

  • robot-pencil.svg from the ai package.
  • table-of-contents.svg from the document-outline package.
  • paint-roller.svg from the format-painter package.
  • template.svg from the template package.

pszczesniak added a commit that referenced this issue Dec 27, 2023
…licts-in-ckeditor5-package

MINOR BREAKING CHANGE (ui): Move `colorPalette`, `previousArrow`, and `nextArrow` icons to the `core` package and add them to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (undo): Move `undo` and `redo` icons to the `core` package and add them to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (list): Move `bulletedList`, `numberedList` and `todoList` icons to the `core` package and add them to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (code-block): Move `codeBlock` icon to the `core` package and add it to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (ckbox): Move `browseFiles` icon to the `core` package and add it to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (ckfinder): Move `browseFiles` icon to the `core` package and add it to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (heading): Move `heading1`, `heading2`, `heading3`, `heading4`, `heading5`, and `heading6` icons to the `core` package and add them to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (horizontal-line): Move `horizontalLine` icon to the `core` package and add it to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (html-embed): Move `html` icon to the `core` package and add it to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (indent): Move `indent` and `outdent` icons to the `core` package and add them to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (table): Move `table` icon to the `core` package and add it to the `icons` object exported from it. See #15511.

MINOR BREAKING CHANGE (engine): Rename export of the `View` class to `ViewEditing`. See #15511.

MINOR BREAKING CHANGE (adapter-ckfinder): Rename export of the `UploadAdapter` class to `CKFinderUploadAdapter`. See #15511.

MINOR BREAKING CHANGE (engine): Move the `findOptimalInsertionRange` function to the `Schema` class as a new method. See #15511.

MINOR BREAKING CHANGE (utils): Rename the `Position` interface to `DomPoint`. See #15511.

Closes #15511.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Dec 27, 2023
@CKEditorBot CKEditorBot added this to the iteration 70 milestone Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants