-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Re-examine usage of sentry-cli and bundler plugins #5461
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
Comments
For the use of sentry-cli in the plugin a lot of stuff can be easily removed at compile time. Even without removing debug logging, color support one can create a binary of under 7MB on macOS by just compiling out unwanted commands, enabling LTO and disabling symbols. This is compared to the 12MB default build. This still pulls in hundreds of dependencies though like libgit2 for some release handling and the like which is probably not always needed or we could shell out. Moving the core of sentry-cli out is probably reasonable amount of work, would help compile times and potentially throw away the majority of bloat that the javascript use would not need. |
Related (would only solve some cases, but would give us an easy fix for anything webpack/vercel-y): |
|
Writing some more thoughts here so I don't forget them when we make a decision on this:
|
If we proceed with https://github.com/unjs/unplugin, we'll go in knowing we have to contribute back upstream - maybe we can fix those inconsistencies? |
If this were done as a proverbial I'm not philosophically against your translate-everything-to-js idea, but it does seem like it'd be more work (and more maintenance) than just wrapping a stripped-down cli tool. |
We have unplugin now :) |
Uh oh!
There was an error while loading. Please reload this page.
Problem Statement
#4894 (comment) brings up
sentry-cli
size issues.Essentially, due to
sentry-cli
's binary size, we require users to have some kind of bundling setup to make sure that they tree shake awaysentry-cli
in application code.Is there a way we can improve this situation?
There's also the concern here with bundlers. Right now we only have a single 1st party plugin, for webpack: https://github.com/getsentry/sentry-webpack-plugin
There is also a community vite plugin:
The more bundlers we support, the better the out of the box experience is (less finagling with
sentry-cli
).Solution Brainstorm
Sentry-cli usage
My musings from slack for the sentry-cli size problem:
sentry-cli
that pretty much only exposes the API around sourcemaps/releasesAnother option here is that we can try making adding build time plugins/steps a Step 2 in the onboarding wizard (after
yarn add
andSentry.init
). Mobile has something similar where you need to explicitly add the gradle plugin for Android for ex.Note: We'll need to DACI how exactly we make sentry-cli smaller, basically choose between re-writing the needed functionality in JS vs. stripping the CLI rust binary at compile time.
Bundlers
There is https://github.com/unjs/unplugin, which allows us to have a single codebase for bundlers (perhaps in the SDK monorepo 👀). It also uses the rollup plugin API, which @lobsterkatie does have a lot of experience with.
@asonnleitner did some awesome work with https://github.com/asonnleitner/unplugin-sentry as per #4989. We can def use that as a starting point!
The text was updated successfully, but these errors were encountered: