From bef75402f71240e7280d384650ed2488db948b65 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 15 Jan 2024 16:51:43 +0100 Subject: [PATCH 1/2] ref(core): Add missing class field deprecations These fields were alredy deprecated on the interface, this patch only adds the deprecation annotation to the JSDoc of the class fields. After testing with eslint, linters will correctly infer the deprecation status. VSCode also shows the fields as deprecated in the JSDoc but doesn't apply the strikethrough. So for extra clarity, let's also deprecate the class fields here. --- packages/core/src/tracing/span.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/core/src/tracing/span.ts b/packages/core/src/tracing/span.ts index 129f6358c671..94cb7316ff74 100644 --- a/packages/core/src/tracing/span.ts +++ b/packages/core/src/tracing/span.ts @@ -444,6 +444,8 @@ export class Span implements SpanInterface { /** * @inheritDoc + * + * @deprecated Use `spanToTraceHeader()` instead. */ public toTraceparent(): string { return spanToTraceHeader(this); @@ -451,6 +453,8 @@ export class Span implements SpanInterface { /** * @inheritDoc + * + * @deprecated Use `toJSON()` or access the fields directly instead. */ public toContext(): SpanContext { return dropUndefinedKeys({ @@ -471,6 +475,8 @@ export class Span implements SpanInterface { /** * @inheritDoc + * + * @deprecated Update the fields directly instead. */ public updateWithContext(spanContext: SpanContext): this { // eslint-disable-next-line deprecation/deprecation @@ -493,6 +499,8 @@ export class Span implements SpanInterface { /** * @inheritDoc + * + * @deprecated Use `spanToTraceContext()` util function instead. */ public getTraceContext(): TraceContext { return spanToTraceContext(this); From 5d3ab270b1c2d8502aacd4cd1cffb1698fdaedef Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 15 Jan 2024 17:48:11 +0100 Subject: [PATCH 2/2] Update packages/core/src/tracing/span.ts Co-authored-by: Francesco Novy --- packages/core/src/tracing/span.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/tracing/span.ts b/packages/core/src/tracing/span.ts index 94cb7316ff74..353f2e4d694f 100644 --- a/packages/core/src/tracing/span.ts +++ b/packages/core/src/tracing/span.ts @@ -454,7 +454,7 @@ export class Span implements SpanInterface { /** * @inheritDoc * - * @deprecated Use `toJSON()` or access the fields directly instead. + * @deprecated Use `spanToJSON()` or access the fields directly instead. */ public toContext(): SpanContext { return dropUndefinedKeys({