Skip to content

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

Closed
@bendemboski

Description

✔️ 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.

Metadata

Assignees

No one assigned

    Labels

    domain:integration-dxThis issue reports a problem with the developer experience when integrating CKEditor into a system.package:coreresolution:resolvedThis issue was already resolved (e.g. by another ticket).type:bugThis issue reports a buggy (incorrect) behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions