Skip to content

Commit

Permalink
Merge pull request #721 from mydea/fn/opt-out-ember-global
Browse files Browse the repository at this point in the history
Add `patchClassicComponent` option to avoid deprecation warnings
  • Loading branch information
Turbo87 authored May 25, 2021
2 parents ff03808 + d67a71e commit 220626c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module.exports = {
} else {
this._stripTestSelectors = !app.tests;
}

this._shouldPatchClassicComponent = !this._stripTestSelectors && addonOptions.patchClassicComponent !== false;
},

_setupPreprocessorRegistry(registry) {
Expand Down Expand Up @@ -73,7 +75,7 @@ module.exports = {
this._registeredWithBabel = true;
}

if (!this._stripTestSelectors) {
if (this._shouldPatchClassicComponent) {
host.import('vendor/ember-test-selectors/patch-component.js');
}
},
Expand All @@ -89,7 +91,7 @@ module.exports = {

treeForAddon() {
// remove our "addon" folder from the build if we're stripping test selectors
if (!this._stripTestSelectors) {
if (this._shouldPatchClassicComponent) {
return this._super.treeForAddon.apply(this, arguments);
}
},
Expand Down

0 comments on commit 220626c

Please sign in to comment.