Skip to content

Commit

Permalink
component: Add component reference to the mouse event handler depreca…
Browse files Browse the repository at this point in the history
…tion warnings

This makes the deprecations a lot more actionable because it's easier to see what component is causing the deprecation without having to open the debugger.
  • Loading branch information
Turbo87 committed Nov 15, 2019
1 parent c1d5fcc commit 261ad43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/@ember/-internals/glimmer/lib/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ const Component = CoreView.extend(
}

deprecate(
`Using \`mouseEnter\` event handler methods in components has been deprecated.`,
`${this}: Using \`mouseEnter\` event handler methods in components has been deprecated.`,
this.mouseEnter === undefined,
{
id: 'ember-views.event-dispatcher.mouseenter-leave-move',
Expand All @@ -756,7 +756,7 @@ const Component = CoreView.extend(
}
);
deprecate(
`Using \`mouseLeave\` event handler methods in components has been deprecated.`,
`${this}: Using \`mouseLeave\` event handler methods in components has been deprecated.`,
this.mouseLeave === undefined,
{
id: 'ember-views.event-dispatcher.mouseenter-leave-move',
Expand All @@ -765,7 +765,7 @@ const Component = CoreView.extend(
}
);
deprecate(
`Using \`mouseMove\` event handler methods in components has been deprecated.`,
`${this}: Using \`mouseMove\` event handler methods in components has been deprecated.`,
this.mouseMove === undefined,
{
id: 'ember-views.event-dispatcher.mouseenter-leave-move',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ moduleFor(
});

expectDeprecation(
'Using `mouseMove` event handler methods in components has been deprecated.'
/Using `mouseMove` event handler methods in components has been deprecated\./
);

this.render(`{{x-foo}}`);
Expand Down

0 comments on commit 261ad43

Please sign in to comment.