Skip to content

fix(EmojiPicker): drop @emoji-mart/react peer dependency - #3255

Open
oliverlaz wants to merge 1 commit into
masterfrom
fix/drop-emoji-mart-react-peer-dep
Open

fix(EmojiPicker): drop @emoji-mart/react peer dependency#3255
oliverlaz wants to merge 1 commit into
masterfrom
fix/drop-emoji-mart-react-peer-dep

Conversation

@oliverlaz

@oliverlaz oliverlaz commented Aug 4, 2026

Copy link
Copy Markdown
Member

🎯 Goal

@emoji-mart/react declares react as ^16.8 || ^17 || ^18 in its peerDependencies β€” React 19 is missing. Integrators on React 19 therefore hit peer-dependency resolution errors on install and have to add package.json overrides to get past them, even though the package works fine on React 19 in practice.

The wrapper that package provides is ~20 lines of glue around the emoji-mart Picker custom element. Rather than asking every React 19 integrator to carry an override, we vendor it and drop the dependency.

πŸ›  Implementation details

Vendored the wrapper - new src/plugins/Emojis/Picker.tsx, taken from @emoji-mart/react (MIT, Copyright (c) Missive). Behaviour is identical to upstream;

@emoji-mart/react declares react as ^16.8 || ^17 || ^18, omitting React
19, so integrators on React 19 hit peer-dependency errors and have to add
package.json overrides even though the package works fine there.

Vendor its ~20-line wrapper around the emoji-mart Picker custom element
instead (MIT, from missive/emoji-mart) and remove the dependency from
peerDependencies, peerDependenciesMeta and devDependencies. emoji-mart
and @emoji-mart/data remain optional peer dependencies.

This also lets us drop the CJS default-unwrapping workaround from #3199,
which existed because @emoji-mart/react ships CJS with the component on
exports.default and broke under strict ESM interop.

Not a breaking change: @emoji-mart/react was an optional peer dependency
and nothing in the SDK imports it any more.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

πŸ“ Walkthrough

Walkthrough

Changes

The PR adds a local React Picker wrapper for the emoji-mart custom element. EmojiPicker uses the wrapper and its props type. Tests cover mounting, updates, StrictMode, and cleanup. The @emoji-mart/react dependency entries are removed.

Emoji picker integration

Layer / File(s) Summary
Picker wrapper and lifecycle validation
src/plugins/Emojis/Picker.tsx, src/plugins/Emojis/__tests__/Picker.test.tsx
Adds the Picker component with prop forwarding, rerender updates, mount initialization, and unmount cleanup. Tests cover rendering, StrictMode, theme updates, and removal.
EmojiPicker wiring and dependency removal
src/plugins/Emojis/EmojiPicker.tsx, package.json
Updates EmojiPicker to use the local Picker and PickerProps. Removes @emoji-mart/react from peer, optional peer, and development dependencies.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: martincupela, arnautov-anton

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
Title check βœ… Passed The title clearly and concisely describes removal of the @emoji-mart/react peer dependency.
Description check βœ… Passed The description provides the goal and implementation details, and the stated absence of UI changes makes the missing UI Changes section non-critical.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/drop-emoji-mart-react-peer-dep

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.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Size Change: +154 B (+0.02%)

Total Size: 884 kB

πŸ“¦ View Changed
Filename Size Change
dist/cjs/emojis.js 2.65 kB +72 B (+2.79%)
dist/es/emojis.mjs 2.59 kB +82 B (+3.27%)
ℹ️ View Unchanged
Filename Size
dist/cjs/audioProcessing.js 1.74 kB
dist/cjs/channel-detail.js 23.3 kB
dist/cjs/index.js 293 kB
dist/cjs/mp3-encoder.js 814 B
dist/cjs/ReactPlayerWrapper.js 546 B
dist/cjs/useChannelHeaderOnlineStatus.js 41.2 kB
dist/cjs/useMessageComposerController.js 1.01 kB
dist/cjs/useNotificationApi.js 57.9 kB
dist/css/channel-detail.css 2.84 kB
dist/css/emoji-picker.css 178 B
dist/css/emoji-replacement.css 456 B
dist/css/index.css 41.4 kB
dist/es/audioProcessing.mjs 1.65 kB
dist/es/channel-detail.mjs 22.7 kB
dist/es/index.mjs 290 kB
dist/es/mp3-encoder.mjs 768 B
dist/es/ReactPlayerWrapper.mjs 485 B
dist/es/useChannelHeaderOnlineStatus.mjs 40.6 kB
dist/es/useMessageComposerController.mjs 937 B
dist/es/useNotificationApi.mjs 56.7 kB

compressed-size-action

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/plugins/Emojis/Picker.tsx (1)

28-29: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Document the ESLint exception.

Add a reason before the suppression. The effect must create the picker once. Prop changes use instance.current.update(props).

Proposed change
+    // Create the picker once. Prop changes use instance.current.update(props) above.
     // eslint-disable-next-line react-hooks/exhaustive-deps
     }, []);

As per coding guidelines, β€œDo not suppress ESLint/Prettier rules broadly; justify and scope exceptions when necessary.”

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/plugins/Emojis/Picker.tsx` around lines 28 - 29, Add a concise
justification for the react-hooks/exhaustive-deps suppression next to the
disable directive in the effect that creates the picker, stating that it
intentionally runs once and subsequent prop changes are handled through
instance.current.update(props).

Source: Coding guidelines

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/plugins/Emojis/Picker.tsx`:
- Around line 28-29: Add a concise justification for the
react-hooks/exhaustive-deps suppression next to the disable directive in the
effect that creates the picker, stating that it intentionally runs once and
subsequent prop changes are handled through instance.current.update(props).

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 029e94ed-44e4-4386-ad63-81f110204be5

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 972b68c and 85bb342.

β›” Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
πŸ“’ Files selected for processing (4)
  • package.json
  • src/plugins/Emojis/EmojiPicker.tsx
  • src/plugins/Emojis/Picker.tsx
  • src/plugins/Emojis/__tests__/Picker.test.tsx
πŸ’€ Files with no reviewable changes (1)
  • package.json

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 85.19%. Comparing base (972b68c) to head (85bb342).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3255      +/-   ##
==========================================
+ Coverage   85.18%   85.19%   +0.01%     
==========================================
  Files         507      508       +1     
  Lines       15949    15958       +9     
  Branches     5025     5025              
==========================================
+ Hits        13586    13596      +10     
+ Misses       2363     2362       -1     

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants