Skip to content

Commit

Permalink
Fix jquery-integration optional feature flag to only throw when exp…
Browse files Browse the repository at this point in the history
…licitly enabled.
  • Loading branch information
simonihmig authored and mixonic committed Oct 27, 2021
1 parent 3a5d028 commit 52413c2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/index.js
Expand Up @@ -63,7 +63,6 @@ module.exports = {
name: 'ember-source',
paths,
absolutePaths,
_jqueryIntegrationEnabled: true,
_overrideTree: undefined,

included() {
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 52413c2

Please sign in to comment.