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

Add capabilities #13

Merged
merged 4 commits into from
Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 './utils';

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 './utils';

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 './utils';
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
9 changes: 9 additions & 0 deletions addon/-private/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Ember from 'ember';
Copy link
Collaborator

@rwjblue rwjblue Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't needed, see the changes made in spencer516/ember-functional-modifiers@401489e

I mitigated the typo issue over in ember-modifier-manager-polyfill (just need to update here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woo woo!
pushed!

import { setModifierManager, capabilities } from '@ember/modifier';

if (!capabilities) {
// Exported to global with typo up till #18266
capabilities = Ember._modifierManagerCapabilties;
}

export { setModifierManager, capabilities };
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"release": "release-it"
},
"dependencies": {
"ember-cli-babel": "^7.7.3",
"ember-cli-babel": "^7.10.0",
"ember-modifier-manager-polyfill": "^1.0.3"
},
"devDependencies": {
Expand Down
34 changes: 17 additions & 17 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 @@ -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 @@ -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