Skip to content

Commit e69bc0e

Browse files
committed
remove so much fluff comments. i hate clankers
1 parent 3dfe64d commit e69bc0e

13 files changed

Lines changed: 8 additions & 50 deletions

File tree

packages/astro/src/index.types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ export declare function init(options: Options | clientSdk.BrowserOptions | NodeO
2121
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
2222
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
2323
export 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.
2724
export declare const startSpan: typeof clientSdk.startSpan;
2825
export declare const startSpanManual: typeof clientSdk.startSpanManual;
2926
export declare const startInactiveSpan: typeof clientSdk.startInactiveSpan;

packages/core/src/browser-exports.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,15 @@
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+
147
export {
158
startSpan,
169
startInactiveSpan,
1710
startSpanManual,
1811
startIdleSpan,
1912
_INTERNAL_ensureBrowserSpanStreaming,
2013
} from './tracing/browserSpanApi';
14+
2115
export { spanStreamingIntegration } from './integrations/browserSpanStreaming';
2216

2317
export {

packages/core/src/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ export * from './shared-exports';
22
export * from './server-exports';
33
export * 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.
98
export { startSpan, startInactiveSpan, startSpanManual } from './tracing/trace';
109
export { startIdleSpan } from './tracing/idleSpan';
1110
export { spanStreamingIntegration } from './integrations/spanStreaming';

packages/core/src/server-exports.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
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`.
97
export { 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.
128
export { startIdleSpan } from './tracing/idleSpan';
139
export { spanStreamingIntegration } from './integrations/spanStreaming';
1410

packages/core/src/tracing/browserSpanApi.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff 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>();
3733
export 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

packages/core/src/tracing/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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.
2320
export {
2421
_INTERNAL_startInactiveSpan,
2522
continueTrace,

packages/effect/src/index.types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ export declare function init(options: Options | clientSdk.BrowserOptions | serve
2222
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
2323
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
2424
export 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.
2825
export declare const startSpan: typeof clientSdk.startSpan;
2926
export declare const startSpanManual: typeof clientSdk.startSpanManual;
3027
export declare const startInactiveSpan: typeof clientSdk.startInactiveSpan;

packages/nuxt/src/index.types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ export declare function init(options: Options | SentryNuxtClientOptions | Sentry
1717
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
1818
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
1919
export 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.
2320
export declare const startSpan: typeof clientSdk.startSpan;
2421
export declare const startSpanManual: typeof clientSdk.startSpanManual;
2522
export declare const startInactiveSpan: typeof clientSdk.startInactiveSpan;

packages/react-router/src/index.types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ export declare function init(options: Options | clientSdk.BrowserOptions | serve
1717
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
1818
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
1919
export 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.
2320
export declare const startSpan: typeof clientSdk.startSpan;
2421
export declare const startSpanManual: typeof clientSdk.startSpanManual;
2522
export declare const startInactiveSpan: typeof clientSdk.startInactiveSpan;

packages/remix/src/index.types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ export declare const browserTracingIntegration: typeof clientSdk.browserTracingI
1919
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
2020
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
2121
export 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.
2522
export declare const startSpan: typeof clientSdk.startSpan;
2623
export declare const startSpanManual: typeof clientSdk.startSpanManual;
2724
export declare const startInactiveSpan: typeof clientSdk.startInactiveSpan;

0 commit comments

Comments
 (0)