Skip to content

Commit 0ddca7e

Browse files
authored
Merge pull request #246 from yapplabs/chore/remove-deprecations
[BREAKING] Remove deprecations in anticipation of 3.0.0
2 parents fe45751 + 984a155 commit 0ddca7e

File tree

12 files changed

+6
-739
lines changed

12 files changed

+6
-739
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Property | Purpose
9292
`overlayClassNames` | CSS class names to append to overlay divs. This is a concatenated property, so it does **not** replace the default overlay class (default: `'ember-modal-overlay'`. If you subclass this component, you may define this in your subclass.)
9393
`wrapperClass` | CSS class name(s) to append to wrapper divs. Set this from template.
9494
`wrapperClassNames` | CSS class names to append to wrapper divs. This is a concatenated property, so it does **not** replace the default container class (default: `'ember-modal-wrapper'`. If you subclass this component, you may define this in your subclass.)
95-
`animatable` | A boolean, when `true` makes modal animatable using `liquid-fire` (requires `liquid-wormhole` to be installed, and for tethering situations `liquid-tether`. Having these optional dependencies installed and NOT explicitly specifying `animatable` is deprecated in 2.x and is equivalent to `animatable=false` for backwards compatibility. As of 3.x, the implicit default will be `animatable=true` when the optional `liquid-wormhole`/`liquid-tether` dependency is present.
95+
`animatable` | A boolean, when `true` makes modal animatable using `liquid-fire` (requires `liquid-wormhole` to be installed, and for tethering situations `liquid-tether`. Having these optional dependencies installed and not specifying `animatable` will make `animatable=true` be the default.
9696

9797
#### Tethering
9898

@@ -121,9 +121,7 @@ Property | Purpose
121121

122122
This component supports animation when certain addons are present (liquid-wormhole, liquid-tether).
123123

124-
_Current 2.x behavior:_ Having these optional dependencies installed and NOT explicitly specifying `animatable` is deprecated in 2.x and is equivalent to `animatable=false` for backwards compatibility. To get animation, pass `animatable=true` and install `liquid-wormhole` for non-tethering usage and `liquid-tether` for tethering usage.
125-
126-
_Upcoming 3.x behavior:_ Detection will be automatic. To opt out of using animatable features when you have these `liquid-*` addons installed, pass `animatable=false`.
124+
Detection is be automatic. To opt out of using animatable features when you have these `liquid-*` addons installed, pass `animatable=false`.
127125

128126
When in an animatable scenario, you may also pass the following properties, which are passed through to liquid-wormhole or liquid-tether:
129127

addon/components/basic-dialog.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export default Component.extend({
7070
}
7171

7272
// if the click is within the dialog, do nothing
73-
if (document.querySelector(modalSelector).contains(target)) {
73+
let modalEl = document.querySelector(modalSelector);
74+
if (modalEl && modalEl.contains(target)) {
7475
return;
7576
}
7677

addon/components/deprecated-tether-dialog.js

Lines changed: 0 additions & 136 deletions
This file was deleted.

addon/components/modal-dialog-overlay.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

addon/components/modal-dialog.js

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
11
import Component from '@ember/component';
22
import { dasherize } from '@ember/string';
33
import { computed } from '@ember/object';
4-
import { isNone, isEmpty } from '@ember/utils';
4+
import { isEmpty } from '@ember/utils';
55
import { inject as service } from '@ember/service';
66
import layout from '../templates/components/modal-dialog';
7-
import { deprecate, warn } from '@ember/debug';
7+
import { warn } from '@ember/debug';
88
import { DEBUG } from '@glimmer/env';
99

1010
const VALID_OVERLAY_POSITIONS = ['parent', 'sibling'];
1111

12-
function deprecateImplicitAnimatableWithLiquidTetherPresent() {
13-
deprecate(
14-
'Rendering modal-dialog with a tetherTarget and liquid-tether installed, and NOT explicitly specifying `animatable` will change behavior in 3.0.0 to use liquid-tether. Pass `animatable=false` to maintain current behavior and remove this message.',
15-
false,
16-
{ id: 'ember-modal-dialog.implicit-animatable', until: '3.0.0' }
17-
);
18-
}
19-
20-
function deprecateImplicitAnimatableWithLiquidWormholePresent() {
21-
deprecate(
22-
'Rendering modal-dialog with liquid-wormhole installed, and NOT explicitly specifying `animatable` will change behavior in 3.0.0 to use liquid-wormhole. Pass `animatable=false` to maintain current behavior and remove this message.',
23-
false,
24-
{ id: 'ember-modal-dialog.implicit-animatable', until: '3.0.0' }
25-
);
26-
}
27-
2812
export default Component.extend({
2913
tagName: '',
3014
layout,
@@ -38,18 +22,11 @@ export default Component.extend({
3822

3923
if (this.get('renderInPlace')) {
4024
return 'ember-modal-dialog/-in-place-dialog';
41-
} else if (tetherTarget && hasLiquidTether && hasLiquidWormhole && isNone(animatable)) {
42-
deprecateImplicitAnimatableWithLiquidTetherPresent();
43-
this.ensureEmberTetherPresent();
44-
return 'ember-modal-dialog/-tether-dialog';
4525
} else if (tetherTarget && hasLiquidTether && hasLiquidWormhole && animatable === true) {
4626
return 'ember-modal-dialog/-liquid-tether-dialog';
4727
} else if (tetherTarget) {
4828
this.ensureEmberTetherPresent();
4929
return 'ember-modal-dialog/-tether-dialog';
50-
} else if (hasLiquidWormhole && isNone(animatable)) {
51-
deprecateImplicitAnimatableWithLiquidWormholePresent();
52-
return 'ember-modal-dialog/-basic-dialog';
5330
} else if (hasLiquidWormhole && animatable === true) {
5431
return 'ember-modal-dialog/-liquid-dialog';
5532
}
@@ -76,66 +53,14 @@ export default Component.extend({
7653
}
7754
},
7855
// onClose - set this from templates
79-
close: computed('onClose', {
80-
get() {
81-
return this.get('onClose');
82-
},
83-
set(key, value) {
84-
deprecate(
85-
'Specifying the `close` action for a modal-dialog/tether-dialog is deprecated in favor of `onClose`. Will be removed in 3.0.0.',
86-
false,
87-
{ id: 'ember-modal-dialog.close-action', until: '3.0.0' }
88-
);
89-
this.set('onClose', value);
90-
},
91-
}),
9256

9357
// containerClass - set this from templates
94-
"container-class": computed('containerClass', {
95-
get() {
96-
return this.get('containerClass');
97-
},
98-
set(key, value) {
99-
deprecate(
100-
'Passing `container-class` (kebab-case) is deprecated in favor of `containerClass` (camelCase). Will be removed in 3.0.0.',
101-
false,
102-
{ id: 'ember-modal-dialog.kebab-props', until: '3.0.0' }
103-
);
104-
this.set('containerClass', value);
105-
},
106-
}),
10758
containerClassNames: ['ember-modal-dialog'], // set this in a subclass definition
10859

10960
// overlayClass - set this from templates
110-
"overlay-class": computed('overlayClass', {
111-
get() {
112-
return this.get('overlayClass');
113-
},
114-
set(key, value) {
115-
deprecate(
116-
'Passing `overlay-class` (kebab-case) is deprecated in favor of `overlayClass` (camelCase). Will be removed in 3.0.0.',
117-
false,
118-
{ id: 'ember-modal-dialog.kebab-props', until: '3.0.0' }
119-
);
120-
this.set('overlayClass', value);
121-
},
122-
}),
12361
overlayClassNames: ['ember-modal-overlay'], // set this in a subclass definition
12462

12563
// wrapperClass - set this from templates
126-
"wrapper-class": computed('wrapperClass', {
127-
get() {
128-
return this.get('wrapperClass');
129-
},
130-
set(key, value) {
131-
deprecate(
132-
'Passing `wrapper-class` (kebab-case) is deprecated in favor of `wrapperClass` (camelCase). Will be removed in 3.0.0.',
133-
false,
134-
{ id: 'ember-modal-dialog.kebab-props', until: '3.0.0' }
135-
);
136-
this.set('wrapperClass', value);
137-
},
138-
}),
13964
wrapperClassNames: ['ember-modal-wrapper'], // set this in a subclass definition
14065

14166
concatenatedProperties: ['containerClassNames', 'overlayClassNames', 'wrapperClassNames'],
@@ -148,19 +73,6 @@ export default Component.extend({
14873
tetherTarget: null,
14974
stack: computed.oneWay('elementId'), // pass a `stack` string to set a "stack" to be passed to liquid-wormhole / liquid-tether
15075
value: 0, // pass a `value` to set a "value" to be passed to liquid-wormhole / liquid-tether
151-
target: computed({ // element, css selector, or view instance
152-
get() {
153-
return 'body';
154-
},
155-
set(key, value) {
156-
deprecate(
157-
'Specifying a `target` on `modal-dialog` is deprecated in favor of padding `tetherTarget`, which will trigger ember-tether usage. Support for `target` will be removed in 3.0.0.',
158-
false,
159-
{ id: 'ember-modal-dialog.modal-dialog-target', until: '3.0.0' }
160-
);
161-
return value;
162-
},
163-
}),
16476

16577
targetAttachment: 'middle center',
16678
tetherClassPrefix: null,

addon/templates/components/deprecated-tether-dialog.hbs

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/components/modal-dialog-overlay.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/components/tether-dialog.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)