ref(core): Move browser-only types out of core - #23723
Conversation
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>
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 5fe62fa. Configure here.
| SentryWrappedXMLHttpRequest, | ||
| } from './types/instrument'; | ||
| export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './types/browseroptions'; | ||
| export type { BrowserClientReplayOptions } from './types/browseroptions'; |
There was a problem hiding this comment.
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)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 5fe62fa. Configure here.
size-limit report 📦
|


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,HandlerDataHistorySentryWrappedXMLHttpRequest,SentryXhrData(the latter had no external consumers at all — it's only referenced internally bySentryWrappedXMLHttpRequest)Moved to
@sentry/browser(client.ts, its sole consumer):BrowserClientProfilingOptionsWhy these and not the rest
The other types in that export block stay in core because moving them isn't clean:
XhrBreadcrumbHintis genuinely used by core'sClientAPI.BrowserClientReplayOptionsis consumed by@sentry/feedback, which only depends on@sentry/core— moving it would force a new dependency.XhrBreadcrumbDatais the data counterpart toXhrBreadcrumbHint; 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
browserexport 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/browseraccordingly.