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 18, 2020
1 parent 81b36d4 commit 5ef163d
Show file tree
Hide file tree
Showing 6 changed files with 3,969 additions and 3,480 deletions.
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
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 5ef163d

Please sign in to comment.