Skip to content

feat(bun): Add initWithoutDefaultIntegrations and getDefaultIntegrationsWithoutPerformance#22036

Open
PeterWadie wants to merge 2 commits into
getsentry:developfrom
PeterWadie:feat/bun-init-without-default-integrations
Open

feat(bun): Add initWithoutDefaultIntegrations and getDefaultIntegrationsWithoutPerformance#22036
PeterWadie wants to merge 2 commits into
getsentry:developfrom
PeterWadie:feat/bun-init-without-default-integrations

Conversation

@PeterWadie

Copy link
Copy Markdown

Brings @sentry/bun to parity with @sentry/node by 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() and getDefaultIntegrations() are refactored to route through these (via an internal _init helper), so the existing default behavior is unchanged. Both new functions are exported from the package entry point, matching the @sentry/node surface.

Includes unit tests covering both new functions.

Fixes #14504

…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.
Copilot AI review requested due to automatic review settings July 8, 2026 02:07
@PeterWadie PeterWadie requested a review from a team as a code owner July 8, 2026 02:07
@PeterWadie PeterWadie requested review from JPeer264, andreiborza and mydea and removed request for a team July 8, 2026 02:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 refactors getDefaultIntegrations() to build on it.
  • Introduces initWithoutDefaultIntegrations() and refactors init() 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.

Comment thread packages/bun/src/sdk.ts Outdated
Comment on lines 172 to 174
if (options.defaultIntegrations === undefined) {
options.defaultIntegrations = getDefaultIntegrations(options);
options.defaultIntegrations = getDefaultIntegrationsImpl(options);
}
Comment thread packages/bun/src/sdk.ts Outdated
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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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');
});
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 95689aa. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

initWithoutDefaultIntegrations and getDefaultIntegrationsWithoutPerformance methods for @sentry/bun

2 participants