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

@sentry/node package size is pretty big #2090

Closed
Siilwyn opened this issue May 28, 2019 · 19 comments
Closed

@sentry/node package size is pretty big #2090

Siilwyn opened this issue May 28, 2019 · 19 comments

Comments

@Siilwyn
Copy link

Siilwyn commented May 28, 2019

👋 hi there, I'm using Sentry for fatal error reporting on a CLI tool and a lambda server and I'm looking into moving from raven to @sentry/node. However I noticed that the package size has increased from 170kB to 1.7MB.
I'm trying to keep the CLI size down without so the parsing time is low when started, same for the server.

@sentry/node
install size

raven
install size

Inspecting locally the biggest offenders are:

image

Seems like the double dist and esm output does not work in the size favor, thoughts?

@Siilwyn
Copy link
Author

Siilwyn commented May 28, 2019

💭 One simple opportunity would be to have the promise implementation being passed as input so the consumer can decide if a polyfill is needed.

@denizdogan
Copy link

Using @sentry/browser in a React project and bundling with Parcel, ~102 kB of the bundle (more than 25% of the total size) comes from the Sentry dependency. If there's anything I can do to reduce the size of this dependency, let me know! 👍

@kamilogorek
Copy link
Contributor

@denizdogan
Copy link

@kamilogorek That's weird, maybe it's just the way that I use Parcel that's making it this way? Because my output bundle size is 393.07 kB and using a bundle visualizer tool, it looks like @sentry/browser takes 38 kB. Then a bunch of other Sentry libraries (assuming they're dependencies) take up the rest of the 102 kB.

image

@kamilogorek
Copy link
Contributor

@denizdogan can you explain how you visialize this exactly? I can take a look at it if you provide a small repro case

@denizdogan
Copy link

@kamilogorek I've made a small reproduction repository with instructions here: https://github.com/denizdogan/sentry-parcel-bundle-size Thanks!

@kamilogorek
Copy link
Contributor

@denizdogan not sure what's the state of Parcel 1, but I checked and it indeed produces much bigger bundle than let's say Webpack.

However, parcel@next, which is alpha version of v2, works great with basic config:

/sentry/repros/sentry-parcel-bundle-size:(master) λ: ls -alh dist/browser/
-rw-r--r--  1 kamilogorek  staff    58K Jan 30 15:19 index.js
/sentry/repros/sentry-parcel-bundle-size:(master) λ: gzip -9 dist/browser/index.js
/sentry/repros/sentry-parcel-bundle-size:(master) λ: ls -alh dist/browser/
-rw-r--r--  1 kamilogorek  staff    17K Jan 30 15:19 index.js.gz

Add this parcel config to package.json:

  "targets": {
    "browser": {
      "context": "browser",
      "includeNodeModules": true,
      "outputFormat": "global"
    }
  }

npm i parcel@next and then npx parcel@next bundle src/index.js

@denizdogan
Copy link

@kamilogorek I'll just attribute the problem to Parcel 1 then :) Thanks for your help

@chaffeqa
Copy link

been lookin into why this hasnt been brought up... so according to webpack bundle visualizer, even after all terser optimizations, the browser version is still one of the biggest deps in our bundle:

Screenshot 2020-05-21 20 33 48

Is there any work being done to reduce this? i just find it hard to believe that the error reporting bundle is nearly as big as react (the core of the app)

@jontelm
Copy link

jontelm commented Jun 12, 2020

I see the same with the browser bundle
image

@ricardovanlaarhoven
Copy link

My sentry is 65KB parsed and gzipped 18kb which is the same as the whole Vue package, and even larger then Vuetify!
Even if it's 18kb gzipped this is about 20% of my application's chunk-venoders/start up javascript
image

@STEVEOO6
Copy link

image

@ricardovanlaarhoven ditto!

@timuric
Copy link

timuric commented Sep 16, 2020

The size is enormous for an error tracking utility
image

@peterbakonyi05
Copy link

I can also confirm this as a big issue, probably the only reason why we are still considering to use other error reporting tools since performance is really important in most apps.

In our vendor bundle Sentry is the third biggest dependency:

  • material ui components: 51kB
  • react dom production: 35kB
  • sentry: 21kB

Screenshot 2021-02-17 at 13 51 37

@kamilogorek
Copy link
Contributor

@peterbakonyi05 we already working on it, fingers crossed for a fast delivery :)

@peterbakonyi05
Copy link

@kamilogorek Amazing news, thank you! 🙏

@veighthedev
Copy link

veighthedev commented Feb 17, 2021

image
Sentry's Electron SDK is even 670 KB bundled and minified.

At this point, we can't use Sentry, so I am really looking forward to the next update 🙏

@peterbakonyi05
Copy link

@SentoxAIO Something seems to be wrong with that screenshot because gzipped size is 0. Gzipped size should be the most relevant for performance hit (even for Electron probably). If you check the screenshot I attached, stat size is 260kB but actual gzipped size shipped in the browser is 21kB

@kamilogorek
Copy link
Contributor

Duplicate of #2707 will close to keep it tidy

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

No branches or pull requests

10 participants