File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,9 +21,6 @@ export declare function init(options: Options | clientSdk.BrowserOptions | NodeO
2121export declare const linkedErrorsIntegration : typeof clientSdk . linkedErrorsIntegration ;
2222export declare const contextLinesIntegration : typeof clientSdk . contextLinesIntegration ;
2323export declare const spanStreamingIntegration : typeof clientSdk . spanStreamingIntegration ;
24- // The client entry serves the `@sentry/core/browser` span-start APIs, which install span streaming
25- // on first use; the server entry serves the plain `@sentry/core` ones. Same signatures, but the
26- // star exports above are ambiguous without these.
2724export declare const startSpan : typeof clientSdk . startSpan ;
2825export declare const startSpanManual : typeof clientSdk . startSpanManual ;
2926export declare const startInactiveSpan : typeof clientSdk . startInactiveSpan ;
Original file line number Diff line number Diff line change 33 *
44 * @module
55 */
6- // These share their names with the plain variants in `server-exports`, but additionally make sure
7- // the browser span streaming integration is installed on the client before the span starts. That
8- // indirection is what lets error-only browser bundles tree-shake span streaming away entirely:
9- // `init()` never references the integration, so it's only retained when span-creating code is.
10- //
11- // `@sentry/core` pins these names to the plain variants (see `index.ts`); `@sentry/core/browser`
12- // serves the guarded ones. Browser-facing packages therefore upgrade by importing from
13- // `@sentry/core/browser` — no call site changes.
6+
147export {
158 startSpan ,
169 startInactiveSpan ,
1710 startSpanManual ,
1811 startIdleSpan ,
1912 _INTERNAL_ensureBrowserSpanStreaming ,
2013} from './tracing/browserSpanApi' ;
14+
2115export { spanStreamingIntegration } from './integrations/browserSpanStreaming' ;
2216
2317export {
Original file line number Diff line number Diff line change @@ -2,10 +2,9 @@ export * from './shared-exports';
22export * from './server-exports' ;
33export * from './browser-exports' ;
44
5- // `server-exports` and `browser-exports` both export these names (plain vs. browser-guarded
6- // variants). Explicit re-exports shadow the otherwise-ambiguous star exports and pin the root entry
7- // to the plain/server variants. Without them, importing any of these from `@sentry/core` is a
8- // link-time `SyntaxError: ... contains conflicting star exports`.
5+ // `server-exports` and `browser-exports` both export these APIs.
6+ // We need to re-export them here to disambiguate the exports for anyone importing
7+ // from `@sentry/core`. Server exports win over browser exports.
98export { startSpan , startInactiveSpan , startSpanManual } from './tracing/trace' ;
109export { startIdleSpan } from './tracing/idleSpan' ;
1110export { spanStreamingIntegration } from './integrations/spanStreaming' ;
Original file line number Diff line number Diff line change 44 * @module
55 */
66
7- // The span-start APIs and the span streaming integration exist in two variants under the same name:
8- // the plain ones here, and span-streaming-aware ones in `browser-exports`. See `browser-exports.ts`.
97export { startSpan , startInactiveSpan , startSpanManual } from './tracing/trace' ;
10- // `startIdleSpan` has no server consumer, but `@sentry/core` re-exports it — routing it through here
11- // keeps the root entry's surface unchanged.
128export { startIdleSpan } from './tracing/idleSpan' ;
139export { spanStreamingIntegration } from './integrations/spanStreaming' ;
1410
Original file line number Diff line number Diff line change @@ -18,13 +18,9 @@ import {
1818 * actually start a span. `@sentry/browser`'s `init()` deliberately doesn't reference spanStreamingIntegration,
1919 * so error-only apps tree-shake the entire span streaming graph away without needing
2020 * the `__SENTRY_TRACING__` flag.
21- *
22- * The names deliberately match the core originals: `@sentry/core/browser` serves these guarded
23- * variants, `@sentry/core` serves the plain ones, so browser-facing packages upgrade by changing
24- * only the import specifier.
2521 */
2622
27- const installed = new WeakSet < Client > ( ) ;
23+ const clientsWithIntegration = new WeakSet < Client > ( ) ;
2824
2925/**
3026 * Lazily install the browser span streaming integration.
@@ -37,11 +33,11 @@ const installed = new WeakSet<Client>();
3733export function _INTERNAL_ensureBrowserSpanStreaming ( client : Client | undefined = getClient ( ) ) : void {
3834 // The `WeakSet` is an allocation optimization, not a semantic gate — `addIntegration()` is already
3935 // idempotent by integration name, including against a user-supplied instance.
40- if ( ! client || installed . has ( client ) || ! hasSpanStreamingEnabled ( client ) ) {
36+ if ( ! client || clientsWithIntegration . has ( client ) || ! hasSpanStreamingEnabled ( client ) ) {
4137 return ;
4238 }
4339
44- installed . add ( client ) ;
40+ clientsWithIntegration . add ( client ) ;
4541 client . addIntegration ( spanStreamingIntegration ( ) ) ;
4642}
4743
Original file line number Diff line number Diff line change @@ -17,9 +17,6 @@ export {
1717 SPAN_STATUS_OK ,
1818 SPAN_STATUS_UNSET ,
1919} from './spanstatus' ;
20- // Note: `startSpan`, `startInactiveSpan`, `startSpanManual` and `startIdleSpan` are deliberately
21- // not re-exported here. They exist in a plain variant (`server-exports`) and a span-streaming-aware
22- // variant (`browser-exports`) under the same name — see `browser-exports.ts` for why.
2320export {
2421 _INTERNAL_startInactiveSpan ,
2522 continueTrace ,
Original file line number Diff line number Diff line change @@ -22,9 +22,6 @@ export declare function init(options: Options | clientSdk.BrowserOptions | serve
2222export declare const linkedErrorsIntegration : typeof clientSdk . linkedErrorsIntegration ;
2323export declare const contextLinesIntegration : typeof clientSdk . contextLinesIntegration ;
2424export declare const spanStreamingIntegration : typeof clientSdk . spanStreamingIntegration ;
25- // The client entry serves the `@sentry/core/browser` span-start APIs, which install span streaming
26- // on first use; the server entry serves the plain `@sentry/core` ones. Same signatures, but the
27- // star exports above are ambiguous without these.
2825export declare const startSpan : typeof clientSdk . startSpan ;
2926export declare const startSpanManual : typeof clientSdk . startSpanManual ;
3027export declare const startInactiveSpan : typeof clientSdk . startInactiveSpan ;
Original file line number Diff line number Diff line change @@ -17,9 +17,6 @@ export declare function init(options: Options | SentryNuxtClientOptions | Sentry
1717export declare const linkedErrorsIntegration : typeof clientSdk . linkedErrorsIntegration ;
1818export declare const contextLinesIntegration : typeof clientSdk . contextLinesIntegration ;
1919export declare const spanStreamingIntegration : typeof clientSdk . spanStreamingIntegration ;
20- // The client entry serves the `@sentry/core/browser` span-start APIs, which install span streaming
21- // on first use; the server entry serves the plain `@sentry/core` ones. Same signatures, but the
22- // star exports above are ambiguous without these.
2320export declare const startSpan : typeof clientSdk . startSpan ;
2421export declare const startSpanManual : typeof clientSdk . startSpanManual ;
2522export declare const startInactiveSpan : typeof clientSdk . startInactiveSpan ;
Original file line number Diff line number Diff line change @@ -17,9 +17,6 @@ export declare function init(options: Options | clientSdk.BrowserOptions | serve
1717export declare const contextLinesIntegration : typeof clientSdk . contextLinesIntegration ;
1818export declare const linkedErrorsIntegration : typeof clientSdk . linkedErrorsIntegration ;
1919export declare const spanStreamingIntegration : typeof clientSdk . spanStreamingIntegration ;
20- // The client entry serves the `@sentry/core/browser` span-start APIs, which install span streaming
21- // on first use; the server entry serves the plain `@sentry/core` ones. Same signatures, but the
22- // star exports above are ambiguous without these.
2320export declare const startSpan : typeof clientSdk . startSpan ;
2421export declare const startSpanManual : typeof clientSdk . startSpanManual ;
2522export declare const startInactiveSpan : typeof clientSdk . startInactiveSpan ;
Original file line number Diff line number Diff line change @@ -19,9 +19,6 @@ export declare const browserTracingIntegration: typeof clientSdk.browserTracingI
1919export declare const linkedErrorsIntegration : typeof clientSdk . linkedErrorsIntegration ;
2020export declare const contextLinesIntegration : typeof clientSdk . contextLinesIntegration ;
2121export declare const spanStreamingIntegration : typeof clientSdk . spanStreamingIntegration ;
22- // The client entry serves the `@sentry/core/browser` span-start APIs, which install span streaming
23- // on first use; the server entry serves the plain `@sentry/core` ones. Same signatures, but the
24- // star exports above are ambiguous without these.
2522export declare const startSpan : typeof clientSdk . startSpan ;
2623export declare const startSpanManual : typeof clientSdk . startSpanManual ;
2724export declare const startInactiveSpan : typeof clientSdk . startInactiveSpan ;
You can’t perform that action at this time.
0 commit comments