Skip to content

Commit

Permalink
feat(modifier-managers): use 3.22 capabilities
Browse files Browse the repository at this point in the history
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22

Resolves the issue
  described by: emberjs/ember.js#19162
  fixed by: emberjs/ember.js#19163

Ember apps < 3.22 are unaffected.

This also adds Ember Try support for LTS 3.8 through 3.20
  • Loading branch information
NullVoxPopuli committed Oct 16, 2020
1 parent a2cfad4 commit 267ef12
Show file tree
Hide file tree
Showing 8 changed files with 3,997 additions and 3,480 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
- stage: "Additional Tests"
env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-lts-3.8
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
- env: EMBER_TRY_SCENARIO=ember-lts-3.20
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
Expand Down
3 changes: 2 additions & 1 deletion addon/modifiers/did-insert.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { gte } from 'ember-compatibility-helpers';
import { setModifierManager, capabilities } from '@ember/modifier';

/**
Expand Down Expand Up @@ -46,7 +47,7 @@ import { setModifierManager, capabilities } from '@ember/modifier';
*/
export default setModifierManager(
() => ({
capabilities: capabilities('3.13', { disableAutoTracking: true }),
capabilities: capabilities(gte('3.22.0') ? '3.22' : '3.13', { disableAutoTracking: true }),

createModifier() {},

Expand Down
3 changes: 2 additions & 1 deletion addon/modifiers/did-update.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { gte } from 'ember-compatibility-helpers';
import { setModifierManager, capabilities } from '@ember/modifier';

/**
Expand Down Expand Up @@ -58,7 +59,7 @@ import { setModifierManager, capabilities } from '@ember/modifier';
*/
export default setModifierManager(
() => ({
capabilities: capabilities('3.13', { disableAutoTracking: true }),
capabilities: capabilities(gte('3.22.0') ? '3.22' : '3.13', { disableAutoTracking: true }),

createModifier() {
return { element: null };
Expand Down
3 changes: 2 additions & 1 deletion addon/modifiers/will-destroy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { gte } from 'ember-compatibility-helpers';
import { setModifierManager, capabilities } from '@ember/modifier';

/**
Expand Down Expand Up @@ -40,7 +41,7 @@ import { setModifierManager, capabilities } from '@ember/modifier';
*/
export default setModifierManager(
() => ({
capabilities: capabilities('3.13', { disableAutoTracking: true }),
capabilities: capabilities(gte('3.22.0') ? '3.22' : '3.13', { disableAutoTracking: true }),

createModifier() {
return { element: null };
Expand Down
24 changes: 24 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ module.exports = function() {
},
},
},
{
name: 'ember-lts-3.8',
npm: {
devDependencies: {
'ember-source': '~3.8.0',
},
},
},
{
name: 'ember-lts-3.12',
npm: {
devDependencies: {
'ember-source': '~3.12.0',
},
},
},
{
name: 'ember-lts-3.20',
npm: {
devDependencies: {
'ember-source': '~3.20.0',
},
},
},
{
name: 'ember-release',
npm: {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
},
"dependencies": {
"ember-cli-babel": "^7.10.0",
"ember-modifier-manager-polyfill": "^1.1.0"
"ember-compatibility-helpers": "^1.2.1",
"ember-modifier-manager-polyfill": "^1.2.0"
},
"devDependencies": {
"@ember/optional-features": "^0.7.0",
Expand All @@ -37,7 +38,7 @@
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^4.2.0",
"ember-resolver": "^5.0.1",
"ember-source": "~3.7.0",
"ember-source": "~3.22.0",
"ember-source-channel-url": "^1.1.0",
"ember-template-lint": "^1.1.0",
"ember-try": "^1.0.0",
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/modifiers/did-update-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { render, settled } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

module('Integration | Modifier | did-update', function(hooks) {
Expand All @@ -23,5 +23,6 @@ module('Integration | Modifier | did-update', function(hooks) {
);

this.set('boundValue', 'update');
await settled();
});
});
Loading

0 comments on commit 267ef12

Please sign in to comment.