Skip to content

ref(core): Move browser-only types out of core - #23723

Merged
mydea merged 1 commit into
developfrom
feat/move-browser-types-out-of-core
Aug 28, 2026
Merged

mydea merged 1 commit into
developfrom
feat/move-browser-types-out-of-core

Conversation

@mydea

@mydea mydea commented Aug 28, 2026

Copy link
Copy Markdown
Member

Relocates browser-specific types that were exported from @sentry/core's browser entry (browser-exports.ts) but are never used by core's own logic. They now live in the package where they belong, next to their only consumers.

Moved to @sentry/browser-utils (the package containing the xhr/dom/history instrumentation that produces this data):

  • HandlerDataXhr, HandlerDataDom, HandlerDataHistory
  • SentryWrappedXMLHttpRequest, SentryXhrData (the latter had no external consumers at all — it's only referenced internally by SentryWrappedXMLHttpRequest)

Moved to @sentry/browser (client.ts, its sole consumer):

  • BrowserClientProfilingOptions

Why these and not the rest

The other types in that export block stay in core because moving them isn't clean:

  • XhrBreadcrumbHint is genuinely used by core's Client API.
  • BrowserClientReplayOptions is consumed by @sentry/feedback, which only depends on @sentry/core — moving it would force a new dependency.
  • XhrBreadcrumbData is the data counterpart to XhrBreadcrumbHint; splitting the pair across packages for little gain.

The chosen moves are safe because every consumer (browser, browser-utils, replay-internal) already depends on @sentry/browser-utils, so no new dependency edges or cycles are introduced.

Note

These types were only exposed via the browser export condition of @sentry/core (they are not in core's main/node index), so this removes them from that surface. Downstream imports have been repointed to @sentry/browser-utils / @sentry/browser accordingly.

Relocate browser-specific types that were exported from `@sentry/core`'s
browser entry but never used by core itself.

- `HandlerDataXhr`, `HandlerDataDom`, `HandlerDataHistory`,
  `SentryWrappedXMLHttpRequest` and `SentryXhrData` move to
  `@sentry/browser-utils`, where the actual instrumentation lives.
- `BrowserClientProfilingOptions` moves to `@sentry/browser` (its only
  consumer, the browser `Client`).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@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 5fe62fa. Configure here.

SentryWrappedXMLHttpRequest,
} from './types/instrument';
export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './types/browseroptions';
export type { BrowserClientReplayOptions } from './types/browseroptions';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Public types removed without deprecation

Medium Severity

HandlerDataXhr, HandlerDataDom, HandlerDataHistory, SentryWrappedXMLHttpRequest, SentryXhrData, and BrowserClientProfilingOptions are removed from @sentry/core and @sentry/core/browser with no deprecated re-exports or changelog note. BrowserClientProfilingOptions is also missing from @sentry/browser's public entry, so existing type imports fail to compile. Flagged because the review rules call out public API removals without deprecation.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 5fe62fa. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.93 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.64 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.65 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.57 kB - -
@sentry/browser (incl. Tracing, Replay) 88.12 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.52 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.82 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.51 kB - -
@sentry/browser (incl. Feedback) 45.8 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.46 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.44 kB - -
@sentry/react 30.32 kB - -
@sentry/react (incl. Tracing) 50.84 kB - -
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.88 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.34 kB - -
CDN Bundle (incl. Tracing) 49.13 kB - -
CDN Bundle (incl. Logs, Metrics) 32.56 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.01 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.02 kB - -
CDN Bundle (incl. Tracing, Replay) 86.63 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.52 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.4 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.33 kB - -
CDN Bundle - uncompressed 89.95 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.82 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.25 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.51 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.41 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.32 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.01 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.68 kB - -
@sentry/nextjs (client) 53.41 kB - -
@sentry/sveltekit (client) 49.08 kB - -
@sentry/core/server 65.15 kB - -
@sentry/core/browser 51.91 kB - -
@sentry/node 122.69 kB +0.02% +17 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.22 kB - -
@sentry/node - without tracing 87.73 kB +0.03% +25 B 🔺
@sentry/node - without channel injection 102.36 kB +0.02% +18 B 🔺
@sentry/aws-serverless 95.88 kB +0.03% +26 B 🔺
@sentry/cloudflare (withSentry) - minified 199.69 kB - -
@sentry/cloudflare (withSentry) 496.19 kB - -

View base workflow run

@mydea
mydea marked this pull request as ready for review August 28, 2026 09:15
@mydea
mydea requested a review from a team as a code owner August 28, 2026 09:15
@mydea
mydea requested review from logaretm and msonnb and removed request for a team August 28, 2026 09:15
@mydea
mydea merged commit 1a51c1f into develop Aug 28, 2026
279 checks passed
@mydea
mydea deleted the feat/move-browser-types-out-of-core branch August 28, 2026 09:27
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.

2 participants