Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Add capabilities (#13)
Browse files Browse the repository at this point in the history
@chancancode, @NullVoxPopuli, and @rwjblue all seem to think this is a good idea and I highly respect their opinions. Ship It!

This addresses a deprecation warning and updates to the latest and greatest modifier APIs.
  • Loading branch information
NullVoxPopuli authored and sukima committed Sep 19, 2019
1 parent c2e2619 commit a994b73
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 31 deletions.
4 changes: 2 additions & 2 deletions addon/-private/modifier-classic.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Ember from 'ember';
import EmberObject from '@ember/object';
import createManager from './create-manager';
import { deprecate } from '@ember/application/deprecations';
import { setModifierManager } from '@ember/modifier';

const Modifier = EmberObject.extend({
element: null,
Expand All @@ -18,6 +18,6 @@ Modifier.reopenClass({
}
});

Ember._setModifierManager(createManager, Modifier);
setModifierManager(createManager, Modifier);

export default Modifier;
4 changes: 4 additions & 0 deletions addon/-private/modifier-manager.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { capabilities } from '@ember/modifier';

function triggerLifecycleHook(instance, hookName, args) {
// Checking for undefined as a style choice came from
// https://emberjs.github.io/rfcs/0373-Element-Modifier-Managers.html
Expand All @@ -7,6 +9,8 @@ function triggerLifecycleHook(instance, hookName, args) {
}

export default class ModifierManager {
capabilities = capabilities('3.13');

constructor(owner) {
this.owner = owner;
}
Expand Down
8 changes: 4 additions & 4 deletions addon/-private/modifier-native.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Ember from 'ember';
import createManager from './create-manager';
import { setOwner } from '@ember/application';
import { setProperties } from '@ember/object';
import createManager from './create-manager';
import { deprecate } from '@ember/application/deprecations';
import { deprecate } from '@ember/application/deprecations';
import { setModifierManager } from '@ember/modifier';
import { assert } from '@ember/debug';

class Modifier {
Expand All @@ -22,7 +22,7 @@ class Modifier {
}
}

Ember._setModifierManager(createManager, Modifier);
setModifierManager(createManager, Modifier);

export function modifier(modifierFn) {
assert(
Expand Down
Empty file removed addon/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"release": "release-it"
},
"dependencies": {
"ember-cli-babel": "^7.7.3",
"ember-modifier-manager-polyfill": "^1.0.3"
"ember-cli-babel": "^7.10.0",
"ember-modifier-manager-polyfill": "^1.1.0"
},
"devDependencies": {
"@ember/optional-features": "^0.6.3",
Expand Down
46 changes: 23 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2070,20 +2070,20 @@ babel-plugin-debug-macros@^0.3.0:
dependencies:
semver "^5.3.0"

babel-plugin-ember-modules-api-polyfill@^2.11.0:
version "2.11.0"
resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-2.11.0.tgz#3a67bdeb05a929a96776b45fa784bd3798517acc"
integrity sha512-S3bw77LglkWIstoF+hBLyRPyyNAUsdzqK6zLxktuM6EniVt06st/ikhPDUttMWixS2LNA+jnBfGerYO1D/VvDw==
dependencies:
ember-rfc176-data "^0.3.11"

babel-plugin-ember-modules-api-polyfill@^2.6.0, babel-plugin-ember-modules-api-polyfill@^2.7.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-2.7.0.tgz#dcd6a9999da0d47d8c9185362bda6244ca525f4a"
integrity sha512-+QXPqmRngp13d7nKWrBcL6iIixpuyMNq107XV1dKvsvAO5BGFQ0mSk7Dl6/OgG+z2F1KquxkFfdXYBwbREQI6A==
dependencies:
ember-rfc176-data "^0.3.7"

babel-plugin-ember-modules-api-polyfill@^2.8.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-2.9.0.tgz#8503e7b4192aeb336b00265e6235258ff6b754aa"
integrity sha512-c03h50291phJ2gQxo/aIOvFQE2c6glql1A7uagE3XbPXpKVAJOUxtVDjvWG6UAB6BC5ynsJfMWvY0w4TPRKIHQ==
dependencies:
ember-rfc176-data "^0.3.9"

babel-plugin-feature-flags@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/babel-plugin-feature-flags/-/babel-plugin-feature-flags-0.3.1.tgz#9c827cf9a4eb9a19f725ccb239e85cab02036fc1"
Expand Down Expand Up @@ -5140,7 +5140,7 @@ ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.0.0-beta.7, ember-cli-babel@^6
ember-cli-version-checker "^2.1.2"
semver "^5.5.0"

ember-cli-babel@^7.1.0, ember-cli-babel@^7.1.2, ember-cli-babel@^7.1.3, ember-cli-babel@^7.1.4, ember-cli-babel@^7.2.0, ember-cli-babel@^7.4.2:
ember-cli-babel@^7.1.0, ember-cli-babel@^7.1.2, ember-cli-babel@^7.1.3, ember-cli-babel@^7.1.4, ember-cli-babel@^7.2.0:
version "7.5.0"
resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.5.0.tgz#af654dcef23630391d2efe85aaa3bdf8b6ca17b7"
integrity sha512-wWXqPPQNRxCtEHvYaLBNiIVgCVCy8YqZ0tM8Dpql1D5nGnPDbaK073sS1vlOYBP7xe5Ab2nXhvQkFwUxFacJ2g==
Expand All @@ -5164,10 +5164,10 @@ ember-cli-babel@^7.1.0, ember-cli-babel@^7.1.2, ember-cli-babel@^7.1.3, ember-cl
ensure-posix-path "^1.0.2"
semver "^5.5.0"

ember-cli-babel@^7.7.3:
version "7.7.3"
resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.7.3.tgz#f94709f6727583d18685ca6773a995877b87b8a0"
integrity sha512-/LWwyKIoSlZQ7k52P+6agC7AhcOBqPJ5C2u27qXHVVxKvCtg6ahNuRk/KmfZmV4zkuw4EjTZxfJE1PzpFyHkXg==
ember-cli-babel@^7.10.0:
version "7.10.0"
resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.10.0.tgz#5505254b21f3c98400c91bf565dc1c0cf408b6b4"
integrity sha512-eNgPXobC+Pke5L3XzoJ0BXbb2+eYzZI+LljqbwXNuG4q63pF000aARFpTQ0p/NWkfGQxKi2L6tVIa1ZOYdQS+A==
dependencies:
"@babel/core" "^7.0.0"
"@babel/plugin-proposal-class-properties" "^7.3.4"
Expand All @@ -5179,7 +5179,7 @@ ember-cli-babel@^7.7.3:
"@babel/runtime" "^7.2.0"
amd-name-resolver "^1.2.1"
babel-plugin-debug-macros "^0.3.0"
babel-plugin-ember-modules-api-polyfill "^2.8.0"
babel-plugin-ember-modules-api-polyfill "^2.11.0"
babel-plugin-module-resolver "^3.1.1"
broccoli-babel-transpiler "^7.1.2"
broccoli-debug "^0.6.4"
Expand Down Expand Up @@ -5850,12 +5850,12 @@ [email protected]:
ember-ignore-children-helper "^1.0.1"
ember-wormhole "^0.5.5"

ember-modifier-manager-polyfill@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/ember-modifier-manager-polyfill/-/ember-modifier-manager-polyfill-1.0.3.tgz#6554b70d09a7d3b80d366b72ed482fb9a3e813c0"
integrity sha512-d8Uz0BhAZaqzttF4NXTwJ/A8uPrgd7fMho5jh89BfzJAHu5WZfGewX9cbjh3m6f512ZyxkIeeolw3Z5/Jyaujg==
ember-modifier-manager-polyfill@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ember-modifier-manager-polyfill/-/ember-modifier-manager-polyfill-1.1.0.tgz#06397b05a3f9a5868b05fca11fe10c7f6b78a328"
integrity sha512-fCEumUwdAnwk8rGSEww1/NkIHbmLOS8kRmEZyO9mxeIy+BtdYqdSIMrn3tSnt9QeacWQm2zdR8KXBqc2bc1G6A==
dependencies:
ember-cli-babel "^7.4.2"
ember-cli-babel "^7.10.0"
ember-cli-version-checker "^2.1.2"
ember-compatibility-helpers "^1.2.0"

Expand Down Expand Up @@ -5892,16 +5892,16 @@ ember-responsive@^3.0.0-beta.1:
dependencies:
ember-cli-babel "^6.6.0"

ember-rfc176-data@^0.3.11:
version "0.3.11"
resolved "https://registry.yarnpkg.com/ember-rfc176-data/-/ember-rfc176-data-0.3.11.tgz#9042e96aa4e962bf5bd5433939c92a1cf3a63de8"
integrity sha512-c46uisicHswFHo0R515LPM0L/X/Ju+N7KonJPuHx9C6cWD3AWzkNG9ASv+Bc85mq/9l3LFFsFpljdM1m2YnQ6A==

ember-rfc176-data@^0.3.5, ember-rfc176-data@^0.3.7:
version "0.3.7"
resolved "https://registry.yarnpkg.com/ember-rfc176-data/-/ember-rfc176-data-0.3.7.tgz#ecff7d74987d09296d3703343fed934515a4be33"
integrity sha512-AbTlD+q7sfyrD4diZqE7r9Y9/Je+HntVn7TlpHAe+nP5BNXxUXJIfDs5w5e3MxPcMs6Dz/yY90YfW8h1oKEvGg==

ember-rfc176-data@^0.3.9:
version "0.3.9"
resolved "https://registry.yarnpkg.com/ember-rfc176-data/-/ember-rfc176-data-0.3.9.tgz#44b6e051ead6c044ea87bd551f402e2cf89a7e3d"
integrity sha512-EiTo5YQS0Duy0xp9gCP8ekzv9vxirNi7MnIB4zWs+thtWp/mEKgf5mkiiLU2+oo8C5DuavVHhoPQDmyxh8Io1Q==

ember-router-generator@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/ember-router-generator/-/ember-router-generator-1.2.3.tgz#8ed2ca86ff323363120fc14278191e9e8f1315ee"
Expand Down

0 comments on commit a994b73

Please sign in to comment.