:wave: 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.
Inspecting locally the biggest offenders are:
Seems like the double dist
and esm
output does not work in the size favor, thoughts?
:thought_balloon: One simple opportunity would be to have the promise implementation being passed as input so the consumer can decide if a polyfill is needed.
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! 馃憤
@denizdogan it's 17.7kB gzipped - https://bundlephobia.com/result?p=@sentry/browser@5.11.2 馃
@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.
@denizdogan can you explain how you visialize this exactly? I can take a look at it if you provide a small repro case
@kamilogorek I've made a small reproduction repository with instructions here: https://github.com/denizdogan/sentry-parcel-bundle-size Thanks!
@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
@kamilogorek I'll just attribute the problem to Parcel 1 then :) Thanks for your help
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:
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)
I see the same with the browser bundle
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
@ricardovanlaarhoven ditto!
The size is enormous for an error tracking utility
Most helpful comment
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:
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)