Skip to content
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

Deprecate canDispatchToEventManager? #14754

Closed
GavinJoyce opened this issue Dec 24, 2016 · 2 comments
Closed

Deprecate canDispatchToEventManager? #14754

GavinJoyce opened this issue Dec 24, 2016 · 2 comments

Comments

@GavinJoyce
Copy link
Member

GavinJoyce commented Dec 24, 2016

From

/**
It enables events to be dispatched to the view's `eventManager.` When present,
this object takes precedence over handling of events on the view itself.
Note that most Ember applications do not use this feature. If your app also
does not use it, consider setting this property to false to gain some performance
improvement by allowing the EventDispatcher to skip the search for the
`eventManager` on the view tree.
```javascript
let EventDispatcher = Em.EventDispatcher.extend({
events: {
click : 'click',
focusin : 'focusIn',
focusout : 'focusOut',
change : 'change'
},
canDispatchToEventManager: false
});
container.register('event_dispatcher:main', EventDispatcher);
```
@property canDispatchToEventManager
@type boolean
@default 'true'
@since 1.7.0
@private
*/
canDispatchToEventManager: true,
:

Note that most Ember applications do not use this feature. If your app also
does not use it, consider setting this property to false to gain some performance
improvement by allowing the EventDispatcher to skip the search for the
`eventManager` on the view tree.

screen shot 2016-12-24 at 22 11 05

Some questions:

  • Do many apps use this? If not, perhaps we can deprecate (with a RFC)
  • If we can't deprecate, can we disable it by default and make it opt-in?
  • What are the use cases for custom eventManagers? Can we suggest alternative solutions?
@rwjblue
Copy link
Member

rwjblue commented Dec 25, 2016

Do many apps use this?

I checked with @tomdale and apparently this was originally added to allow views to differentiate between certain types of touch input, however the addon that originally used this (ember-touch) has been deprecated in favor of Hammer.js.

If not, perhaps we can deprecate (with a RFC)

Yes, we should absolutely deprecate it.

If we can't deprecate, can we disable it by default and make it opt-in?

I think we can make it more "pay-go" either way, so that most apps don't have to pay the cost of the feature they never use...

@GavinJoyce
Copy link
Member Author

GavinJoyce commented Dec 26, 2016

TODOs:

habdelra pushed a commit to habdelra/ember.js that referenced this issue Mar 27, 2017
habdelra pushed a commit to habdelra/ember.js that referenced this issue Mar 27, 2017
habdelra pushed a commit to habdelra/ember.js that referenced this issue Mar 27, 2017
habdelra pushed a commit to habdelra/ember.js that referenced this issue Mar 27, 2017
@rwjblue rwjblue closed this as completed in f36fcbe Apr 3, 2017
rwjblue added a commit that referenced this issue Apr 3, 2017
…EventManager

[DEPRECATION] #14754 deprecate `canDispatchToEventManager`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants