Skip to content

Commit 1c2c90f

Browse files
committed
ref(tracing): Re-add BrowserTracing static ID
This was removed in #5166 due to tree shaking concerns, however we have had a static ID for replay and it has been working fine so far.
1 parent 01d7c5c commit 1c2c90f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/tracing-internal/src/browser/browsertracing.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,19 @@ const DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {
157157
* any routing library. This integration uses {@see IdleTransaction} to create transactions.
158158
*/
159159
export class BrowserTracing implements Integration {
160-
// This class currently doesn't have a static `id` field like the other integration classes, because it prevented
161-
// @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.
162-
// TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all
163-
// integrations.
164-
165-
/** Browser Tracing integration options */
166-
public options: BrowserTracingOptions;
160+
/**
161+
* @inheritDoc
162+
*/
163+
public static id: string = BROWSER_TRACING_INTEGRATION_ID;
167164

168165
/**
169166
* @inheritDoc
170167
*/
171168
public name: string = BROWSER_TRACING_INTEGRATION_ID;
172169

170+
/** Browser Tracing integration options */
171+
public options: BrowserTracingOptions;
172+
173173
private _getCurrentHub?: () => Hub;
174174

175175
private _latestRouteName?: string;

0 commit comments

Comments
 (0)