Skip to content

Commit e78e54c

Browse files
committed
add comment for circular dependency
1 parent 6fd0129 commit e78e54c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/core/src/utils/spanUtils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ function ensureTimestampInSeconds(timestamp: number): number {
6060
/**
6161
* Convert a span to a JSON representation.
6262
* Note that all fields returned here are optional and need to be guarded against.
63+
*
64+
* Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).
65+
* This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.
66+
* And `spanToJSON` needs the Span class from `span.ts` to check here.
67+
* TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.
6368
*/
6469
export function spanToJSON(span: Span): Partial<SpanJSON> {
6570
if (spanIsSpanClass(span)) {

0 commit comments

Comments
 (0)