Skip to content

fix: migrate emoji support from emojione to emoji-toolkit (Unicode 16)#37082

Closed
Sarthakkad05 wants to merge 1 commit intoRocketChat:developfrom
Sarthakkad05:migrate-emoji-toolkit
Closed

fix: migrate emoji support from emojione to emoji-toolkit (Unicode 16)#37082
Sarthakkad05 wants to merge 1 commit intoRocketChat:developfrom
Sarthakkad05:migrate-emoji-toolkit

Conversation

@Sarthakkad05
Copy link
Copy Markdown
Contributor

@Sarthakkad05 Sarthakkad05 commented Sep 27, 2025

Closes: #24917

Summary:
This PR fixes the outdated emoji picker in Rocket.Chat by replacing the legacy emojione and emojione-assets packages with the modern emoji-toolkit. This ensures full support for Unicode 13–16 emojis, including recently added emojis like 🪓.

Changes:

  • Removed emojione, emojione-assets, and @types/emojione from package.json.
  • Installed emoji-toolkit and updated all imports from emojione → emoji-toolkit.
  • Added TypeScript declaration emoji-toolkit.d.ts to maintain type safety.
  • Updated CSS and sprite references to match the new package.
  • Emoji picker now displays the latest emojis.

Testing / Verification:

  • Verified that emoji picker shows Unicode 13–16 emojis (e.g., 🪓) in the code editor.
  • Sending and receiving messages with new emojis works correctly.
  • No TypeScript compilation errors.

Impact:

  • Users now have access to the latest emojis.
  • Removes outdated dependencies and modernizes emoji handling.
  • Backward compatibility:
  • All existing shortnames and emoji conversions still work; legacy emojis remain unaffected.

Summary by CodeRabbit

  • Refactor
    • Replaced the underlying emoji library across the app with emoji-toolkit; no changes to emoji behavior expected.
  • Chores
    • Updated emoji-toolkit to v9.0.1 across multiple packages.
    • Removed legacy emoji dependencies (emojione, emojione-assets) from development dependencies.
  • Notes
    • No user-facing changes are expected; emoji rendering and conversion should remain consistent.

@Sarthakkad05 Sarthakkad05 requested review from a team as code owners September 27, 2025 16:49
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 27, 2025

⚠️ No Changeset found

Latest commit: 91f645f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Sep 27, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 27, 2025

Walkthrough

Replaced all imports of the deprecated emojione package with emoji-toolkit across server and client code. Updated TypeScript module declaration to target emoji-toolkit. Bumped emoji-toolkit dependency versions in multiple package.json files and removed emojione-related devDependencies. No public APIs or control flow were changed.

Changes

Cohort / File(s) Summary of Changes
Emoji library import switched to emoji-toolkit
apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts, apps/meteor/app/emoji-emojione/server/callbacks.ts, apps/meteor/app/emoji/client/lib.ts, apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts, apps/meteor/client/sidebar/RoomList/normalizeSidebarMessage.ts, apps/meteor/client/sidebarv2/RoomList/normalizeSidebarMessage.ts, apps/meteor/client/views/navigation/lib/normalizeNavigationMessage.ts, apps/meteor/server/services/federation/infrastructure/matrix/converters/room/MessageReceiver.ts
Replaced imports from emojioneemoji-toolkit; usage (e.g., shortnameToUnicode, toImage, toShort) unchanged.
Type declaration update
apps/meteor/definition/externals/emoji-toolkit.d.ts
Module declaration changed to declare module 'emoji-toolkit' { export as namespace emojiToolkit; } (from emojione/emojione namespace).
Dependency updates and removals
apps/meteor/package.json, ee/apps/omnichannel-transcript/package.json, ee/apps/queue-worker/package.json, ee/packages/omnichannel-services/package.json, ee/packages/pdf-worker/package.json
Bumped emoji-toolkit version ^7.0.1^9.0.1. Removed emojione and emojione-assets from devDependencies in apps/meteor/package.json.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

I swapped old smiles for fresher grins,
Packed my carrots, dropped the bins. 🥕
Toolkit gleams where One once stood,
Unicode fields now ripe and good.
Hop, hop—new emojis bloom—
Axes, hearts, and stars go vroom! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely describes the main change in the pull request, namely migrating emoji support from emojione to emoji-toolkit and highlighting the upgrade to Unicode 16 support; it clearly reflects the primary action without extraneous details and will be easily understood by maintainers scanning the commit history.
Linked Issues Check ✅ Passed The pull request fully replaces the discontinued emojione and emojione-assets packages with emoji-toolkit across all code paths, updates dependencies in package.json to v9.0.1, adds the TypeScript declaration file, and ensures support for Unicode 13–16 emojis in the picker and message rendering, thereby satisfying all the objectives outlined in issue #24917.
Out of Scope Changes Check ✅ Passed All modifications in this pull request are directly related to migrating emoji support from emojione to emoji-toolkit—including import updates, dependency bumps, and type declarations—and there are no unrelated changes beyond the scope of the linked issue’s objectives.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sarthakkad05
Copy link
Copy Markdown
Contributor Author

This PR fixes the outdated emoji picker by migrating from emojione → emoji-toolkit, adding support for Unicode 13–16 emojis (e.g., 🪓).

  1. All existing shortnames and legacy emojis remain fully compatible.
  2. Tested sending and receiving messages with new emojis locally — everything works.

This resolves #24917
and modernizes emoji handling across Rocket.Chat.

Would love a review when you get a chance — thanks!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts (1)

6-6: Remove outdated emojione workaround and TODO comment
The referenced issue (#617) still exists in the emojione repo (HTTP 200) and there’s no corresponding issue in emoji-toolkit. Delete the // TODO remove fix below when issue is solved: https://github.com/joypixels/emojione/issues/617 line and its associated workaround now that we’ve fully migrated.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dca0b3a and 91f645f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (14)
  • apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts (1 hunks)
  • apps/meteor/app/emoji-emojione/server/callbacks.ts (1 hunks)
  • apps/meteor/app/emoji/client/lib.ts (1 hunks)
  • apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts (1 hunks)
  • apps/meteor/client/sidebar/RoomList/normalizeSidebarMessage.ts (1 hunks)
  • apps/meteor/client/sidebarv2/RoomList/normalizeSidebarMessage.ts (1 hunks)
  • apps/meteor/client/views/navigation/lib/normalizeNavigationMessage.ts (1 hunks)
  • apps/meteor/definition/externals/emoji-toolkit.d.ts (1 hunks)
  • apps/meteor/package.json (1 hunks)
  • apps/meteor/server/services/federation/infrastructure/matrix/converters/room/MessageReceiver.ts (1 hunks)
  • ee/apps/omnichannel-transcript/package.json (1 hunks)
  • ee/apps/queue-worker/package.json (1 hunks)
  • ee/packages/omnichannel-services/package.json (1 hunks)
  • ee/packages/pdf-worker/package.json (1 hunks)
🔇 Additional comments (14)
apps/meteor/server/services/federation/infrastructure/matrix/converters/room/MessageReceiver.ts (1)

1-1: LGTM! Correctly migrating from emojione to emoji-toolkit.

The import change from emojione to emoji-toolkit is correct and aligns with the broader migration across the codebase. The API methods toShort and shortnameToUnicode remain compatible between the libraries.

Based on learnings: EmojiOne has rebranded to JoyPixels, and the upgrade path is documented with details on what's new when migrating from emojione.

ee/apps/omnichannel-transcript/package.json (1)

33-33: LGTM! Dependency upgraded to support Unicode 16 emojis.

The upgrade from ^7.0.1 to ^9.0.1 is appropriate and aligns with the project-wide migration to emoji-toolkit for Unicode 13-16 support.

Based on learnings: The 9.0.1 version brings the toolkit up to JoyPixels 9.0 and Unicode 15.1 support, providing access to newer emoji glyphs and sequences.

ee/packages/omnichannel-services/package.json (1)

29-29: LGTM! Consistent emoji-toolkit version upgrade.

The upgrade from ^7.0.1 to ^9.0.1 maintains consistency with other packages in the migration and provides Unicode 15.1 support.

Based on learnings: This version includes sync with JoyPixels 9.0 artwork and Unicode 15.1 support for new emoji glyphs and sequences.

apps/meteor/client/views/navigation/lib/normalizeNavigationMessage.ts (1)

3-3: LGTM! Import correctly updated for emoji-toolkit migration.

The migration from emojione to emoji-toolkit is correct. The shortnameToUnicode API method remains compatible between libraries, so the existing logic at Line 10 will continue to work as expected.

Based on learnings: All references to "emojione" in class names and file names have been changed during the EmojiOne to JoyPixels rebrand, and sprite filenames have changed from emojione- to joypixels-.

apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts (1)

11-11: LGTM! Correct emoji library import update.

The import change from emojione to emoji-toolkit is appropriate and maintains API compatibility. All usage sites of emojione.shortnameToUnicode (Lines 185, 190, 191) will continue working seamlessly with emoji-toolkit.

Based on learnings: The emoji-toolkit provides the same API patterns like shortnameToUnicode(str) that were available in emojione, ensuring backward compatibility.

ee/apps/queue-worker/package.json (1)

29-29: LGTM! Upgraded to latest emoji-toolkit with Unicode 15.1 support.

The upgrade from ^7.0.1 to ^9.0.1 brings emoji-toolkit up to Unicode 15.1, adding support for newer emojis as mentioned in the PR objectives.

Based on learnings, verify that the upgrade doesn't break existing emoji processing:Based on the search results, version 9.0.1 is a small PHP regex patch for Unicode 15.1, while 9.0.0 brought the toolkit up to date with JoyPixels 9.0 and Unicode 15.1. The core APIs appear to be backward compatible based on learnings.

apps/meteor/definition/externals/emoji-toolkit.d.ts (1)

1-2: LGTM! Module declaration updated correctly.

The TypeScript module declaration has been properly updated from emojione to emoji-toolkit with the namespace alias changed to emojiToolkit. The API surface remains consistent.

apps/meteor/app/emoji/client/lib.ts (1)

2-2: LGTM! Import updated to emoji-toolkit.

The import has been correctly updated from emojione to emoji-toolkit. The usage on Line 18 (emojione.toImage) remains unchanged, indicating API compatibility.

apps/meteor/client/sidebarv2/RoomList/normalizeSidebarMessage.ts (1)

3-3: LGTM! Import migrated to emoji-toolkit.

The import has been correctly updated from emojione to emoji-toolkit. The usage on Line 10 (emojione.shortnameToUnicode) maintains the same API, ensuring backward compatibility.

apps/meteor/app/emoji-emojione/server/callbacks.ts (1)

1-1: LGTM! Import migration properly executed.

The import change from emojione to emoji-toolkit is correctly implemented. The API usage remains consistent with emojione.shortnameToUnicode, which maintains backward compatibility during the migration.

apps/meteor/client/sidebar/RoomList/normalizeSidebarMessage.ts (1)

3-3: LGTM! Consistent migration pattern.

The import replacement from emojione to emoji-toolkit is properly executed. The usage pattern on Line 10 continues to work as expected with the new library.

apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts (2)

1-1: LGTM! Import successfully migrated.

The import change from emojione to emoji-toolkit is correctly implemented while maintaining the same variable name and API usage throughout the file.


9-164: Validate custom emoji definitions after migrating to emoji-toolkit@9.0.1
Ensure TM, ©, ®, digit_*, pound and asterisk emojis aren’t already provided by the new library and remove any redundant overrides.

apps/meteor/package.json (1)

346-346: LGTM! Library version properly updated with no security concerns.

The emoji-toolkit upgrade to version ^9.0.1 is secure with no direct vulnerabilities found and represents the latest stable release. Version 9.0.1 was published approximately a year ago, providing good stability while adding Unicode 15.1 support as mentioned in the PR objectives.

Based on learnings: The upgrade to emoji-toolkit 9.0.1 provides JoyPixels 9.0 artwork and Unicode 15.1 support, which aligns perfectly with the PR goal of supporting newer emoji sets including Unicode 13-16 emojis.

"@rocket.chat/fuselage-tokens": "~0.33.2",
"emoji-assets": "^7.0.1",
"emoji-toolkit": "^7.0.1",
"emoji-toolkit": "^9.0.1",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

LGTM! Consistent emoji-toolkit upgrade.

The upgrade from ^7.0.1 to ^9.0.1 aligns with the repository-wide migration to the latest emoji-toolkit version.

Note that Line 39 still references @types/emojione in devDependencies. This should be updated or removed as part of the migration:


🏁 Script executed:

#!/bin/bash
# Check if @types/emojione is still used anywhere in the pdf-worker code
fd -e ts -e tsx --exec grep -l "emojione" {} \; | head -10

Length of output: 726


Update or remove @types/emojione
BigEmojiBlock.tsx and EmojiSpan.tsx (ee/packages/pdf-worker) still import/refer to “emojione”; migrate these to emoji-toolkit (or remove) before dropping the @types/emojione devDependency.

@engelgabriel
Copy link
Copy Markdown
Member

Closing this PR in favor of #39411, where we’re replacing Emojione with native Unicode emojis.

It’s still a draft, and we’d love help from the community to get it across the finish line 🙌

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

Successfully merging this pull request may close these issues.

Update Emoji library

2 participants