feat(node): Add build-time opt-out for runtime channel injection - #23475
feat(node): Add build-time opt-out for runtime channel injection#23475mydea wants to merge 1 commit into
Conversation
size-limit report 📦
|
68993db to
c6d9d7f
Compare
c6d9d7f to
1d27eb4
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1d27eb4. Configure here.
| // Install as early as possible, before the app imports its instrumented modules. | ||
| const useChannelInjection = | ||
| (typeof __SENTRY_CHANNEL_INJECTION__ === 'undefined' || __SENTRY_CHANNEL_INJECTION__) && | ||
| options.enableRuntimeChannelInjection !== false; |
There was a problem hiding this comment.
Missing integration test for feat
Medium Severity
Flagging per the testing conventions in the PR review guidelines: this feat only adds a unit test that stubs __SENTRY_CHANNEL_INJECTION__. There is no integration or E2E coverage for bundleSizeOptimizations.excludeChannelInjection wiring the define through the bundler plugins. The existing bundle-size-optimizations fixtures under dev-packages/bundler-plugin-integration-tests already exercise the other flags and were not extended for this one.
Additional Locations (1)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 1d27eb4. Configure here.
1d27eb4 to
e670b7c
Compare
Introduce a `__SENTRY_CHANNEL_INJECTION__` treeshaking flag (mirroring `__SENTRY_TRACING__`) that removes the runtime diagnostics-channel injection when text-replaced with `false`, and expose it through the bundler plugins' `bundleSizeOptimizations.excludeChannelInjection`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e670b7c to
40ae0c4
Compare


Stacked on #23473.
Adds a build-time opt-out for the Node SDK's runtime diagnostics-channel injection, complementing the runtime
enableRuntimeChannelInjectionoption from the base PR.__SENTRY_CHANNEL_INJECTION__treeshaking flag, mirroring__SENTRY_TRACING__: when a bundler text-replaces it withfalse, theregisterDiagnosticsChannelInjection()/detectOrchestrionSetup()block ininitis dropped, and its transitive orchestrion-register code tree-shakes away.bundleSizeOptimizations.excludeChannelInjection, which maps to__SENTRY_CHANNEL_INJECTION__ = falsevia the same mechanism asexcludeTracing.(typeof __SENTRY_CHANNEL_INJECTION__ === 'undefined' || __SENTRY_CHANNEL_INJECTION__) && options.enableRuntimeChannelInjection !== false.🤖 Generated with Claude Code