ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.58k stars 3.7k forks source link

when editing lots of content ,will lag and be very slow in Vue2 #16470

Open NorthWind17 opened 5 months ago

NorthWind17 commented 5 months ago

editing lots of content, the editor will lag and be very slow in Vue2 "vue": "^2.7.14", "@ckeditor/ckeditor5-vue2": "^3.0.1", "ckeditor5-custom-build": "file:ckeditor5", <ckeditor ref="ckeditor" :value="editorData" :editor="editor" :config="editorConfig" :disabled="!isEdit" @ready="onReady" @input="onEditorInput" @destroy="onEditorDestroy" @blur="onBlurFn" ></ckeditor> import CKEditor from '@ckeditor/ckeditor5-vue2' import Editor from 'ckeditor5-custom-build/build/ckeditor'

but if i use ClassicEditor.create(document.querySelector('.stEditorCopy'), config) .then((editor) => { window.editor = editor }) .catch((error) => { console.error('Oops, something went wrong!') console.error( 'Please, report the following error on https://github.com/ckeditor/ckeditor5/issues with the build id and the error stack trace:' ) console.warn('Build id: w2x4hsrl3dlt-xws7pn8ntdyc') console.error(error) }) Having the same amount of content won't lag and slow,This is strange

Witoso commented 5 months ago

Hi! We would need additional information. The above examples show a bit of apples to oranges comparison. If, for example, @input="onEditorInput" does some heavy operation, it can block the editor.

NorthWind17 commented 5 months ago

Hi! We would need additional information. The above examples show a bit of apples to oranges comparison. If, for example, @input="onEditorInput" does some heavy operation, it can block the editor.

onEditorInput(html) { this.$emit('update:editorHtml', html) this.$emit('change', html) }, This is the only operation ,

I delete the operation, still lag。how should I show you more code?

NorthWind17 commented 5 months ago

Hi! We would need additional information. The above examples show a bit of apples to oranges comparison. If, for example, @input="onEditorInput" does some heavy operation, it can block the editor.

I have built a simple project that can reproduce this problem ,address is git@github.com:NorthWind17/cktest.git

NorthWind17 commented 5 months ago

Hi! We would need additional information. The above examples show a bit of apples to oranges comparison. If, for example, @input="onEditorInput" does some heavy operation, it can block the editor.

i use this <script src="./ckeditor5/build/ckeditor.js"></script> ClassicEditor.create(document.querySelector('.stEditorCopy'), config) .then((editor) => { window.editor = editor }) .catch((error) => { console.error('Oops, something went wrong!') console.error( 'Please, report the following error on https://github.com/ckeditor/ckeditor5/issues with the build id and the error stack trace:' ) console.warn('Build id: w2x4hsrl3dlt-xws7pn8ntdyc') console.error(error) }) if i write editor.model.document.on('change:data', () => { console.log('==', editor.getData()) }),it will lag and slow,If don't write, it's okay

MikeDoctorNow commented 4 months ago

We have the same issue in Angular. Repro is very simple, once you get pages of content editor becomes very laggy. The more content, the slow typing gets. Eventually, if you add even more content we get a Chrome out of memory crash.

I created a new angular project with just a plain vanilla CKEditor (no add-ons, etc).

Relevant code:

app.component.html <ckeditor [editor]="Editor" data="

Hello, world!

">

app.module.ts import { CKEditorModule } from '@ckeditor/ckeditor5-angular';

... imports: [ CKEditorModule, ...

Copy/paste numerous pages of text into the editor. The more you paste, the slower it gets.