-
-
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
ref: Deprecate extractTraceParentData
from @sentry/core
& downstream packages
#9158
Conversation
*/ | ||
export { TRACEPARENT_REGEXP, extractTraceparentData } from '@sentry/utils'; |
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.
Note: TRACEPARENT_REGEXP
was not actually used/exported any further.
a1f0937
to
bd3c35e
Compare
size-limit report 📦
|
bd3c35e
to
8258922
Compare
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.
I guess this is fine because we also have continueTrace
coming
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.
I also think this is fine!
@@ -8,6 +8,10 @@ npx @sentry/migr8@latest | |||
|
|||
This will let you select which updates to run, and automatically update your code. Make sure to still review all code changes! | |||
|
|||
## Deprecate `extractTraceParentData` export from `@sentry/core` & downstream packages | |||
|
|||
Instead, import this directly from `@sentry/utils`. |
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.
l: I'd probably add a hint here that continueTrace
might be a suitable replacement
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.
makes sense, I'll wait till we merge that and reference this then!
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.
I've added the sentence below, WDYT?
8258922
to
9bdaf4d
Compare
Instead, uses should import this from `@sentry/utils`.
9bdaf4d
to
a018b53
Compare
@@ -70,6 +69,7 @@ export const getActiveTransaction = getActiveTransactionT; | |||
* | |||
* `extractTraceparentData` can be imported from `@sentry/node`, `@sentry/browser`, or your framework SDK | |||
*/ | |||
// eslint-disable-next-line deprecation/deprecation | |||
export const extractTraceparentData = extractTraceparentDataT; |
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.
@mydea I'm getting an error upgrading from 7.77.0 to 7.81.1
@parcel/validator-typescript: Cannot find module '@sentry/utils' or its
corresponding type declarations.
{PROJECT-}/.yarn/cache/@sentry-tracing-npm-7.81.1-37dcfd79a9-02e639e8aa.zip/node_modules/@sentry/tracing/types/index.d.ts:34:60
33 | */
> 34 | port("@sentry/utils").extractTraceparentData;
> | ^^^^^^^^^^^^^^^^ Cannot find module '@sentry/utils' or its corresponding type declarations.
35 | /**
36 | * @deprecated `@sentry/tracing` has been deprecated and will be moved
It's just a guess but I think the error might come @sentry/utils
being a devDependency of @sentry/tracing
.
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.
I compared how sentry is initialized on my side with the documentation and BrowserTracing is imported through @sentry/react
, we were importing it from @sentry/tracing
directly.
Changing the initialization fixed the problem. This could be considered a bug since @sentry/tracing
requirement was documented to be removed in a future major release
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.
Hey,
so this should still work when being imported from @sentry/tracing
too - can it be that you had some lingering un-updated versions hanging around? That's usually the reason for these kind of things, and also why we are pushing to having everything imported from a single place (e.g. @sentry/react
). Probably you had some child dependency of sentry/utils with an older versions where that didn't exist yet!
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.
I've looked at the lock file and all sentry related modules where at 7.81.1. I made sure to start from a fresh clone of the projet and cleaned all caches.
It may be something with yarn, parcel and the way the import made that doesn't work well.
I stopped looking since using the new recommended init works. I just wanted to let you know there might be something here. I wasn't sure if I should fill it as a bug.
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.
thanks for bringing this up! We'll keep an eye on this, if this comes up more maybe something is wrong, but "hopefully" it's some weird thing with versions. 👍
Instead, users should import this from
@sentry/utils
.This was also re-exported from all downstream packages (e.g.
@sentry/browser
,@sentry/node
). I don't think this is something users need to import from there...? If you need this, installing@sentry/utils
is probably fine?Else if we think we want to keep exporting this, we can also remove the comment, but then we should just properly move this from utils to core and instead remove the utils export, I'd say.