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

Icons in @ckeditor/ckeditor5-core should be tree-shake-able #17635

Open
bendemboski opened this issue Dec 12, 2024 · 1 comment
Open

Icons in @ckeditor/ckeditor5-core should be tree-shake-able #17635

bendemboski opened this issue Dec 12, 2024 · 1 comment
Labels
domain:integration-dx This issue reports a problem with the developer experience when integrating CKEditor into a system. package:core type:bug This issue reports a buggy (incorrect) behavior.

Comments

@bendemboski
Copy link
Contributor

✔️ Expected result

When building/bundling CKEditor, only the icons that are needed end up in the bundle

❌ Actual result

All icons end up in the bundle

❓ Possible solution

Because the icons are exported as properties of a single object rather than as individual symbols, they are not tree-shake-able, and anytime any icon is used by any plugin, all the icons are included in the bundle.

📃 Other details

With CKEditor 44, I'm seeing those icons take up ~31k in my bundle, which is up from ~15k in CKEditor 38. So this isn't a massive bundle size impact, but it's still significant, and especially as CKEditor is likely to continue adding features and therefore icons, it will probably continue to grow. Exporting the icons as individual symbols would allow them to be tree-shaken, and make this a non-issue.


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@bendemboski bendemboski added the type:bug This issue reports a buggy (incorrect) behavior. label Dec 12, 2024
@Witoso
Copy link
Member

Witoso commented Dec 12, 2024

In reality, this is a bit more complex as we will also need to work on the icons' replacement in the very near future (#16546), but we will keep this in mind (cc @filipsobol @pomek)

@Witoso Witoso added package:core domain:integration-dx This issue reports a problem with the developer experience when integrating CKEditor into a system. labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:integration-dx This issue reports a problem with the developer experience when integrating CKEditor into a system. package:core type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

2 participants