Skip to content

Conversation

@FizaSiddique123
Copy link

@FizaSiddique123 FizaSiddique123 commented Dec 8, 2025

Proposed changes (including videos or screenshots)

This PR updates the emoji picker to use the newer emoji-toolkit dataset instead of the deprecated emojione-assets JSON metadata.

What was changed

  • Updated generateEmojiIndex.mjs so it resolves emoji metadata from emoji-toolkit/emoji.json using require.resolve().
  • Removed dependency on emojione-assets for emoji data.
  • Added "emoji-toolkit": "^7.0.1" to apps/meteor/package.json and removed "emojione-assets".
  • Sprite generation logic remains unchanged for now and still reads PNGs from emojione-assets to avoid breaking the existing UI.
    (A follow-up PR can migrate sprites to JoyPixels if needed.)

Why this change is needed

emojione-assets is outdated and no longer maintained. emoji-toolkit provides an updated, actively maintained emoji dataset that aligns Rocket.Chat with current emoji standards and prepares the codebase for future improvements.

This PR completes the step requested in #24917 regarding replacing the old emoji metadata source.

Issue(s)

Closes #24917

Steps to test or reproduce

  1. Build or run Rocket.Chat normally (yarn dev).
  2. Open the emoji picker in any message box.
  3. The UI should behave exactly the same as before.
    (No new sprites yet — only the metadata source has been updated.)
  4. If the generator script is executed (generateEmojiIndex.mjs), it will now load data from emoji-toolkit instead of emojione-assets.

Further comments

  • This PR intentionally does not regenerate sprite sheets, since doing so would require replacing PNG assets as well.
  • The current change focuses only on updating the data source, which is the first required step in the issue.
  • Maintainers can choose when to regenerate sprites or migrate image assets in a follow-up PR.

Summary by CodeRabbit

  • Chores

    • Improved emoji resource resolution to use package-resolved sources.
    • Added maintenance scripts for testing, versioning, release, storybook, and Docker.
    • Cleaned up app manifest and development-only metadata.
  • Bug Fixes

    • Improved startup error handling and clearer messaging when emoji resources are missing.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Dec 8, 2025

⚠️ No Changeset found

Latest commit: 1014ec6

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.

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
Contributor

dionisio-bot bot commented Dec 8, 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

@CLAassistant
Copy link

CLAassistant commented Dec 8, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Walkthrough

Replaces hard-coded emoji.json path with Node's createRequire + require.resolve for dynamic resolution, adds top-level try/catch that logs and calls process.exit(1) on resolution failure in generateEmojiIndex.mjs. Updates apps/meteor/package.json scripts (adds many npm scripts) and introduces a stray top-level develop token/newline.

Changes

Cohort / File(s) Summary
Emoji index generation
apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs
Replaced fixed asset path for emoji.json with a createRequire-based resolver and require.resolve; added top-level try/catch around resolution that logs errors and exits (process.exit(1)) on failure. Retains use of emojione-assets sprite path and existing file checks.
Package metadata / scripts
apps/meteor/package.json
Added multiple new npm scripts (e.g., chore/update-emoji-library-24917, test, version, storybook, prepare, docker:start, etc.); introduced an unexpected stray develop token/newline before dependencies; minor EOF newline change.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review generateEmojiIndex.mjs for correctness of createRequire usage and that require.resolve targets the intended package path across environments.
  • Verify the implications of calling process.exit(1) during resolution failures (CI/build vs. interactive runs) and ensure logged messages are clear.
  • Inspect apps/meteor/package.json script additions for correctness and the stray develop token that may break JSON structure or tooling.

Poem

🐰 I dug through node_modules under moonlight,
Replaced the hard path with a resolver bright.
If emoji.json hides, I raise the alarm —
Log a shout, then hop out of harm.
Hooray for new scripts and a happier night! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the emoji picker to use emoji-toolkit instead of the deprecated emojione-assets.
Linked Issues check ✅ Passed The PR fully addresses issue #24917 requirements: replaces emojione-assets with emoji-toolkit, expands emoji coverage, and follows emoji-toolkit migration guidance.
Out of Scope Changes check ✅ Passed All changes are in scope: updates to generateEmojiIndex.mjs and package.json directly support the emoji-toolkit migration objective with no unrelated modifications.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent 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 5e8fafe and efe2eb2.

📒 Files selected for processing (1)
  • apps/meteor/package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-10T19:06:20.146Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37408
File: apps/meteor/client/views/admin/ABAC/useRoomAttributeOptions.tsx:53-69
Timestamp: 2025-11-10T19:06:20.146Z
Learning: In the Rocket.Chat repository, do not provide suggestions or recommendations about code sections marked with TODO comments. The maintainers have already identified these as future work and external reviewers lack the full context about implementation plans and timing.

Applied to files:

  • apps/meteor/package.json
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.

Applied to files:

  • apps/meteor/package.json
🪛 Biome (2.1.2)
apps/meteor/package.json

[error] 60-60: unexpected character /

(parse)


[error] 60-60: expected , but instead found update

Remove update

(parse)


[error] 60-60: expected : but instead found -e

Remove -e

(parse)


[error] 60-60: Invalid exponent part

(parse)


[error] 60-60: expected , but instead found moji

Remove moji

(parse)


[error] 60-60: Minus must be followed by a digit

(parse)


[error] 60-60: expected , but instead found library

Remove library

(parse)


[error] 60-60: expected : but instead found -24917

Remove -24917

(parse)


[error] 61-61: expected , but instead found "test"

Remove "test"

(parse)


[error] 68-69: unexpected character =

(parse)


[error] 69-69: unexpected character =

(parse)


[error] 69-69: unexpected character =

(parse)


[error] 69-69: unexpected character =

(parse)


[error] 69-69: unexpected character =

(parse)


[error] 69-69: unexpected character =

(parse)


[error] 69-69: unexpected character =

(parse)


[error] 70-70: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 70-70: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 70-70: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 70-70: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 71-71: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 71-71: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 71-71: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 72-72: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 73-73: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 73-73: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 73-76: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 76-77: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 499-500: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

🔇 Additional comments (2)
apps/meteor/package.json (2)

207-207: Verify emoji-toolkit placement and emojione-assets retention.

The changes correctly add "emoji-toolkit": "^7.0.1" to the main dependencies section (line 207), which aligns with the PR objective to use emoji-toolkit for metadata resolution. However, per the PR notes, emojione-assets remains in devDependencies (line 432), which is appropriate since sprite PNG assets are still sourced from it.

Confirm this dual-source approach (emoji metadata from emoji-toolkit, sprites from emojione-assets) is intentional and documented, or flag if emojione-assets should be removed.

Also applies to: 432-432


60-77: Invalid JSON syntax—verify current file state.

The file appears to contain critical parsing defects at lines 60–77, including:

  1. Lines 60–67: Malformed scripts section with bare token chore/update-emoji-library-24917 and corrupted entries
  2. Line 69: Merge conflict marker =======
  3. Line 77: Stray develop token before "dependencies"

Before proceeding, confirm the current state of apps/meteor/package.json by running:

jq empty apps/meteor/package.json

If the file is invalid, apply the provided diff to restore JSON structure. If the file already parses successfully, this comment may be based on a misinterpreted diff view.


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.

Copy link
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: 0

🧹 Nitpick comments (2)
apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs (1)

27-29: Consider removing redundant existence check.

The fs.existsSync check at line 27 is now redundant since require.resolve() at line 17 only succeeds if the file exists. If resolution fails, the script exits before reaching this check.

That said, this defensive check doesn't cause harm and might catch edge cases, so removing it is purely optional.

If you'd like to remove the redundancy:

-if (!fs.existsSync(emojiJsonFile)) {
-	console.error(`${emojiJsonFile} doesn't exist.`);
-} else {
-	const emojiJson = fs.readFileSync(emojiJsonFile);
-	generateEmojiPicker(emojiJson);
-}
+const emojiJson = fs.readFileSync(emojiJsonFile);
+generateEmojiPicker(emojiJson);
apps/meteor/package.json (1)

172-172: Consider upgrading emoji-toolkit to the latest version.

Version 7.0.1 is valid and has no known security vulnerabilities, but it is significantly outdated. The latest version is 9.0.1 (released on npm). Consider upgrading to benefit from bug fixes, performance improvements, and staying current with the package ecosystem. If upgrading is not feasible due to breaking changes, ensure the dependency is periodically reviewed.

📜 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 d0be8ad and ed97641.

📒 Files selected for processing (2)
  • apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs (1 hunks)
  • apps/meteor/package.json (2 hunks)
🔇 Additional comments (4)
apps/meteor/app/emoji-emojione/lib/generateEmojiIndex.mjs (3)

10-13: LGTM!

The use of createRequire with import.meta.url is the correct approach for resolving CommonJS modules in an ESM context. This enables proper resolution of emoji-toolkit from the workspace's node_modules.


15-22: LGTM!

The error handling is robust with clear, actionable error messages. Exiting early with a non-zero status code when the dependency cannot be resolved is appropriate for a build script.


24-24: LGTM!

This comment is helpful for maintainability. It clearly explains why emojione-assets is still referenced for sprites, aligning with the PR's scope to update only the metadata source.

apps/meteor/package.json (1)

172-172: Remove emoji-toolkit from dependencies if not used at runtime.

The package emoji-toolkit appears in both devDependencies (line 172) and dependencies (line 351). Since generateEmojiIndex.mjs is a build-time script that generates static output files, emoji-toolkit likely belongs only in devDependencies. Confirm that no runtime code directly imports emoji-toolkit; if not, remove it from dependencies.

Copy link
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: 4

Caution

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

⚠️ Outside diff range comments (1)
apps/meteor/package.json (1)

598-598: Remove emojione-assets from devDependencies.

Per the PR objectives, emojione-assets should be fully removed. However, it still remains at line 598 in devDependencies. This contradicts the stated goal of replacing the deprecated library. Remove this entry to complete the migration.

-		"emojione-assets": "^4.5.0",
📜 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 ed97641 and ac75209.

📒 Files selected for processing (1)
  • apps/meteor/package.json (2 hunks)
🧰 Additional context used
🪛 Biome (2.1.2)
apps/meteor/package.json

[error] 60-60: unexpected character /

(parse)


[error] 60-60: expected , but instead found update

Remove update

(parse)


[error] 60-60: expected : but instead found -e

Remove -e

(parse)


[error] 60-60: Invalid exponent part

(parse)


[error] 60-60: expected , but instead found moji

Remove moji

(parse)


[error] 60-60: Minus must be followed by a digit

(parse)


[error] 60-60: expected , but instead found library

Remove library

(parse)


[error] 60-60: expected : but instead found -24917

Remove -24917

(parse)


[error] 61-61: expected , but instead found "test"

Remove "test"

(parse)


[error] 79-79: The key devDependencies was already declared.

This where a duplicated key was declared again.

If a key is defined multiple times, only the last definition takes effect. Previous definitions are ignored.

(lint/suspicious/noDuplicateObjectKeys)

🔇 Additional comments (1)
apps/meteor/package.json (1)

373-373: Approve: emoji-toolkit added to dependencies.

The addition of emoji-toolkit to production dependencies is correct per the PR objectives.

@FizaSiddique123 FizaSiddique123 force-pushed the chore/update-emoji-library-24917 branch from ac75209 to 5e8fafe Compare December 8, 2025 10:35
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