-
Notifications
You must be signed in to change notification settings - Fork 61
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
Do we need the communication-calling package if we are only using the chat? #3994
Comments
@reliccare in creating the initial NPM package we had decided for ease of development to include everything into one package. So for the NPM dependencies today we ask that you will need to include all of them. Ideally with your package you should not be using any Calling related imports so when you webpack everything it should be tree-shaken out of your bundle and you should only have Chat (at runtime). @reliccare can you confirm that you are explicitly not using any imports related to Calling from the UI Library in your web application? If you are still seeing calling and video-effects as part of your bundle then we can do some investigation as to why those dependencies are being brought in. @vhuseinova-msft can we try making a test app only including the Chat composite and then use webpack-bundle-analyzer to determine if we are bringing in video-effects or Calling into that generated bundle? |
@alkwa-msft - Thank you for your response. I will double check on tree shaking bit but I can confirm that we are not using any Calling imports. The earlier post in fact points to this issue where there was no import for calling library but it was included. Appreciate your support! |
@alkwa-msft, thanks for sharing more details! |
@reliccare 1.5.1-beta.5 is quite old. We would suggest you update to a more recent version. If you would prefer to stay on beta, we would suggest 1.11.0-beta.2 https://www.npmjs.com/package/@azure/communication-react?activeTab=versions |
@alkwa-msft - I can confirm that we are using 1.11.0 version. Given below are the dependencies from our package.json. "dependencies": { You will notice that there is no direct import of communication-calling. However, once the build is done, here is what I see So either the issue is not resolved or I am missing something that I am not able to understand why communication-calling library will be included in the built package. |
I ran a test on one of my own test repositories (https://github.com/alkwa-msft/bundle-size-calling) you can also try out as well. On main we use Calling and so our webpack bundle analysis does indicate we are including Calling. I made another branch (alkwa/remove-calling) and when I did a webpack bundle analysis I don't see any calling in there (I am still trying to use the Chat Composite so I am still using the UI Library) The way I was able to remove Calling was to make sure a) I wasn't importing anything from the calling side and b) If I was importing, then I wasn't using those calling related components. If you feel comfortable sharing a snippet with us for more analysis we would be happy to review. (Something that could be helpful for debugging) |
Thank you @alkwa-msft. I will work with my team to create a version that we can share with you for your review. I will try to share something by Wednesday this week. I have confirmed that we are not importing anything from calling side which is why it's a bit surprising to see calling component in the bundle. |
Thanks @reliccare ! |
@vhuseinova-msft - We are not using composites. Instead we are using individual react components in our app. The two libraries we are using are listed below. I am working on getting a version prepared that we can share in public so you can see the problem in the react app. |
Hi @vhuseinova-msft - You can access the application that we are building at https://github.com/reliccare/public/tree/main. If you run the build and analyze the package, you will be able to view the issue that we are encountering. Thanks for your help and let me know if there are any questions. |
Thank you for sharing it! Please allow us to look into this and we would get back to you shortly. |
Hi @reliccare ! I just wanted to share a quick update that I was able to reproduce the issue and I can confirm that it's an issue in Web UI library. |
Thank you @vhuseinova-msft for confirmation. Looking forward to the next steps / resolution. |
Just another quick update: I have investigated the issue a little bit more and I see the issue when |
Thank you @vhuseinova-msft for the method. I believe usePropsFor hook is used correctly with Web UI Library. Let us know if you see any issue with the hook usage. |
Hi @vhuseinova-msft - Is there an update on this ticket? We need help reducing the load time on our app. It's becoming an issue as we are trying to roll this out to a customer. |
Hi @reliccare, sorry for the delay. As a workaround for now, could you try to exclude the calling dependencies with |
Thanks @vhuseinova-msft - Thanks. We will try that. Just out of curiosity - Is ACS UI Library not a focus area? Asking because we are using ACS heavily in our product development and knowing the direction will help us plan our internal ACS strategy. |
Yes, UI Library is a focus for ACS. The workaround is to unblock you for the moment as it will take some time to fix and release the change needed. Could you please let me know if the workaround unblocks you? |
I am wondering if this problem was addressed by ACS Team after the issue was brought up. This is a serious issue for React Apps & I think it will help the entire community to relook at the dependencies. Requesting an update from anyone in ACS team.
Thank you!
Discussed in #3208
Originally posted by DercilioFontes June 15, 2023
The communication-calling package is huge, and I was trying to reduce my app/website size.
I didn't install the
@azure/communication-calling
, but it is a dependency that greatly impacts my bundle size. Check image:Is there a way to not have it bundled if it is not used?
My stack:
The text was updated successfully, but these errors were encountered: