Skip to content

Commit

Permalink
Add back support for Ember 3.16
Browse files Browse the repository at this point in the history
As discussed in #33 (comment), this introduces a conditional to support Ember 3.16+ while still using the latest modifier capabilities when possible. `@embroider/macros` was chosen for this instead of the usual `ember-compatibility-helpers`, as that seems to more future-proof solution to me, especially allowing an easier transition to an eventual native "v2" addon.
  • Loading branch information
simonihmig committed May 26, 2021
1 parent 4bcb685 commit 32fee4c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
fail-fast: true
matrix:
ember-try-scenario:
- ember-lts-3.22
- ember-lts-3.16
- ember-lts-3.20
- ember-release
- ember-beta
- ember-canary
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Please read the [focus-trap](https://github.com/davidtheclark/focus-trap) docume

## Compatibility

- Ember.js v3.22 or above
- Ember CLI v2.13 or above
- Node.js v10 or above
* Ember.js v3.16 or above
* Ember CLI v2.13 or above
* Node.js v10 or above

## Installation

Expand Down
6 changes: 5 additions & 1 deletion addon/modifiers/focus-trap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { createFocusTrap as CreateFocusTrap } from 'focus-trap';

export default setModifierManager(
() => ({
capabilities: capabilities('3.22'),
capabilities: capabilities(
macroCondition(dependencySatisfies('ember-source', '^3.22.0'))
? '3.22'
: '3.13'
),

createModifier() {
return {
Expand Down
12 changes: 10 additions & 2 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ module.exports = async function () {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.22',
name: 'ember-lts-3.16',
npm: {
devDependencies: {
'ember-source': '~3.22.2',
'ember-source': '~3.16.0',
},
},
},
{
name: 'ember-lts-3.20',
npm: {
devDependencies: {
'ember-source': '~3.20.5',
},
},
},
Expand Down

0 comments on commit 32fee4c

Please sign in to comment.