Skip to content

Commit

Permalink
ref(tracing): Re-add BrowserTracing static ID
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mydea committed Apr 4, 2023
1 parent 01d7c5c commit 1c2c90f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/tracing-internal/src/browser/browsertracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,19 @@ const DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {
* any routing library. This integration uses {@see IdleTransaction} to create transactions.
*/
export class BrowserTracing implements Integration {
// This class currently doesn't have a static `id` field like the other integration classes, because it prevented
// @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.
// TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all
// integrations.

/** Browser Tracing integration options */
public options: BrowserTracingOptions;
/**
* @inheritDoc
*/
public static id: string = BROWSER_TRACING_INTEGRATION_ID;

/**
* @inheritDoc
*/
public name: string = BROWSER_TRACING_INTEGRATION_ID;

/** Browser Tracing integration options */
public options: BrowserTracingOptions;

private _getCurrentHub?: () => Hub;

private _latestRouteName?: string;
Expand Down

0 comments on commit 1c2c90f

Please sign in to comment.