ref(core): Export browser-specific span start APIs - #23361
Draft
Lms24 wants to merge 2 commits into
Draft
Conversation
Contributor
size-limit report 📦
|
`@sentry/core/browser` now exports `startSpan`, `startInactiveSpan`, `startSpanManual` and `startIdleSpan` variants that install `spanStreamingIntegration` on the client before starting the span. `@sentry/core` and `@sentry/core/server` keep serving the plain ones. This is what lets `@sentry/browser`'s `init()` stop referencing the integration in a follow-up, so error-only bundles can tree-shake the whole span streaming graph. `init()` still pushes it here, so nothing changes behaviourally or size-wise yet. Because both variants share their names, the root entry's star exports of `server-exports` and `browser-exports` become ambiguous; `index.ts` pins them to the plain variants with explicit re-exports. The same applies to every meta-framework `index.types.ts` that star-exports both its client and server entry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Lms24
force-pushed
the
lms/ref-core-browser-span-apis
branch
from
August 12, 2026 16:50
e69bc0e to
c75bc8e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a preparation for making
spanStreamingIntegrationtree-shakeable. End state: BrowserSentry.init/client setup no longer referencesspanStreamingIntegrationin code. Instead, everystart*Span*call checks if the integration is already set up. If not, it initializes it. This way, only usage of a span starting API will add the bundle size for spanStreamingIntegration.Before we make the tree shaking-relevant changes to our browser instrumentation, this PR lays the groundwork:
startSpan,startInactiveSpan,startSpanManualandstartIdleSpanto the@sentry/core/browsersubpath exportspanStreamingIntegrationinto@sentry/core/browserstartSpanet. al. are imported from@sentry/coreor any meta framework packages (in user code)