Skip to content

[bugfix] Add stack traces to conditional deprecation warnings - #6450

Merged
mattjohnsonpint merged 1 commit into
developfrom
mjp/fix-6071
Sep 14, 2026
Merged

mattjohnsonpint merged 1 commit into
developfrom
mjp/fix-6071

Conversation

@mattjohnsonpint

Copy link
Copy Markdown
Contributor

Fixes #6071.

Moment already includes stack traces for deprecations emitted through deprecate(). Conditional deprecations use deprecateSimple(), which previously logged only the warning message.

This adds stack traces to deprecateSimple() warnings, covering:

  • Reversed add and subtract arguments
  • Overriding an existing locale with defineLocale()

Warnings remain deduplicated by deprecation name, and deprecationHandler continues to receive the original message without console-specific formatting.

Added regression coverage for the stack trace and existing deduplication behavior.

Validation: pnpm validate

@mattjohnsonpint
mattjohnsonpint requested a review from a team as a code owner September 14, 2026 15:28
@mattjohnsonpint
mattjohnsonpint merged commit 863ed94 into develop Sep 14, 2026
26 checks passed
@mattjohnsonpint
mattjohnsonpint deleted the mjp/fix-6071 branch September 14, 2026 15:29
@mattjohnsonpint mattjohnsonpint added this to the 2.31.0 milestone Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please add stack trace for deprecation warnings

1 participant