Skip to content

Commit

Permalink
Merge pull request #17345 from ckeditor/fix-treeshaking-of-icons
Browse files Browse the repository at this point in the history
Fix (bookmarks): Avoid global state to improve icons tree-shaking.
  • Loading branch information
filipsobol authored Oct 28, 2024
2 parents d975572 + c59c9c2 commit 49edd01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/ckeditor5-bookmark/src/bookmarkediting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import UpdateBookmarkCommand from './updatebookmarkcommand.js';

import '../theme/bookmark.css';

const bookmarkIcon = icons.bookmarkInline;

/**
* The bookmark editing plugin.
*/
Expand Down Expand Up @@ -162,7 +160,7 @@ export default class BookmarkEditing extends Plugin {
const icon = new IconView();

icon.set( {
content: bookmarkIcon,
content: icons.bookmarkInline,
isColorInherited: false
} );

Expand Down
4 changes: 1 addition & 3 deletions packages/ckeditor5-bookmark/src/bookmarkui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import type InsertBookmarkCommand from './insertbookmarkcommand.js';

import BookmarkEditing from './bookmarkediting.js';

const bookmarkIcon = icons.bookmark;

const VISUAL_SELECTION_MARKER_NAME = 'bookmark-ui';

/**
Expand Down Expand Up @@ -275,7 +273,7 @@ export default class BookmarkUI extends Plugin {

view.set( {
label: t( 'Bookmark' ),
icon: bookmarkIcon
icon: icons.bookmark
} );

// Execute the command.
Expand Down

0 comments on commit 49edd01

Please sign in to comment.