Skip to content

Commit

Permalink
Add capabilities support
Browse files Browse the repository at this point in the history
emberjs/ember.js#18266 expects a capabilities config, and throws a deprecation when that is not provided. This change add support for that, thus silencing the deprecation.

Also imports proper RFC176-based modules for modifier APIs, supported by ember-cli-babel 7.10
  • Loading branch information
simonihmig committed Aug 19, 2019
1 parent 085684b commit c870fdf
Show file tree
Hide file tree
Showing 3 changed files with 1,344 additions and 1,631 deletions.
7 changes: 4 additions & 3 deletions addon/modifiers/ref.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
import { set, get } from '@ember/object';
import { deprecate } from '@ember/application/deprecations';
import { setModifierManager, capabilities } from '@ember/modifier';

function hasValidTarget(target) {
return (
Expand Down Expand Up @@ -28,8 +28,9 @@ function getParams([maybeTarget, maybePropName]) {
};
}

export default Ember._setModifierManager(
export default setModifierManager(
() => ({
capabilities: capabilities ? capabilities('3.13') : undefined,
createModifier() {
return {
element: undefined,
Expand Down Expand Up @@ -68,5 +69,5 @@ export default Ember._setModifierManager(
}
}
}),
class OnModifier {}
class RefModifier {}
);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test:all": "ember try:each"
},
"dependencies": {
"ember-cli-babel": "^7.1.2",
"ember-cli-babel": "^7.10.0",
"ember-modifier-manager-polyfill": "^1.0.1"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit c870fdf

Please sign in to comment.