Skip to content

refactor: migrate emoji provider to emoji-toolkit#39214

Closed
CodeMatrix1 wants to merge 2 commits intoRocketChat:developfrom
CodeMatrix1:chore/emoji-migration-minimal
Closed

refactor: migrate emoji provider to emoji-toolkit#39214
CodeMatrix1 wants to merge 2 commits intoRocketChat:developfrom
CodeMatrix1:chore/emoji-migration-minimal

Conversation

@CodeMatrix1
Copy link
Copy Markdown

@CodeMatrix1 CodeMatrix1 commented Mar 1, 2026

Proposed changes

This PR introduces my migration architecture proposal of shifting the emoji provider from emojione to emoji-toolkit (JoyPixels).

The changes in this PR are limited strictly to code-level migration and dependency updates, without modifying runtime logic or introducing UI or behavioral changes.

Primary changes are in apps/meteor/app/emoji-emojione/lib, rest are just for compliance.

Summary of changes

  • Replaced internal references from emojione to joypixels where applicable.
  • Updated the emoji provider integration to use emoji-toolkit.
  • Added necessary dependency updates required to support the new provider.
  • Preserved existing span class structure and category conventions to avoid UI regressions.
  • Retained existing file names and structural patterns that still reference emojione to maintain compatibility and reduce scope in this phase.

Issue Concerned

fixes #39207, #24917 and #31069

below are previously unavailable emojis - axe and face_with_peeking_eye.

image

Important notes

  • This PR does not include full sprite or asset regeneration, they are to be generated by running node generateEmojiIndex.mjs from apps/meteor/app/emoji-emojione/lib for updating emoji library.
  • Asset generation would introduce a significantly large diff (~48k lines) and is intentionally excluded from this minimal architectural step.
  • Legacy emojione naming still exists in certain filenames and structural references and has been deliberately preserved to avoid expanding the scope of this PR.

Summary by CodeRabbit

  • Chores
    • Updated emoji library and asset packages to newer versions for improved emoji support.
  • Bug Fixes / Quality
    • Improved shortname ↔ unicode conversions so emoji display is more consistent in messages, previews, attachments, and notifications.
  • User-facing
    • Emoji rendering and picker output updated for more accurate images and HTML output.

Note: needs asset generation and also legacy of emojione naming is kept unchanged as much as possible
@CodeMatrix1 CodeMatrix1 requested a review from a team as a code owner March 1, 2026 10:05
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Mar 1, 2026

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 1, 2026

⚠️ No Changeset found

Latest commit: 44d17db

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 1, 2026

Walkthrough

Codebase-wide migration from emojione to emoji-toolkit (joypixels): imports, property names, and function calls updated; emoji asset paths adjusted; package dependencies updated.

Changes

Cohort / File(s) Summary
Emoji Index / Assets
apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs
Updated asset path references from emojione-assets to emoji-assets and set emoji_package to the new emoji-toolkit path; adjusted emojiJsonFile location; added an extra console error suggestion on missing file.
Emoji Configuration
apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts
Replaced emojione with joypixels (emoji-toolkit) across the module: imports, property access (e.g., emojiList, uc_full, uc_base, category), memoized regex setup, and conversion/rendering functions (toImage, shortnameToImage, shortnameToUnicode, etc.). Public getEmojiConfig() return now exposes emojione: joypixels and updated render mappings.
Server Callbacks
apps/meteor/app/emoji-emojione/server/callbacks.ts
Swapped import and usage from emojione.shortnameToUnicode to joypixels.shortnameToUnicode in before-send message notification callback.
Client Rendering
apps/meteor/app/emoji/client/lib.ts, apps/meteor/client/views/root/hooks/useEmojiOne.ts
Imports and rendering calls switched from emojione.toImage to joypixels.toImage; iteration target updated from emojione.emojioneList to config.emojione.emojiList.
Message Notification & Preview
apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts, apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
Replaced emojione.shortnameToUnicode with joypixels.shortnameToUnicode for message text, attachment descriptions/text, and preview normalization.
Dependencies
apps/meteor/package.json
Removed older emoji deps and emojione-assets; added/updated emoji-assets and bumped emoji-toolkit to v9.0.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type: chore

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The PR addresses the code-level migration objectives from #39207 by replacing emojione with emoji-toolkit (joypixels), updating imports, and adjusting conversion logic across multiple files. However, the PR deliberately defers asset generation and does not resolve structural questions about span class preservation versus JoyPixels convention updates. Clarify with stakeholders whether deferring asset generation and maintaining legacy span class patterns aligns with repository expectations for issue #39207 closure.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: migrate emoji provider to emoji-toolkit' is clear, concise, and accurately summarizes the main change across the pull request.
Out of Scope Changes check ✅ Passed All changes are directly related to the emoji provider migration from emojione to emoji-toolkit. Dependency updates in package.json and code replacements across multiple files all serve the stated migration objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

@CodeMatrix1 CodeMatrix1 changed the title chore(emoji) : minimal PR with code/dependency changes only chore(emoji) : minimal PR with code and dependency changes only Mar 1, 2026
@CodeMatrix1 CodeMatrix1 changed the title chore(emoji) : minimal PR with code and dependency changes only chore : minimal PR with code and dependency changes only Mar 1, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs">

<violation number="1" location="apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs:14">
P1: Dead property reference `emojioneList` - should be `emojiList` in server file</violation>

<violation number="2" location="apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs:14">
P1: Dead reference to undefined `emojione` variable in sprite rendering path</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs
Comment thread apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs
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/generateEmojiIndex.mjs (1)

16-18: ⚠️ Potential issue | 🟡 Minor

Update the error message to reference the correct package.

The error message still references emojione-assets, but should reference emoji-assets to match the updated dependency.

Proposed fix
 if (!fs.existsSync(emojiJsonFile)) {
 	console.error(`${emojiJsonFile} doesn't exist.`);
-	console.error("Maybe you need to run 'meteor npm install emojione-assets' or 'meteor npm install'?");
+	console.error("Maybe you need to run 'meteor npm install emoji-assets' or 'meteor npm install'?");
 } else {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs` around lines 16 -
18, Update the error message that checks fs.existsSync(emojiJsonFile) to
reference the new package name; replace the string "emojione-assets" with
"emoji-assets" in the console.error call that currently suggests running 'meteor
npm install emojione-assets' so the suggestion reflects the updated dependency
and uses emojiJsonFile for context.
🧹 Nitpick comments (2)
apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts (2)

1-7: Module mutation via property reassignment.

Line 7 mutates the imported joypixels module by reassigning its unicodeCharRegex method. This is a side effect that affects all other consumers of the module. While this works, it's worth noting this approach couples the memoization to module load order.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts` around lines 1 - 7, The
code currently mutates the imported joypixels module by reassigning
joypixels.unicodeCharRegex to a memoized version; instead create a local
memoized wrapper and use that wherever unicodeCharRegex is needed. Replace the
reassignment with a const like memoizedUnicodeCharRegex =
mem(joypixels.unicodeCharRegex, { maxAge: 1000 }) (or export it) and update any
local uses (in this file or helpers) to call memoizedUnicodeCharRegex rather
than joypixels.unicodeCharRegex so you avoid mutating the imported module while
keeping the memoization via mem.

82-94: Module mutation by overwriting shortnameToImage.

This overwrites joypixels.shortnameToImage globally, affecting all consumers of the emoji-toolkit module. This is intentional for the custom rendering logic, but be aware this is a global side effect.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts` around lines 82 - 94,
Currently the code mutates the global emoji-toolkit object by assigning to
joypixels.shortnameToImage; instead define a local function (e.g.,
getShortnameToImage) that uses joypixels.regShortNames, convertShortName,
joypixels.ascii, joypixels.riskyMatchAscii, joypixels.regAsciiRisky,
joypixels.regAscii and convertUnicode to perform the same replacements, and
export/return that function from this module instead of overwriting
joypixels.shortnameToImage so you avoid global side effects while preserving the
custom rendering behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts`:
- Line 77: The return expression in getEmojiConfig references an undefined
symbol emojione (emojione.fileExtension) causing a ReferenceError; fix by either
importing the emojione module or replacing the reference with the correct
existing variable (for example emojioneConfig or whatever variable holding
fileExtension in this file) and ensure the imported/used symbol provides
fileExtension so the template using ePath and unicode works; update the
top-of-file imports to import emojione (or the correct config) or change the
identifier in the return line to the existing config variable.

---

Outside diff comments:
In `@apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs`:
- Around line 16-18: Update the error message that checks
fs.existsSync(emojiJsonFile) to reference the new package name; replace the
string "emojione-assets" with "emoji-assets" in the console.error call that
currently suggests running 'meteor npm install emojione-assets' so the
suggestion reflects the updated dependency and uses emojiJsonFile for context.

---

Nitpick comments:
In `@apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts`:
- Around line 1-7: The code currently mutates the imported joypixels module by
reassigning joypixels.unicodeCharRegex to a memoized version; instead create a
local memoized wrapper and use that wherever unicodeCharRegex is needed. Replace
the reassignment with a const like memoizedUnicodeCharRegex =
mem(joypixels.unicodeCharRegex, { maxAge: 1000 }) (or export it) and update any
local uses (in this file or helpers) to call memoizedUnicodeCharRegex rather
than joypixels.unicodeCharRegex so you avoid mutating the imported module while
keeping the memoization via mem.
- Around line 82-94: Currently the code mutates the global emoji-toolkit object
by assigning to joypixels.shortnameToImage; instead define a local function
(e.g., getShortnameToImage) that uses joypixels.regShortNames, convertShortName,
joypixels.ascii, joypixels.riskyMatchAscii, joypixels.regAsciiRisky,
joypixels.regAscii and convertUnicode to perform the same replacements, and
export/return that function from this module instead of overwriting
joypixels.shortnameToImage so you avoid global side effects while preserving the
custom rendering behavior.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c30636 and 7daa70d.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs
  • 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/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
  • apps/meteor/client/views/root/hooks/useEmojiOne.ts
  • apps/meteor/package.json
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/emoji-emojione/server/callbacks.ts
  • apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
  • apps/meteor/client/views/root/hooks/useEmojiOne.ts
  • apps/meteor/app/emoji/client/lib.ts
  • apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts
🧠 Learnings (11)
📓 Common learnings
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: In Rocket.Chat PRs, keep feature PRs free of unrelated lockfile-only dependency bumps; prefer reverting lockfile drift or isolating such bumps into a separate "chore" commit/PR, and always use yarn install --immutable with the Yarn version pinned in package.json via Corepack.
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: Rocket.Chat repo context: When a workspace manifest on develop already pins a dependency version (e.g., packages/web-ui-registration → "rocket.chat/ui-contexts": "27.0.1"), a lockfile change in a feature PR that upgrades only that dependency’s resolution is considered a manifest-driven sync and can be kept, preferably as a small "chore: sync yarn.lock with manifests" commit.
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/emoji-emojione/server/callbacks.ts
  • apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
  • apps/meteor/client/views/root/hooks/useEmojiOne.ts
  • apps/meteor/app/emoji/client/lib.ts
  • apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/emoji-emojione/server/callbacks.ts
  • apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
  • apps/meteor/client/views/root/hooks/useEmojiOne.ts
  • apps/meteor/app/emoji/client/lib.ts
  • apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts
  • apps/meteor/client/views/root/hooks/useEmojiOne.ts
📚 Learning: 2026-02-25T20:10:16.987Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.

Applied to files:

  • apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts
  • apps/meteor/client/views/root/hooks/useEmojiOne.ts
  • apps/meteor/app/emoji/client/lib.ts
📚 Learning: 2026-02-24T19:36:55.089Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/home-content.ts:60-82
Timestamp: 2026-02-24T19:36:55.089Z
Learning: In RocketChat/Rocket.Chat e2e tests (apps/meteor/tests/e2e/page-objects/fragments/home-content.ts), thread message preview listitems do not have aria-roledescription="message", so lastThreadMessagePreview locator cannot be scoped to messageListItems (which filters for aria-roledescription="message"). It should remain scoped to page.getByRole('listitem') or mainMessageList.getByRole('listitem').

Applied to files:

  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2026-01-19T18:17:46.433Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38262
File: apps/meteor/client/lib/utils/normalizeMessagePreview/getMessagePreview.ts:24-33
Timestamp: 2026-01-19T18:17:46.433Z
Learning: In the Rocket.Chat repository, usernames (lastMessage.u.username) and display names (lastMessage.u.name) are sanitized/escaped centrally elsewhere in the system, so individual display functions like getMessagePreview do not need to escape these values before interpolating them into strings.

Applied to files:

  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.

Applied to files:

  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.

Applied to files:

  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
  • apps/meteor/client/views/root/hooks/useEmojiOne.ts
📚 Learning: 2026-02-24T19:09:09.561Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.

Applied to files:

  • apps/meteor/client/views/root/hooks/useEmojiOne.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • apps/meteor/client/views/root/hooks/useEmojiOne.ts
🧬 Code graph analysis (2)
apps/meteor/app/emoji-emojione/server/callbacks.ts (1)
apps/meteor/server/lib/callbacks.ts (1)
  • callbacks (218-226)
apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts (1)
apps/meteor/app/emoji/client/lib.ts (1)
  • emoji (8-34)
🔇 Additional comments (11)
apps/meteor/app/emoji/client/lib.ts (3)

2-2: Import migration is clean and scoped correctly.

Switching to emoji-toolkit here is consistent with the PR objective and keeps this module’s interface intact.


17-17: Renderer mapping preserves behavior contract.

Wiring render to joypixels.toImage is the expected provider swap at this layer and keeps downstream usage unchanged.


34-34: No concerns on object closure/update boundary.

This closing change is structurally fine and introduces no functional risk.

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

1-12: LGTM - Clean migration to joypixels.

The import and function call are correctly updated to use joypixels.shortnameToUnicode. The callback identifier 'emojione-shortnameToUnicode' is intentionally preserved to minimize scope, which aligns with the PR objectives.

apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts (1)

3-10: LGTM - Straightforward library swap.

The import and usage correctly migrate to joypixels.shortnameToUnicode. The processing order (escapeHTMLfilterMarkdownshortnameToUnicode) remains unchanged.

apps/meteor/client/views/root/hooks/useEmojiOne.ts (1)

25-34: LGTM - Property name correctly updated.

The change from config.emojione.emojioneList to config.emojione.emojiList correctly aligns with the emoji-toolkit API, where the emoji list is exposed as emojiList rather than emojioneList.

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

11-11: LGTM - Import correctly updated.


194-200: LGTM - Consistent migration across all emoji conversions.

All three usages of shortnameToUnicode (message body, attachment description, and attachment text) are correctly updated to use joypixels. The conditional type checks are preserved.

apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs (1)

11-14: LGTM - Path references correctly updated.

The asset folder and emoji data paths are correctly updated to reference emoji-assets and emoji-toolkit.

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

109-118: LGTM - Configuration export structure preserved.

The getEmojiConfig export maintains the same API surface, with emojione key now mapping to the joypixels module. This preserves backward compatibility for consumers like useEmojiOne.ts.

apps/meteor/package.json (1)

196-197: LGTM - Dependency migration looks correct.

The dependency swap from emojione/emojione-assets to emoji-toolkit/emoji-assets is aligned with the PR objectives. Both packages are at version 9.0.0, ensuring compatibility. The packages exist on npm with no known security advisories.

Comment thread apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts Outdated
a small change missed

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@CodeMatrix1 CodeMatrix1 changed the title chore : minimal PR with code and dependency changes only refactor: migrate emoji provider to emoji-toolkit Mar 1, 2026
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts`:
- Line 6: Remove the inline comment "Memoize conversion functions for
performance" from the getEmojiConfig implementation in getEmojiConfig.ts; locate
the comment near the top of the file (around the getEmojiConfig function and its
memoized conversion helpers) and delete that single-line comment so the file
adheres to the repository's "Avoid code comments in the implementation"
guideline.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7daa70d and 44d17db.

📒 Files selected for processing (1)
  • apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: In Rocket.Chat PRs, keep feature PRs free of unrelated lockfile-only dependency bumps; prefer reverting lockfile drift or isolating such bumps into a separate "chore" commit/PR, and always use yarn install --immutable with the Yarn version pinned in package.json via Corepack.
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:18.785Z
Learning: In Rocket.Chat PR reviews, maintain strict scope boundaries—when a PR is focused on a specific endpoint (e.g., rooms.favorite), avoid reviewing or suggesting changes to other endpoints that were incidentally refactored (e.g., rooms.invite) unless explicitly requested by maintainers.
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: Rocket.Chat repo context: When a workspace manifest on develop already pins a dependency version (e.g., packages/web-ui-registration → "rocket.chat/ui-contexts": "27.0.1"), a lockfile change in a feature PR that upgrades only that dependency’s resolution is considered a manifest-driven sync and can be kept, preferably as a small "chore: sync yarn.lock with manifests" commit.
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts
🧬 Code graph analysis (1)
apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts (1)
apps/meteor/app/emoji/client/lib.ts (1)
  • emoji (8-34)
🔇 Additional comments (4)
apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts (4)

13-47: Shortname conversion migration is consistent and preserves compatibility.

This block correctly uses joypixels data (emojiList, uc_full, uc_base, fileExtension) while keeping the legacy emojione CSS class contract intact.


54-77: ASCII conversion path is correctly switched to JoyPixels APIs.

The updated mapping/escape/render flow is coherent, and Line 77 now correctly references joypixels.fileExtension.


82-107: shortnameToImage and isEmojiSupported updates are aligned with the provider switch.

Both paths now consistently use JoyPixels regex/config toggles (regShortNames, ASCII mode, risky ASCII mode).


109-115: getEmojiConfig export mapping is well-scoped for a gradual migration.

Keeping emojione as the outward key while wiring it to joypixels is a good compatibility bridge for this phase.

Comment thread apps/meteor/app/emoji-emojione/lib/getEmojiConfig.ts
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarification on emoji migration from emojione to emoji-toolkit

3 participants