ref: Deprecate extractTraceParentData from @sentry/core & downstream packages#9158
ref: Deprecate extractTraceParentData from @sentry/core & downstream packages#9158
extractTraceParentData from @sentry/core & downstream packages#9158Conversation
| * | ||
| * @deprecated Import this function from `@sentry/utils` instead | ||
| */ | ||
| export { TRACEPARENT_REGEXP, extractTraceparentData } from '@sentry/utils'; |
There was a problem hiding this comment.
Note: TRACEPARENT_REGEXP was not actually used/exported any further.
a1f0937 to
bd3c35e
Compare
size-limit report 📦
|
bd3c35e to
8258922
Compare
AbhiPrasad
left a comment
There was a problem hiding this comment.
I guess this is fine because we also have continueTrace coming
|
|
||
| ## Deprecate `extractTraceParentData` export from `@sentry/core` & downstream packages | ||
|
|
||
| Instead, import this directly from `@sentry/utils`. |
There was a problem hiding this comment.
l: I'd probably add a hint here that continueTrace might be a suitable replacement
There was a problem hiding this comment.
makes sense, I'll wait till we merge that and reference this then!
There was a problem hiding this comment.
I've added the sentence below, WDYT?
8258922 to
9bdaf4d
Compare
Instead, uses should import this from `@sentry/utils`.
9bdaf4d to
a018b53
Compare
| * `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.
@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.
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.
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.
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.
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/utilsis 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.