Skip to content
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

support treeshaking to reduce bundle size for web project ? #1949

Closed
1 of 2 tasks
echoontheway opened this issue Feb 20, 2021 · 4 comments
Closed
1 of 2 tasks

support treeshaking to reduce bundle size for web project ? #1949

echoontheway opened this issue Feb 20, 2021 · 4 comments

Comments

@echoontheway
Copy link
Contributor

echoontheway commented Feb 20, 2021

it seems otel grows bigger and bigger, perhaps we can add an es entry like module in package.json

  • This only affects the JavaScript OpenTelemetry library
  • This may affect other libraries, but I would like to get opinions here first
@echoontheway echoontheway changed the title support treeshaking to reduce bundle size for web project support treeshaking to reduce bundle size for web project ? Feb 20, 2021
@jessebond2
Copy link

I'd like to second this request. I'm profiling the impact on our production build and noticing that adding a number of opentelemetry packages is adding roughly 60kb~ to the final build, which is really large. It will have a negative impact on frontend performance...

@vmarchaud
Copy link
Member

@jessebond2 Could you please provide the list of otel dependencies you are using ? If you can also have the details of which package is the heaviest, that would help a lot !
For information: there are work done to ship ESM version (#2112) so components are better treeshaked (at least we hope)

@vmarchaud vmarchaud added Discussion Issue or PR that needs/is extended discussion. feature-request and removed Discussion Issue or PR that needs/is extended discussion. labels Apr 16, 2021
@jessebond2
Copy link

jessebond2 commented Apr 21, 2021

Hey @vmarchaud, sorry for the delayed response. Here's the list of packages I tried using and the incremental size diffs each package added. This was from the output of our production webpack build.

image

I think otel/core added around 10KB~ but wasn't listed in the table

@pichlermarc
Copy link
Member

We've enabled tree-shaking in #3329.
There's an ongoing effort to further improve over at https://github.com/open-telemetry/opentelemetry-sandbox-web-js/ 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants