Skip to content

Commit 90c7036

Browse files
mydeaclaude
andauthored
feat(v10/core): Deprecate scope.clear() method (#23231)
Marks `Scope.clear()` as `@deprecated` ahead of its removal in v11, giving consumers an IDE deprecation warning and a migration path on v10. `clear()` mutates a scope's fields in place but intentionally leaves the client attached, which makes it an awkward reset primitive. The recommended replacements are re-initializing the SDK or running code in a fresh scope via `withScope`/`withIsolationScope`. This is a JSDoc-only change — no runtime behavior changes on v10. The removal itself lands on `develop` for v11. #23230 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3d40666 commit 90c7036

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/core/src/scope.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ export class Scope {
549549
/**
550550
* Clears the current scope and resets its properties.
551551
* Note: The client will not be cleared.
552+
*
553+
* @deprecated This method will be removed in v11. To reset scope state, re-initialize the SDK or run
554+
* your code in a fresh scope via `withScope` instead.
552555
*/
553556
public clear(): this {
554557
// client is not cleared here on purpose!

0 commit comments

Comments
 (0)