GetStream / stream-chat-react

React Chat SDK ➜ Stream Chat 💬
https://getstream.io/chat/sdk/react/
Other
703 stars 275 forks source link

bug: EmojiOneColor and NotoColorEmoji fonts are being included in our bundled app even though the Emoji Picker is not used #2116

Closed solestravis closed 11 months ago

solestravis commented 1 year ago

Describe the bug

EmojiOneColor and NotoColorEmoji-flag fonts are being included in our bundle for a CRA app even though they're not being used, and this is causing our bandwidth usage to go up by 330%, which is costing our company a ton of money.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new react app
  2. Install stream-chat-react
  3. Create a sample app without any emoji picker functionality.
  4. Build the app with yarn build or npm build
  5. Inspect the resulting build, these fonts should be included in the assets folder even though the emoji picker is not being used.

Expected behavior

These files should not be included if the Emoji Picker is not being used in the app.

Screenshots

image

Bandwidth usage after adding this library to our site:

image

Package version ├─ @stream-io/stream-chat-css@3.13.0 ├─ stream-chat-react@10.10.1 └─ stream-chat@8.11.0

Desktop (please complete the following information):

Smartphone (please complete the following information):

Irrelevant

Additional context

N/A

arnautov-anton commented 1 year ago

Hey, @solestravis, we're currently working on dropping everything related/connected to emoji-mart from the SDK which in turn will resolve your issue as well. Unfortunately I can't give you an ETA at this time but keep an eye on this issue for future updates.

solestravis commented 1 year ago

@arnautov-anton Thanks for the quick response. We implemented a post build script that deletes these files in the meantime.

arian921017 commented 1 year ago

@arnautov-anton This is a very serious bug. We have also discovered that for no reason we will generate it into the build file without using the icon. Please resolve it as soon as possible.

image
arnautov-anton commented 1 year ago

Hey, @arianshirepublik, in an ongoing effort to make builds of our integrators lighter in regards to emojis we've released 11.0.0-rc.3 which solves this issue. If you're not ready to start transitioning to v11 just yet I'd suggest you to install @stream-io/stream-chat-css@rc and import required styling file from there. This CSS build omits mentioned fonts.

import "@stream-io/stream-chat-css/dist/v2/css/index.css"
// import this only if you're using built-in EmojiPicker
import "@stream-io/stream-chat-css/dist/v2/css/emoji-mart.css"

For more information, please follow #1715.

arian921017 commented 1 year ago

Hey, @arianshirepublik, in an ongoing effort to make builds of our integrators lighter in regards to emojis we've released 11.0.0-rc.3 which solves this issue. If you're not ready to start transitioning to v11 just yet I'd suggest you to install @stream-io/stream-chat-css@rc and import required styling file from there. This CSS build omits mentioned fonts.

import "@stream-io/stream-chat-css/dist/v2/css/index.css"
// import this only if you're using built-in EmojiPicker
import "@stream-io/stream-chat-css/dist/v2/css/emoji-mart.css"

For more information, please follow #1715.

Hey, @arianshirepublik, in an ongoing effort to make builds of our integrators lighter in regards to emojis we've released 11.0.0-rc.3 which solves this issue. If you're not ready to start transitioning to v11 just yet I'd suggest you to install @stream-io/stream-chat-css@rc and import required styling file from there. This CSS build omits mentioned fonts.

import "@stream-io/stream-chat-css/dist/v2/css/index.css"
// import this only if you're using built-in EmojiPicker
import "@stream-io/stream-chat-css/dist/v2/css/emoji-mart.css"

For more information, please follow #1715.

Hi @solestravis I changed to version 11.0.0-rc.3 and it works normally. Thank you

stream-ci-bot commented 11 months ago

:tada: This issue has been resolved in version 11.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: