diff --git a/FEATURES.md b/FEATURES.md index e26ddd95e52..e883d4bc870 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -18,11 +18,6 @@ for a detailed explanation. serially and call `reset()` each time), as well as being critical to for FastBoot. -* `ember-debug-handlers` - - Implements RFC https://github.com/emberjs/rfcs/pull/65, adding support for - custom deprecation and warning handlers. - * `ember-routing-routable-components` Implements RFC https://github.com/emberjs/rfcs/pull/38, adding support for diff --git a/features.json b/features.json index f7c32a1e70e..628d6d1f50b 100644 --- a/features.json +++ b/features.json @@ -5,7 +5,6 @@ "ember-test-helpers-fire-native-events": true, "ember-routing-route-configured-query-params": null, "ember-libraries-isregistered": null, - "ember-debug-handlers": true, "ember-routing-routable-components": null, "ember-metal-ember-assign": true, "ember-contextual-components": true, diff --git a/packages/ember-debug/lib/index.js b/packages/ember-debug/lib/index.js index 5054f1f1adf..f034d6c82ab 100644 --- a/packages/ember-debug/lib/index.js +++ b/packages/ember-debug/lib/index.js @@ -223,73 +223,72 @@ if (!Ember.testing) { */ Ember.Debug = { }; -if (isEnabled('ember-debug-handlers')) { - /** - Allows for runtime registration of handler functions that override the default deprecation behavior. - Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). - The following example demonstrates its usage by registering a handler that throws an error if the - message contains the word "should", otherwise defers to the default handler. - - ```javascript - Ember.Debug.registerDeprecationHandler((message, options, next) => { - if (message.indexOf('should') !== -1) { - throw new Error(`Deprecation message with should: ${message}`); - } else { - // defer to whatever handler was registered before this one - next(message, options); - } +/** + Allows for runtime registration of handler functions that override the default deprecation behavior. + Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). + The following example demonstrates its usage by registering a handler that throws an error if the + message contains the word "should", otherwise defers to the default handler. + + ```javascript + Ember.Debug.registerDeprecationHandler((message, options, next) => { + if (message.indexOf('should') !== -1) { + throw new Error(`Deprecation message with should: ${message}`); + } else { + // defer to whatever handler was registered before this one + next(message, options); } - ``` - - The handler function takes the following arguments: - -
message - The message received from the deprecation call.options - An object passed in with the deprecation call containing additional information including:id - An id of the deprecation in the form of package-name.specific-deprecation.until - The Ember version number the feature and deprecation will be removed in.next - A function that calls into the previously registered handler.message - The message received from the warn call. options - An object passed in with the warn call containing additional information including:id - An id of the warning in the form of package-name.specific-warning.next - A function that calls into the previously registered handler.message - The message received from the deprecation call.options - An object passed in with the deprecation call containing additional information including:id - An id of the deprecation in the form of package-name.specific-deprecation.until - The Ember version number the feature and deprecation will be removed in.next - A function that calls into the previously registered handler.message - The message received from the warn call. options - An object passed in with the warn call containing additional information including:id - An id of the warning in the form of package-name.specific-warning.next - A function that calls into the previously registered handler.