|
|
|
Why is Microsofts chat widget over 6MB of JavaScript code?
|
|
5 points
by blueappconfig
723 days ago
|
|
We where going to add Microsoft Omnichannel to our webpage but we discovered that running it, a small chat widget takes up a staggering 6MB of pure javascript code. Anyone known what is going on? See this example from microsoft.net: https://csimplreslivechatsamples.blob.core.windows.net/$web/AddCustomHeaderButton.html And the results here:
https://i.imgur.com/I77JvjO.png |
|
However, they do offer the ability to build your own omnichannel UI using their React components (https://github.com/microsoft/omnichannel-chat-widget), and from their storybook (https://microsoft.github.io/omnichannel-chat-widget/docs/sto...) those file sizes look smaller, even with the Storybook code included. Or you can build your own from their SDK (https://github.com/microsoft/omnichannel-chat-sdk).
Maybe with some good tree-shaking, dynamic lazy-loading of imports, and good serverside compression with gzip/brotli, it miiiiiiight get small enough to be serviceable? It's still a lot of bloat... but if you need all those features and don't mind slowing everything down for your customers...
I'd probably just put my own little popup chat icon in the lower right and use that to dynamically load the rest of the script, only for those who really want to start a chat. That way, at least you don't force the entire bundle on every website visitor.