From 7fc479fb3a86c1c97e9b21f866586b53048f4dbc Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 6 Aug 2024 11:14:18 +0200 Subject: [PATCH] ref(core): Reduce `hasTracingEnabled` size (#13232) Inlining the function removes the function declaration from the bundle. --- packages/core/src/utils/hasTracingEnabled.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/core/src/utils/hasTracingEnabled.ts b/packages/core/src/utils/hasTracingEnabled.ts index 5e673bc08caa..9441a0fc7bed 100644 --- a/packages/core/src/utils/hasTracingEnabled.ts +++ b/packages/core/src/utils/hasTracingEnabled.ts @@ -16,12 +16,8 @@ export function hasTracingEnabled( return false; } - const options = maybeOptions || getClientOptions(); + const client = getClient(); + const options = maybeOptions || (client && client.getOptions()); // eslint-disable-next-line deprecation/deprecation return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options); } - -function getClientOptions(): Options | undefined { - const client = getClient(); - return client && client.getOptions(); -}