-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Ability to trim track changes integration plugins #17637
Comments
Hey, thanks for the issue. Could you provide further details about what you mean:
|
I think that @bendemboski refers to the fact that I wonder what did you use to measure that the extra size is 366kb. As far as I see, the directory itself, not minified, takes 250kb. Maybe some of these integrations plugins also load something extra that is not needed? Or maybe this 366kb size you measured includes other things, that are necessary. Regarding how the plugins are required/loaded. That was a decision we made when we introduced track changes feature, and it based on some architectural limitations we have regarding importing and loading plugins. We needed to decide on two things:
We decided to go with "convenient" options, so we put integrations in track changes package and we decided to load them all by default, but unfortunately the drawback is that we load some extra code. Other than the bundle size, there are some other smaller factors which make me believe that the integration code should be in features packages. However, I am afraid that the ROI here is minor, compared to other initiatives that we plan to take on. Unless, maybe there's one thing we could consider: put all integration plugins into one plugin We discussed this issue with @filipsobol and he will check whether there are no glaring errors in the integrations plugins that would cause them to import unnecessary code. Maybe he will find something. |
The following imports result in a bundle of about 700 KiB: import { ClassicEditor, AutoLink, Autosave, Bold, CloudServices, Essentials, Italic, Link, Paragraph } from 'ckeditor5'; Adding the following imports increases the bundle size to 1.06 MiB: import { TrackChanges, TrackChangesData } from 'ckeditor5-premium-features'; Out of these extra ~300 KiB:
If you are using the real-time features of CKEditor, these dependencies cannot be removed. However, if you are not using any real-time features, you can follow our Optimizing build size document. Using the following imports, I was able to remove import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic/dist/index.js';
import { Link, AutoLink } from '@ckeditor/ckeditor5-link/dist/index.js';
import { Autosave } from '@ckeditor/ckeditor5-autosave/dist/index.js';
import { Bold, Italic } from '@ckeditor/ckeditor5-basic-styles/dist/index.js';
import { Essentials } from '@ckeditor/ckeditor5-essentials/dist/index.js';
import { Paragraph } from '@ckeditor/ckeditor5-paragraph/dist/index.js';
import { CloudServices } from '@ckeditor/ckeditor5-cloud-services/dist/index.js';
import { TrackChanges, TrackChangesData } from '@ckeditor/ckeditor5-track-changes/dist/index.js'; |
I'm webpack-bundling and this is what
This is probably before you run it through your code obfuscator? I guess the obfuscator is increasing the size significantly because looking at the published package, the
I think this is a fantastic idea. The |
📝 Provide a description of the improvement
The track changes plugin requires a bunch of integration plugins to integrate with various editor features. They contribute about ~366kb total to my bundle size. A number of them are for features/plugins that I don't use, so it would be really nice to be able to trim those out of my bundle.
If you'd like to see this improvement implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: