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
| } finally { | ||
| vi.unstubAllGlobals(); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Feat PR missing integration tests
Medium Severity
This feat PR only adds a unit test for the __SENTRY_CHANNEL_INJECTION__ gate. Per the testing conventions, feat PRs need at least one integration or E2E test. The new bundleSizeOptimizations.excludeChannelInjection path also is not covered by the existing bundler-plugin bundle-size-optimizations fixtures that already assert the other exclude flags.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 68993db. Configure here.
size-limit report 📦
|
68993db to
c6d9d7f
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>
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.


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