Skip to content

feat(bun): Add initWithoutDefaultIntegrations and getDefaultIntegrationsWithoutPerformance#22036

Merged
JPeer264 merged 4 commits into
getsentry:developfrom
PeterWadie:feat/bun-init-without-default-integrations
Jul 15, 2026
Merged

feat(bun): Add initWithoutDefaultIntegrations and getDefaultIntegrationsWithoutPerformance#22036
JPeer264 merged 4 commits into
getsentry:developfrom
PeterWadie:feat/bun-init-without-default-integrations

Conversation

@PeterWadie

Copy link
Copy Markdown
Contributor

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
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.

Comment thread packages/bun/test/init.test.ts

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.

@github-actions

Copy link
Copy Markdown
Contributor

👋 @mydea, @JPeer264, @andreiborza — Please review this PR when you get a chance!

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall LGTM, just one thing I would vote to revert. The rest I'm ok to have for Bun as well

Comment thread packages/bun/src/sdk.ts

options.transport = options.transport || makeFetchTransport;

if (options.defaultIntegrations === undefined) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

m: We should leave this as before, even if it looks cleaner and is technically more correct. The reason for that is that we would check against null too with the new implementation, while the older one only matches for undefined. I don't think changing the behavior now is good (especially when other SDKs still have this check)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted — kept the === undefined check so the null-handling behavior is unchanged (and it stays consistent with @sentry/deno, which uses the same check).

@JPeer264 JPeer264 Jul 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you push it already? It seems that is still the old code

Nvm. I was checking the wrong commit 🤷

Revert the nullish-coalescing change so the null-handling behavior stays as before, consistent with @sentry/deno.

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks a lot for your contributions. I'm waiting for one more review before merging. (I'll also see if the CI is happy)

@JPeer264 JPeer264 merged commit b8e941f into getsentry:develop Jul 15, 2026
62 checks passed
nicohrubec pushed a commit that referenced this pull request Jul 15, 2026
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #22036

Co-authored-by: JPeer264 <10677263+JPeer264@users.noreply.github.com>
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

4 participants