Skip to content

Provide light-weight emoji functions #8080

@ShGKme

Description

@ShGKme

Problem

We are working with emojis mostly via emoji-mart-vue-fast library.
It includes 826KB (‼️) emoji JSON file which is then used in slow Emoji Index init (up to 1 sec blocking time ‼️).

For NcEmojiPicker it is really necessary, but can be loaded on the first open.

But we also provide functions:

  • emojiSearch with 2 roles
    • Searching emojis by name (actually requires the index)
    • Getting recently used emojis
  • emojiAddRecent - add manually selected emoji to the recently used

emojiSearch also bundles and builds the large emoji index which only makes sense for search, not recently used.

emojiAddRecent uses ID from the emoji index, which indirectly requires the index again.

Proposal

1. Add new async emojiSearch and deprecate existing one

Same as the current emojiSearch, but with lazy fetching and initialising the emoji index

2. Provide getRecentlyEmojis and addRecentlyUsedEmoji functions using only native emoji, no emoji-mart IDs

Allows getting and setting recently used without using the index.

NOTE

We still need an integration with emoji-mart-vue-fast for the Emoji picker's recently used emojis.

A workaround: build a simple map ID -> native emoji for integration. It is 80Kb JSON (0.1 x Emoji Index).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions