@sentry/bundler-plugins pulls @sentry/cli into consumers that only import ./babel-plugin
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- nodejs, typescript
调研方向
Start with the @sentry/bundler-plugins ./babel-plugin entry point and its component-annotation.js, constants.js, and experimental.js dependencies. Inspect how @sentry/cli is declared and which bundler integrations invoke it. Done means importing only ./babel-plugin no longer installs a duplicate release-upload CLI, while integrations that use the CLI still work; verify with a clean package-manager install and relevant tests.
由索引模型根据 Issue 内容生成。
描述
Summary
@sentry/bundler-plugins declares @sentry/cli as a hard dependency. Consumers that only import the ./babel-plugin entry point pay for a full sentry-cli install, including its platform binary, even though that entry point never invokes the CLI.
Impact
@sentry/react-native 8.21.0 migrated from @sentry/babel-plugin-component-annotate to @sentry/bundler-plugins/babel-plugin (getsentry/sentry-react-native#6501), because the old package is no longer published. It has exactly one import of the package:
// @sentry/react-native/dist/js/tools/sentryBabelTransformerUtils.js
const babel_plugin_1 = require("@sentry/bundler-plugins/babel-plugin");
The ./babel-plugin CJS entry is 20 KB and requires only ./component-annotation.js, ./constants.js and ./experimental.js. It never reaches sentry-cli.
Because @sentry/react-native 8.24.0 pins "@sentry/cli": "3.6.2" while @sentry/bundler-plugins 10.71.0 declares "@sentry/cli": "^2.58.6", package managers install two majors side by side. Measured in a real React Native app on macOS arm64 (Yarn 1.22.22):
| Size | |
|---|---|
@sentry/cli-darwin@3.6.2 (hoisted) |
27 MB |
@sentry/cli-darwin@2.58.6 (nested under @sentry/bundler-plugins) |
35 MB |
node_modulesgrew ~36 MB on the 8.18.0 -> 8.24.0 upgradeyarn.lockgrew 98 net lines, roughly 72 of which are the duplicated@sentry/clientry plus its eight platform packages
Every clean CI install now downloads both binaries.
Expected
Importing a babel plugin should not install a release-upload CLI.
Suggested fix
Any one of:
- publish the component-annotate babel plugin as a standalone package again
- move
@sentry/clito an optional or peer dependency, so only the bundler integrations that actually shell out to it require it - split the package so
./babel-pluginresolves without the upload machinery
Workaround
A package manager override pinning @sentry/cli to the version the SDK already uses:
"resolutions": { "@sentry/cli": "3.6.2" }
This removes the duplicate and reduces the lockfile growth from +98 to +26 lines, with no observed breakage, since the babel-plugin path never reaches the CLI.
Versions
@sentry/bundler-plugins: 10.71.0@sentry/react-native: 8.24.0react-native: 0.83.10
- 主要语言
- TypeScript
- 星标
- 8.7k
- 派生
- 1.9k
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 576
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/sentry-javascript 的其他 Issue
-
Browser Bug Next.js Traces Waiting for: Product Owner
难度 2/5 1-3 小时 新手友好度 75/100
getsentry/sentry-javascript#24672 · 1 条评论 ·
-
Flaky Test React Router Framework Spans Tests
难度 2/5 1-3 小时 新手友好度 68/100
getsentry/sentry-javascript#24348 · 1 条评论 ·
-
javascript
难度 2/5 1-3 小时 新手友好度 75/100
getsentry/sentry-javascript#24200 · 2 条评论 ·
-
javascript Task
难度 2/5 1-3 小时 新手友好度 82/100
getsentry/sentry-javascript#24134 · 1 条评论 ·
-
Cloudflare Workers javascript Tests
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-javascript#24051 · 1 条评论 ·
查看 getsentry/sentry-javascript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 90/100
TanStack/tanstack.com#1293 ·