elastic / apm-agent-rum-js

https://www.elastic.co/guide/en/apm/agent/rum-js/current/index.html
MIT License
279 stars 134 forks source link

Decrease bundle size #1287

Open andriijas opened 2 years ago

andriijas commented 2 years ago

the apm rum agent is one of the largest dependencies we use in our app.

Would it be possible to set a goal to shave the yak for future releases? 🐐

https://bundlephobia.com/package/@elastic/apm-rum@5.12.0

Thanks!🙏

devcorpio commented 2 years ago

Hi @andriijas,

Thanks for raising this issue!

We have had a few conversations about this and there are plans and ideas in mind to achieve what you are commenting for future releases (more likely in 6.x releases) 👍

If you don't mind, I would like to ask you a few questions:

I understand that maybe it's not possible for you to answer these questions, so please, skip if inconvenient 🙏

Many thanks, Alberto

andriijas commented 2 years ago

Thanks alberto for taking time to listen and not close down the issue (as they did over at signalR 😅)

As most js applications, we are fighting bundle size continuously trying to get more nimble and also looking at moving to SSR to ship less script to end user. As you can see in the attached screenshot from webpack bundle analyzer the elastic agent is up their with the oidc client and some other packages.

If every dependency we use could drop a kb it would have big impact. Hard to set specific goals on size.

Things you can work with is:

Screenshot 2022-10-10 at 18 02 12

Thanks!