codemod icon indicating copy to clipboard operation
codemod copied to clipboard

[codemod request] sentry.configureScope : Removal of Sentry.configureScope method

Open arshcodemod opened this issue 9 months ago • 0 comments

Removal of Sentry.configureScope

In Sentry JavaScript SDK 7.x to 8.x, this codemod removes top level Sentry.configureScope function. Instead, uses the Sentry.getCurrentScope() to access and mutate the current scope.

Examples

Code before transformation

Sentry.configureScope((scope) => {
  scope.setTag("key", "value");
});

Code after transformation

Sentry.getCurrentScope().setTag("key", "value");

Applicability Criteria

Sentry JavaScript SDK 7.x -> 8.x

Additional context or links

Sentry v7 to v8: Removal of Sentry.configureScope method

arshcodemod avatar May 21 '24 14:05 arshcodemod