-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): Add spanToJSON()
method to get span properties
#10074
Conversation
size-limit report 📦
|
"madge": { | ||
"detectiveOptions": { | ||
"ts": { | ||
"skipTypeImports": true | ||
} | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circ deps (even types) are usually very smelly. Is this 100% necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is - as we need the util in spanUtils
, and we need spanUtils
in span
, and for the util we need the span class from span
😬 at least I couldn't think of a way to make this work properly :( we can remove it in v8 though, then we don't need to import from spanUtils
in span
anymore!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright then! Let's add a comment/todo somewhere then to remove this opt-out again (if you also think that it's worth keeping in general in the future).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or open for other ideas, of course)
* 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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lforst added this comment here for the future!
This is supposed to be an internal API and not necessarily to be used by users. add comment for circular dependency
This is supposed to be an internal API and not necessarily to be used by users.
Naming wise, it's a bit tricky... I went with
JSON
to make it very clear what this is for, but 🤷