From 49ae89146e5f1e0148beac260eb1479d4a1f33f6 Mon Sep 17 00:00:00 2001 From: simonihmig Date: Fri, 24 Sep 2021 10:40:12 +0200 Subject: [PATCH] Fix `jquery-integration` optional feature flag to only throw when explicitly enabled. --- lib/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index 778268f5618..517ed26abbe 100644 --- a/lib/index.js +++ b/lib/index.js @@ -63,7 +63,6 @@ module.exports = { name: 'ember-source', paths, absolutePaths, - _jqueryIntegrationEnabled: true, _overrideTree: undefined, included() { @@ -143,10 +142,12 @@ module.exports = { } } - this._jqueryIntegrationEnabled = - !optionalFeaturesMissing && optionalFeatures.isFeatureEnabled('jquery-integration'); - - if (this._jqueryIntegrationEnabled) { + if ( + !optionalFeaturesMissing && + optionalFeatures.isFeatureEnabled('jquery-integration') && + typeof optionalFeatures.isFeatureExplicitlySet === 'function' && + optionalFeatures.isFeatureExplicitlySet('jquery-integration') + ) { const SilentError = require('silent-error'); throw new SilentError( 'Setting the `jquery-integration` optional feature flag to `true` was deprecated in Ember 3.x and removed in Ember 4.0.0. You must add the `@ember/optional-features` addon and set this feature to `false`.\n\nFor more information, see the deprecation guide: https://deprecations.emberjs.com/v3.x/#toc_optional-feature-jquery-integration'