feat(bun): Add initWithoutDefaultIntegrations and getDefaultIntegrationsWithoutPerformance#22036
Conversation
…onsWithoutPerformance Brings @sentry/bun to parity with @sentry/node by adding a getDefaultIntegrationsWithoutPerformance() helper and an initWithoutDefaultIntegrations() entry point. init() and getDefaultIntegrations() are refactored to route through them, so existing default behavior is unchanged.
There was a problem hiding this comment.
Pull request overview
Adds initWithoutDefaultIntegrations() and getDefaultIntegrationsWithoutPerformance() to @sentry/bun to align its public SDK surface with @sentry/node, while preserving existing init()/getDefaultIntegrations() behavior via an internal _init helper.
Changes:
- Introduces
getDefaultIntegrationsWithoutPerformance()and refactorsgetDefaultIntegrations()to build on it. - Introduces
initWithoutDefaultIntegrations()and refactorsinit()to delegate through_init(...). - Exports the new functions from the package entry point and adds unit tests covering both.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/bun/src/sdk.ts | Adds new default-integration helper, adds initWithoutDefaultIntegrations, refactors init() through _init. |
| packages/bun/src/index.ts | Exports the new public SDK functions from the Bun package entry point. |
| packages/bun/test/init.test.ts | Adds tests asserting no-default-integration behavior and “without performance” integration set behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (options.defaultIntegrations === undefined) { | ||
| options.defaultIntegrations = getDefaultIntegrations(options); | ||
| options.defaultIntegrations = getDefaultIntegrationsImpl(options); | ||
| } |
| export function getDefaultIntegrations(options: Options): Integration[] { | ||
| /** Get the default integrations for the Bun SDK, excluding performance integrations. */ | ||
| export function getDefaultIntegrationsWithoutPerformance(): Integration[] { | ||
| // We return a copy of the defaultIntegrations here to avoid mutating this |
Use nullish coalescing so a nullish defaultIntegrations falls back to the defaults (matching @sentry/node), and clarify the integrations comment.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 95689aa. Configure here.
| expect(full).toContain('Performance integration'); | ||
| expect(withoutPerformance).not.toContain('Performance integration'); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Missing integration or E2E test
Low Severity
This feat PR adds public initWithoutDefaultIntegrations and getDefaultIntegrationsWithoutPerformance exports but only extends unit tests. Per project review guidelines, feature work should include at least one integration or E2E test covering the new behavior.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 95689aa. Configure here.


Brings
@sentry/bunto parity with@sentry/nodeby adding:getDefaultIntegrationsWithoutPerformance()— the default integration set without the performance/tracing integrations.initWithoutDefaultIntegrations()— initializes the SDK without adding any default integrations, for error-only setups.init()andgetDefaultIntegrations()are refactored to route through these (via an internal_inithelper), so the existing default behavior is unchanged. Both new functions are exported from the package entry point, matching the@sentry/nodesurface.Includes unit tests covering both new functions.
Fixes #14504