-
Notifications
You must be signed in to change notification settings - Fork 279
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
fix(emoji-mart): simplify EmojiPicker & emojiSearchIndex #2117
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2117 +/- ##
==========================================
- Coverage 83.75% 83.65% -0.11%
==========================================
Files 316 309 -7
Lines 7191 7073 -118
Branches 2019 2002 -17
==========================================
- Hits 6023 5917 -106
+ Misses 832 821 -11
+ Partials 336 335 -1 ☔ View full report in Codecov by Sentry. |
a790fc0
to
344dd5f
Compare
41bead3
to
8ab64fd
Compare
344dd5f
to
c87b0e2
Compare
4715b40
to
22aff77
Compare
|
||
## Dropping support for built-in `EmojiPicker` (with breaking changes) | ||
|
||
By default - our SDK would ship with `emoji-mart` dependency on top of which our `EmojiPicker` component is built. And since the SDK is using `emoji-mart` for this component - it was also reused for reactions (`ReactionsList` and `ReactionSelector`) and suggestion list (`MessageInput`). This solution proved to be very uncomfortable to work with when it came to replacing either of the mentioned components (or disabling them completely) and the final applications using our SDK would still bundle certain `emoji-mart` parts which weren't needed (or seemingly "disabled") resulting in sub-optimal load times. Maintaining such architecture became a burden so we're switching things a bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default - our SDK would ship with `emoji-mart` dependency on top of which our `EmojiPicker` component is built. And since the SDK is using `emoji-mart` for this component - it was also reused for reactions (`ReactionsList` and `ReactionSelector`) and suggestion list (`MessageInput`). This solution proved to be very uncomfortable to work with when it came to replacing either of the mentioned components (or disabling them completely) and the final applications using our SDK would still bundle certain `emoji-mart` parts which weren't needed (or seemingly "disabled") resulting in sub-optimal load times. Maintaining such architecture became a burden so we're switching things a bit. | |
By default, our SDK would ship with `emoji-mart` dependency on top of which our `EmojiPicker` component is built. The SDK used `emoji-mart` for this `EmojiPicker`, reactions (`ReactionsList` and `ReactionSelector`) and suggestion list (`MessageInput`). This solution proved to be very uncomfortable to work with when it came to replacing either of the mentioned components (or disabling them completely) and the final applications using our SDK would still bundle certain `emoji-mart` parts which weren't needed (or seemingly "disabled") resulting in sub-optimal load times. Maintaining such architecture became a burden so we're switching things a bit. |
{/* TODO: extend once you have the component ready */} | ||
{/* TODO: mention that we're dropping the EmojiContext */} | ||
|
||
## Switching to opt-in mechanism (BREAKING CHANGE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Switching to opt-in mechanism (BREAKING CHANGE) | |
## Switching to the opt-in mechanism (BREAKING CHANGE) |
@@ -33,8 +33,6 @@ export type MessageInputProps< | |||
additionalTextareaProps?: React.TextareaHTMLAttributes<HTMLTextAreaElement>; | |||
/** Function to clear the editing state while editing a message */ | |||
clearEditingState?: () => void; | |||
/** If true, picking an emoji from the `EmojiPicker` component will close the picker */ | |||
closeEmojiPickerOnClick?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention this removal in the release guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should also be removed from the docs - in 2 mdx files
@@ -33,18 +29,15 @@ export const EditMessageForm = < | |||
|
|||
const { | |||
clearEditingState, | |||
closeEmojiPicker, | |||
emojiPickerIsOpen, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removal should be reflected in the docs: closeEmojiPicker, emojiPickerIsOpen, openEmojiPicker
c87b0e2
to
7a19e38
Compare
eb41697
to
517d67d
Compare
7a19e38
to
29f0738
Compare
517d67d
to
bd3d04a
Compare
29f0738
to
258de6f
Compare
3b10450
to
c6b91dc
Compare
BREAKING CHANGE: `EmojiPicker` and `EmojiIndex` have changed, see release guides in #2117 for more information
# [11.0.0-rc.2](v11.0.0-rc.1...v11.0.0-rc.2) (2023-10-27) ### Bug Fixes * **emoji-mart:** simplify EmojiPicker & EmojiIndex integration ([#2117](#2117)) ([60c24b8](60c24b8)) ### Features * **renderText:** allow custom remark and rehype plugin composition ([#2142](#2142)) ([4a25912](4a25912)) * **VirtualizedMessageList:** allow to merge custom virtuoso components with the SDK defaults ([#2140](#2140)) ([6ea9ff0](6ea9ff0)) ### BREAKING CHANGES * **emoji-mart:** `EmojiPicker` and `EmojiIndex` have changed, see release guides in #2117 for more information
e98cb6c
to
225748b
Compare
225748b
to
7d1efc2
Compare
This PR bumps our CSS package to the latest RC version which separates `emoji-mart` related styling rules and `emoji-replacement` (styling rules for the `Chat.useImageFlagEmojisOnWindows` property) from the main `index.css` to reduce final bundle size for integrators who do not wish to use these stylesheets. Fixes: #2116 NOTE: This PR is part of the `v11` release, it should should be merged only after `v4` of `stream-chat-css` lands.
7d1efc2
to
98d5735
Compare
Size Change: -248 kB (-13%) 👏 Total Size: 1.71 MB
ℹ️ View Unchanged
|
BREAKING CHANGE: `EmojiPicker` & `EmojiIndex` signatures changed, `EmojiIndex` has been renamed to `emojiSearchIndex`, both `EmojiPicker` & `emojiSearchIndex` are now optional, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information BREAKING CHANGE: `useImageFlagEmojisOnWindow` flag now requires extra style sheet import, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information Fixes: #2116 Fixes: #2094
Fixes: #2116 Fixes: #2094 BREAKING CHANGE: `EmojiPicker` & `EmojiIndex` signatures changed, `EmojiIndex` has been renamed to `emojiSearchIndex`, both `EmojiPicker` & `emojiSearchIndex` are now optional, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information BREAKING CHANGE: `useImageFlagEmojisOnWindow` flag now requires extra style sheet import, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information
## [11.0.0](v10.20.1...v11.0.0) (2023-11-27) ### ⚠ BREAKING CHANGES * **emoji-mart:** `EmojiPicker` & `EmojiIndex` signatures changed, `EmojiIndex` has been renamed to `emojiSearchIndex`, both `EmojiPicker` & `emojiSearchIndex` are now optional, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information * **emoji-mart:** `useImageFlagEmojisOnWindow` flag now requires extra style sheet import, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information * **emoji-mart:** `reactionOptions` signature has changed, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information * the first argument to `doSendMessageRequest` is now Channel instance instead of `Channel.cid` * apply the remark plugins `keepLineBreaksPlugin`, `htmlToTextPlugin` as a part of the default message text parsing, upgrade `unified` libraries ### Bug Fixes * **emoji-mart:** new reactions ([#1947](#1947)) ([14bef23](14bef23)), closes [#1935](#1935) [#1637](#1637) [#1437](#1437) [#2159](#2159) * **emoji-mart:** simplify EmojiPicker & emojiSearchIndex ([#2117](#2117)) ([a6e0a87](a6e0a87)), closes [#2116](#2116) [#2094](#2094) ### Features * apply keepLineBreaksPlugin & htmlToTextPlugin plugins to text rendering by default ([#2169](#2169)) ([e8047f2](e8047f2)), closes [#2170](#2170) [/github.com/GetStream/stream-chat-react/blob/f0bc7ba2532760cabb1db01e685a35bd3b0b64c5/src/components/Message/renderText/renderText.tsx#L158](https://github.com/GetStream//github.com/GetStream/stream-chat-react/blob/f0bc7ba2532760cabb1db01e685a35bd3b0b64c5/src/components/Message/renderText/renderText.tsx/issues/L158) * export MessageListNotifications and LinkPreviewList components and component props ([#2181](#2181)) ([a5a7e5a](a5a7e5a)) * require Channel instance as the first argument to doSendMessageRequest ([#2171](#2171)) ([2a06b88](2a06b88)) ### Chores * **deps:** bump stream-chat from 8.14.0 to 8.14.2 ([#2179](#2179)) ([4e6a59d](4e6a59d)) * **deps:** bump stream-chat from 8.14.2 to 8.14.3 ([#2185](#2185)) ([3dd8dab](3dd8dab))
BREAKING CHANGE:
EmojiPicker
&EmojiIndex
signatures changed,EmojiIndex
has been renamed toemojiSearchIndex
, bothEmojiPicker
&emojiSearchIndex
are now optional, see release guide for more informationBREAKING CHANGE:
useImageFlagEmojisOnWindow
flag now requires extra style sheet import, see release guide for more informationFixes: #2116
Fixes: #2094