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

Exception thrown in Ember canary (3.1) #18

Closed
cibernox opened this issue Jan 11, 2018 · 6 comments
Closed

Exception thrown in Ember canary (3.1) #18

cibernox opened this issue Jan 11, 2018 · 6 comments

Comments

@cibernox
Copy link
Contributor

The exception is that this._bubbleEvent is not a function:

result = this._bubbleEvent(view, event, eventName);

Steps to reproduce it:

  1. Clone https://github.com/cibernox/ember-basic-dropdown
  2. Update to canary: "ember-source": "http://builds.emberjs.com/canary/daily/20180110.tgz",
  3. Boot the app without fastboot (which is also broken): FASTBOOT_DISABLED=true ember serve
  4. Interact with the dropdown in the top of the page and see the error being logged many times.
@cibernox
Copy link
Contributor Author

@rwjblue I can fix it easily by just adding a check, but I'd like to understand what changed in 3.1 to make this fail.

@rwjblue
Copy link
Owner

rwjblue commented Jan 11, 2018

Ember canary (and soon beta) removed support for eventManager, and did some additional cleanup resulting in_bubbleEvent not being a function any longer.

@rwjblue
Copy link
Owner

rwjblue commented Jan 11, 2018

This was done in emberjs/ember.js#16099

@rwjblue
Copy link
Owner

rwjblue commented Jan 11, 2018

We need to make this addon a noop when using Ember 3.0+ (Ember internally supports native event handling when jQuery is not present)...

@cibernox
Copy link
Contributor Author

cibernox commented Jan 11, 2018

I can take care. How would you do it? With ember-version-checker and a funnel to completely remove everything in the addon?

@rwjblue
Copy link
Owner

rwjblue commented Jan 11, 2018

I think I would use ember-cli-version-checker to detect Ember version and do something like this:

module.exports = {
  name: 'ember-native-dom-event-dispatcher',
  
  init() {
    this._super && this._super.init.apply(this, arguments);

    let checker = new VersionChecker(this);  
    this._shouldDisable = checker.forEmber().gt('3.0.0-beta.2');
  },

  treeFor(type) {
    if (this._shouldDisable) {
      return null;
    }

    return this._super.treeFor.apply(this, arguments);
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants