Skip to content

Commit

Permalink
refactor(legacy support): use unified component
Browse files Browse the repository at this point in the history
* uses `in-element-polyfill` and `maybe-in-element` AST transforms to allow to use `in-element` with legacy support back to Ember 1.13 (ember-wormhole based)
* Cleaned up unnecessary legacy components

Closes kybishop#71

BREAKING CHANGE:
Support for Ember <1.13 has been dropped!
  • Loading branch information
simonihmig committed Apr 6, 2018
1 parent de2e341 commit fdf35f8
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 345 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ env:
matrix:
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-1.11
- EMBER_TRY_SCENARIO=ember-1.13
- EMBER_TRY_SCENARIO=ember-lts-2.4
- EMBER_TRY_SCENARIO=ember-lts-2.8
Expand Down
90 changes: 0 additions & 90 deletions addon/components/-ember-popper-legacy.js

This file was deleted.

90 changes: 0 additions & 90 deletions addon/components/-ember-popper-targeting-parent-legacy.js

This file was deleted.

1 change: 0 additions & 1 deletion addon/templates/components/-ember-popper-legacy-1.11.hbs

This file was deleted.

6 changes: 0 additions & 6 deletions addon/templates/components/-ember-popper-legacy.hbs

This file was deleted.

27 changes: 8 additions & 19 deletions addon/templates/components/ember-popper-targeting-parent.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{{unbound _parentFinder}}

{{#if renderInPlace}}
{{!-- Elements that exist deep within the document tree are given an implicitly lower z-index
value than elements that aren't as deep in the tree; this has the effect of hiding our
ember-popper behind less-nested elements. Due to the way z-indexing works, we cannot simply
add a higher z-index value to our ember-popper. To avoid this issue, we render the element
on the document body, giving it the highest default z-index value. --}}
{{#maybe-in-element _popperContainer renderInPlace}}
{{!-- Add a wrapper around the yielded block so we have something for the Popper to target --}}
<div id={{id}} class={{class}} role={{ariaRole}}>
{{yield (hash
disableEventListeners=(action 'disableEventListeners')
Expand All @@ -9,21 +15,4 @@
update=(action 'update')
)}}
</div>
{{else}}
{{!-- Elements that exist deep within the document tree are given an implicitly lower z-index
value than elements that aren't as deep in the tree; this has the effect of hiding our
ember-popper behind less-nested elements. Due to the way z-indexing works, we cannot simply
add a higher z-index value to our ember-popper. To avoid this issue, we render the element
on the document body, giving it the highest default z-index value. --}}
{{#-in-element _popperContainer}}
{{!-- Add a wrapper around the yielded block so we have something for the Popper to target --}}
<div id={{id}} class={{class}} role={{ariaRole}}>
{{yield (hash
disableEventListeners=(action 'disableEventListeners')
enableEventListeners=(action 'enableEventListeners')
scheduleUpdate=(action 'scheduleUpdate')
update=(action 'update')
)}}
</div>
{{/-in-element}}
{{/if}}
{{/maybe-in-element}}
27 changes: 8 additions & 19 deletions addon/templates/components/ember-popper.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{{#if renderInPlace}}
{{!-- Elements that exist deep within the document tree are given an implicitly lower z-index
value than elements that aren't as deep in the tree; this has the effect of hiding our
ember-popper behind less-nested elements. Due to the way z-indexing works, we cannot simply
add a higher z-index value to our ember-popper. To avoid this issue, we render the element
on the document body, giving it the highest default z-index value. --}}
{{#maybe-in-element _popperContainer renderInPlace}}
{{!-- Add a wrapper around the yielded block so we have something for the Popper to target --}}
<div id={{id}} class={{class}} role={{ariaRole}}>
{{yield (hash
disableEventListeners=(action 'disableEventListeners')
Expand All @@ -7,21 +13,4 @@
update=(action 'update')
)}}
</div>
{{else}}
{{!-- Elements that exist deep within the document tree are given an implicitly lower z-index
value than elements that aren't as deep in the tree; this has the effect of hiding our
ember-popper behind less-nested elements. Due to the way z-indexing works, we cannot simply
add a higher z-index value to our ember-popper. To avoid this issue, we render the element
on the document body, giving it the highest default z-index value. --}}
{{#-in-element _popperContainer}}
{{!-- Add a wrapper around the yielded block so we have something for the Popper to target --}}
<div id={{id}} class={{class}} role={{ariaRole}}>
{{yield (hash
disableEventListeners=(action 'disableEventListeners')
enableEventListeners=(action 'enableEventListeners')
scheduleUpdate=(action 'scheduleUpdate')
update=(action 'update')
)}}
</div>
{{/-in-element}}
{{/if}}
{{/maybe-in-element}}
22 changes: 0 additions & 22 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,6 @@ module.exports = function() {
return {
useYarn: true,
scenarios: [
{
name: 'ember-1.11',
bower: {
dependencies: {
'ember': '~1.11.0',
'ember-cli-shims': '0.0.6'
},
resolutions: {
'ember': '~1.11.0',
'ember-cli-shims': '0.0.6'
}
},
npm: {
devDependencies: {
'ember-cli-fastboot': null,
'ember-cli-shims': null,
'ember-native-dom-event-dispatcher': null,
'ember-source': null,
'fastboot': null
}
}
},
{
name: 'ember-1.13',
bower: {
Expand Down
Loading

0 comments on commit fdf35f8

Please sign in to comment.