-
-
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
[DEPRECATION] #14754 deprecate canDispatchToEventManager
#15078
[DEPRECATION] #14754 deprecate canDispatchToEventManager
#15078
Conversation
f470f89
to
4007121
Compare
|
||
expectDeprecation(() => { | ||
this.render(`{{x-foo}}`); | ||
}, '[DEPERECATED] `canDispatchToEventManager` has been deprecated.'); |
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.
Should be [DEPRECATED]
instead of [DEPERECATED]
.
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.
Thank you for participating in the contributor's workshop!! :)
ComponentClass: Component.extend({ | ||
eventManager: { | ||
myEvent() { | ||
assert.ok(true, 'custom event was triggered'); |
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.
It's not clear from how this test is written that this line of code is actually executing. Can you set a boolean and check it at the end, or use assert.expect?
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.
whoops--thats copy-pasta, that assert is completely unrelated to the changes in this PR
4007121
to
f36fcbe
Compare
@rwjblue could I get your |
@@ -138,6 +139,34 @@ moduleFor('EventDispatcher#setup', class extends RenderingTest { | |||
this.$('div').trigger('myevent'); | |||
} | |||
|
|||
['@test canDispatchToEventManager is deprecated'](assert) { | |||
this.dispatcher.canDispatchToEventManager = null; |
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.
In theory, we should not need to force this to be null
in this test, the default of undefined
should be enough
@@ -538,7 +538,16 @@ export default Mixin.create({ | |||
let owner = getOwner(this); | |||
let dispatcher = owner && owner.lookup('event_dispatcher:main'); | |||
|
|||
if (dispatcher && dispatcher.canDispatchToEventManager === null) { | |||
deprecate( | |||
`[DEPRECATED] \`canDispatchToEventManager\` has been deprecated.`, |
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.
Let's have this message mention eventManager
instead of canDispatchToEventManager
, and also add the ${this} to the interpolation (so it's clear to someone seeing the deprecation which component caused it.
!('canDispatchToEventManager' in dispatcher), | ||
{ | ||
id: 'ember-views.event-dispatcher.canDispatchToEventManager', | ||
until: '3.0.0' |
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.
Let's change this to 2.16.0
|
||
init() { | ||
this._super(); | ||
assert('EventDispatcher should never be instantiated in fastboot mode. Please report this as an Ember bug.', environment.hasDOM); | ||
|
||
deprecate( | ||
`[DEPRECATED] \`canDispatchToEventManager\` has been deprecated.`, |
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.
Let's mention which file this is in.
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.
Also, you should not need to prefix the message with [DEPRECATED]
523d8da
to
6810123
Compare
@rwjblue good morning sunshine, I need more |
Thank you @habdelra! |
This is to address the deprecation in #14754. I'm not sure if the deprecation message provides enough detail.