ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Impossible to build CKEditor without UI

Open Inviz opened this issue 1 year ago • 4 comments

📝 Provide detailed reproduction steps (if any)

I'm trying to use CKEditor as a framework, and not the UI kit. I'm really struggling in ditching the Widget/UI modules.

  1. Anything that depends on clipboard (e.g. linkediting) pulls in clipboard, which pulls widget which pulls UI
  2. Because i want to avoid loading UI parts of the commands/plugins, I need to use files directly. There're issues with importing classes in typescript. E.g. importing from engine/src/editor/editor doesnt allow to instantiate the Editor.

here's an example of workaround i have to do to import a class not fron entry point of a package

import { default as OriginalRenderer } from '@ckeditor/ckeditor5-engine/src/view/renderer.js'
import type { Renderer as OriginaRendererConstructor } from '@ckeditor/ckeditor5-engine'
export const Renderer = OriginalRenderer as unknown as typeof OriginaRendererConstructor
  1. CSS/Icons is loaded in many places unconditionally
  2. Modules internally pull from each other's entry point, making them load eveyrthing. Example:
import {
	DomEventData,
	Observer,
	type View,
	type ViewDocumentCompositionEndEvent,
	type ViewDocumentInputEvent,
	type ViewDocumentSelection,
	type ViewRange,
	type ViewSelection
} from '@ckeditor/ckeditor5-engine'; 

in ckeditor5-typing, forces loading of css/icons 5. Some modules are importuing ui casually in utils files: https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-list/src/list/utils.ts

✔️ Expected result

It should be possible to have basic functionality

❌ Actual result

One way or another we're back to build that includes UI, css, svg icons, Widget, etc.

❓ Possible solution

Clear up some unnecessary dependencies

Inviz avatar May 11 '23 15:05 Inviz

Hey @Inviz! This is a very interesting use case, and it got us thinking internally! Would you be willing to jump on a call with me and couple of devs? I can follow up to your email from the profile.

Witoso avatar May 12 '23 09:05 Witoso

@Witoso

Definitely i'd love to jump on a call, i think my email aliases to [email protected] - you can reach me there. Let's do it today soon?

Inviz avatar May 12 '23 11:05 Inviz

Here're some examples of what i've been doing with ckeditor. Container-level "cursor", real inline elements inside text elements, themes, css grid editor, multi-row flexbox drag and drop, data mapping/repeating, linked duplicate, external css customization, custom elements, web components, responsive designs, to name a few.

Screen Shot 2023-05-12 at 19 05 51 Screen Shot 2023-05-12 at 19 05 57 Screen Shot 2023-05-12 at 19 05 36 Screen Shot 2023-05-12 at 19 06 15 Screen Shot 2023-05-12 at 19 17 24

Inviz avatar May 12 '23 11:05 Inviz

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar May 12 '24 03:05 CKEditorBot