Skip to content

Commit

Permalink
add comment for circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Jan 5, 2024
1 parent 6fd0129 commit e78e54c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core/src/utils/spanUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ function ensureTimestampInSeconds(timestamp: number): number {
/**
* Convert a span to a JSON representation.
* Note that all fields returned here are optional and need to be guarded against.
*
* Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).
* This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.
* And `spanToJSON` needs the Span class from `span.ts` to check here.
* TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.
*/
export function spanToJSON(span: Span): Partial<SpanJSON> {
if (spanIsSpanClass(span)) {
Expand Down

0 comments on commit e78e54c

Please sign in to comment.