|
3 | 3 | const MergeTrees = require('broccoli-merge-trees'); |
4 | 4 | const Funnel = require('broccoli-funnel'); |
5 | 5 | const path = require('path'); |
6 | | -const resolve = require('resolve'); |
7 | 6 | const concatBundle = require('./concat-bundle'); |
8 | 7 | const buildDebugMacroPlugin = require('./build-debug-macro-plugin'); |
9 | 8 | const buildStripClassCallcheckPlugin = require('./build-strip-class-callcheck-plugin'); |
@@ -33,7 +32,6 @@ function add(paths, name, path) { |
33 | 32 | add(paths, 'prod', 'vendor/ember/ember.js'); |
34 | 33 | add(paths, 'debug', 'vendor/ember/ember.js'); |
35 | 34 | add(paths, 'testing', 'vendor/ember/ember-testing.js'); |
36 | | -add(paths, 'jquery', 'vendor/ember/jquery/jquery.js'); |
37 | 35 |
|
38 | 36 | add( |
39 | 37 | absolutePaths, |
@@ -95,25 +93,6 @@ module.exports = { |
95 | 93 | ); |
96 | 94 | } |
97 | 95 |
|
98 | | - if ( |
99 | | - optionalFeaturesMissing || |
100 | | - typeof optionalFeatures.isFeatureExplicitlySet !== 'function' |
101 | | - ) { |
102 | | - message.push( |
103 | | - '* Unable to detect if jquery-integration is explicitly set to a value, please update `@ember/optional-features` to the latest version' |
104 | | - ); |
105 | | - } |
106 | | - |
107 | | - if ( |
108 | | - optionalFeaturesMissing || |
109 | | - (typeof optionalFeatures.isFeatureExplicitlySet === 'function' && |
110 | | - !optionalFeatures.isFeatureExplicitlySet('jquery-integration')) |
111 | | - ) { |
112 | | - message.push( |
113 | | - `* The jquery-integration optional feature should be explicitly set to a value under Octane, run \`ember feature:disable jquery-integration\` to disable it, or \`ember feature:enable jquery-integration\` to explicitly enable it` |
114 | | - ); |
115 | | - } |
116 | | - |
117 | 96 | if ( |
118 | 97 | optionalFeaturesMissing || |
119 | 98 | optionalFeatures.isFeatureEnabled('application-template-wrapper') |
@@ -165,11 +144,12 @@ module.exports = { |
165 | 144 | } |
166 | 145 |
|
167 | 146 | this._jqueryIntegrationEnabled = |
168 | | - optionalFeaturesMissing || optionalFeatures.isFeatureEnabled('jquery-integration'); |
| 147 | + !optionalFeaturesMissing && optionalFeatures.isFeatureEnabled('jquery-integration'); |
169 | 148 |
|
170 | 149 | if (this._jqueryIntegrationEnabled) { |
171 | | - this.ui.writeWarnLine( |
172 | | - 'Setting the `jquery-integration` optional feature flag to `true`, or not providing a setting at all, has been deprecated. You must add the `@ember/optional-features` addon and set this feature to `false`. This warning will become an error in Ember 4.0.0.\n\nFor more information, see the deprecation guide: https://deprecations.emberjs.com/v3.x/#toc_optional-feature-jquery-integration' |
| 150 | + const SilentError = require('silent-error'); |
| 151 | + throw new SilentError( |
| 152 | + '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' |
173 | 153 | ); |
174 | 154 | } |
175 | 155 | }, |
@@ -237,10 +217,7 @@ module.exports = { |
237 | 217 | false |
238 | 218 | ); |
239 | 219 |
|
240 | | - let exclude = [ |
241 | | - isProduction ? 'ember-testing/**' : null, |
242 | | - !this._jqueryIntegrationEnabled ? 'jquery' : null, |
243 | | - ].filter((value) => value !== null); |
| 220 | + let exclude = isProduction ? ['ember-testing/**'] : []; |
244 | 221 |
|
245 | 222 | let emberFiles = new MergeTrees([new Funnel(packages, { exclude }), dependencies, headerFiles]); |
246 | 223 |
|
@@ -270,21 +247,6 @@ module.exports = { |
270 | 247 | }, |
271 | 248 |
|
272 | 249 | treeForVendor(tree) { |
273 | | - let jqueryPath; |
274 | | - |
275 | | - try { |
276 | | - jqueryPath = path.dirname( |
277 | | - resolve.sync('jquery/package.json', { basedir: this.project.root }) |
278 | | - ); |
279 | | - } catch (error) { |
280 | | - jqueryPath = path.dirname(require.resolve('jquery/package.json')); |
281 | | - } |
282 | | - |
283 | | - let jquery = new Funnel(jqueryPath + '/dist', { |
284 | | - destDir: 'ember/jquery', |
285 | | - files: ['jquery.js'], |
286 | | - }); |
287 | | - |
288 | 250 | let templateCompiler = new Funnel(tree, { |
289 | 251 | destDir: 'ember', |
290 | 252 | include: ['ember-template-compiler.js', 'ember-template-compiler.map'], |
@@ -319,6 +281,6 @@ module.exports = { |
319 | 281 | }); |
320 | 282 | } |
321 | 283 |
|
322 | | - return debugTree(new MergeTrees([ember, templateCompiler, jquery]), 'vendor:final'); |
| 284 | + return debugTree(new MergeTrees([ember, templateCompiler]), 'vendor:final'); |
323 | 285 | }, |
324 | 286 | }; |
0 commit comments