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

Export emoji data #349

Open
777PolarFox777 opened this issue Jul 31, 2023 · 3 comments
Open

Export emoji data #349

777PolarFox777 opened this issue Jul 31, 2023 · 3 comments

Comments

@777PolarFox777
Copy link

Hello! Is there a chance you could export emoji data from src/data/emojis.ts? I would like to use it to show emoji popup when typing : character.

Currently, I'm importing a json directly from the package but it leads to duplication and my bundle contains 2 copies of emoji data. That increases bundle size a lot.

Would be really nice to use the exported version so I could get rid of the duplicates)

@777PolarFox777
Copy link
Author

Another solution could be removing emoji data from the index entry point) That would work as well)

@SeanDunford
Copy link

SeanDunford commented Sep 7, 2023

Piggy backing off of this bc i was looking for something similar. If this was implemented i could implement the search myself but it would be even better for my use case if there was a way to search for an emoji to validate it's renderable. Example below.

  
const data = { unifiedEmoji: 'badTextInDb' };
const unified = emojiByUnified(data.unified) ? data.unified : '1f60a'; // Use a default 

  <Emoji
  unified={unified}
  emojiStyle={EmojiStyle.APPLE}
  size={22}
/>

Alternatively a fallback option would also be nice.

const data = { unifiedEmoji: 'badTextInDb' };

  <Emoji
  unified={unified}
  fallBackEmoji={'smile'} // Could be unified or whatever but if unified fails then render this instead
  emojiStyle={EmojiStyle.APPLE}
  size={22}
/>

Forgive me if there's an existing solution to this just started using the library.

@jeffreyclu
Copy link

Hello! Is there a chance you could export emoji data from src/data/emojis.ts? I would like to use it to show emoji popup when typing : character.

Currently, I'm importing a json directly from the package but it leads to duplication and my bundle contains 2 copies of emoji data. That increases bundle size a lot.

Would be really nice to use the exported version so I could get rid of the duplicates)

Seconding this request for the exact same usecase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants