-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE ember-debug-handlers] #11833
Conversation
FYI - #11835 is a meta issue created to add |
}); | ||
|
||
registerHandler(function raiseOnDeprecation(message, options, next) { | ||
let updatedMessage = formatMessage(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this would format the message twice. Once here and (if raise on deprecation is false) once in logDeprecationToConsole
. Seems like this let should be inside the if
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will move into the if (that makes sense), but it will not double format because we are calling next(...arguments)
and not this local variable.
Updated with @mixonic's feedback. |
[FEATURE ember-debug-handlers]
@@ -0,0 +1,27 @@ | |||
import isPlainFunction from 'ember-debug/is-plain-function'; | |||
|
|||
export let HANDLERS = { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you need to evict these somehow in tests, otherwise you will retain deprecations across app and isolated container instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean, these are global and are not changed per application or container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah never mind I thought for a second this was going to hold a map of arrays. This is clearly not the case https://github.com/emberjs/ember.js/pull/11833/files#diff-889b83df6e6038c39617a4a40aec777fR12.
[ember-debug-handlers-polyfill](https://github.com/ember-polyfills/ember-debug-handlers-polyfill) provides an implementation of [emberjs/rfcs#65](https://github.com/emberjs/rfcs/blob/master/text/0065-deprecation-warning-handlers.md) (added to Ember in [emberjs/ember.js#11833](emberjs/ember.js#11833) and released in Ember v2.1.0) that can be used with versions of Ember prior to v2.1.0.
[ember-debug-handlers-polyfill](https://github.com/ember-polyfills/ember-debug-handlers-polyfill) provides an implementation of [emberjs/rfcs#65](https://github.com/emberjs/rfcs/blob/master/text/0065-deprecation-warning-handlers.md) (added to Ember in [emberjs/ember.js#11833](emberjs/ember.js#11833) and released in Ember v2.1.0) that can be used with versions of Ember prior to v2.1.0.
Implement emberjs/rfcs#65.
/cc @mixonic