From 811fd074c82943b8bb33455ada15e58f034f8736 Mon Sep 17 00:00:00 2001 From: Ben Tidy Date: Tue, 25 Oct 2022 14:01:37 +0100 Subject: [PATCH 1/2] Include package name in deprecation function So this slightly changes the deprecation message to allow for package (namespace) to be included in the error message. This make it so that the message "will be removed in ember (package version)" is replaced with "will be removed in (package name) (package version)". This was change was proposed because of this usage: https://github.com/adopted-ember-addons/ember-metrics/blob/f604272de70e44ac731c711cfad5eae8792ee3ca/addon/metrics-adapters/google-tag-manager.js#L50 and this issue: https://github.com/adopted-ember-addons/ember-metrics/issues/453 --- packages/@ember/debug/lib/deprecate.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@ember/debug/lib/deprecate.ts b/packages/@ember/debug/lib/deprecate.ts index f3d8a29357c..882bafef4b5 100644 --- a/packages/@ember/debug/lib/deprecate.ts +++ b/packages/@ember/debug/lib/deprecate.ts @@ -91,7 +91,8 @@ if (DEBUG) { } if (options?.until) { - message = message + ` This will be removed in Ember ${options.until}.`; + let namespace = options?.for ? options.for : "Ember"; + message = message + ` This will be removed in ${namespace} ${options.until}.`; } if (options?.url) { From fdbd78031fd98da373af0623fe9c448cf5709550 Mon Sep 17 00:00:00 2001 From: Ben Tidy Date: Tue, 25 Oct 2022 15:56:53 +0100 Subject: [PATCH 2/2] Remove fallback to ember --- packages/@ember/debug/lib/deprecate.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/@ember/debug/lib/deprecate.ts b/packages/@ember/debug/lib/deprecate.ts index 882bafef4b5..37d6c083e1b 100644 --- a/packages/@ember/debug/lib/deprecate.ts +++ b/packages/@ember/debug/lib/deprecate.ts @@ -91,8 +91,7 @@ if (DEBUG) { } if (options?.until) { - let namespace = options?.for ? options.for : "Ember"; - message = message + ` This will be removed in ${namespace} ${options.until}.`; + message = message + ` This will be removed in ${options.for} ${options.until}.`; } if (options?.url) {