From 6512a5ac60fbabb39e4f780c9838b3efe58fe6c5 Mon Sep 17 00:00:00 2001 From: Christopher Garrett Date: Tue, 4 Dec 2018 11:49:32 -0800 Subject: [PATCH] [BUGFIX beta] Adds early Android versions to legacy target list --- bin/run-tests.js | 8 +- ember-cli-build.js | 2 +- lib/index.js | 22 +- package.json | 22 +- testem.dist.js | 2 +- tests/index.html | 12 +- yarn.lock | 811 ++++++++++++++++++++++++++++++++++++++++++++- 7 files changed, 846 insertions(+), 33 deletions(-) diff --git a/bin/run-tests.js b/bin/run-tests.js index 6d062b71ba6..81d7aa882ff 100755 --- a/bin/run-tests.js +++ b/bin/run-tests.js @@ -100,16 +100,16 @@ function generateBuiltTests() { return run(common + '&enableoptionalfeatures=true&dist=prod&prod=true'); }); testFunctions.push(function() { - return run(common + '&ie=true&nolint=true'); + return run(common + '&legacy=true&nolint=true'); }); testFunctions.push(function() { - return run(common + '&ie=true&dist=min&prod=true'); + return run(common + '&legacy=true&dist=min&prod=true'); }); testFunctions.push(function() { - return run(common + '&ie=true&dist=prod&prod=true'); + return run(common + '&legacy=true&dist=prod&prod=true'); }); testFunctions.push(function() { - return run(common + '&ie=true&enableoptionalfeatures=true&dist=prod&prod=true'); + return run(common + '&legacy=true&enableoptionalfeatures=true&dist=prod&prod=true'); }); } diff --git a/ember-cli-build.js b/ember-cli-build.js index 01f753f1f1b..b0a91ef4e44 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -124,7 +124,7 @@ module.exports = function() { toES5(templateCompilerDependenciesES) ); - bundleTrees.push(new Funnel(bundlesES5, { destDir: 'ie' })); + bundleTrees.push(new Funnel(bundlesES5, { destDir: 'legacy' })); } let emberTestsEmptyTestem = new Funnel('tests', { diff --git a/lib/index.js b/lib/index.js index 31d7f7a25c4..80f1d8461a0 100644 --- a/lib/index.js +++ b/lib/index.js @@ -3,7 +3,6 @@ const fs = require('fs'); const path = require('path'); const resolve = require('resolve'); -const browserslist = require('browserslist'); const paths = {}; const absolutePaths = {}; @@ -69,12 +68,21 @@ module.exports = { let emberSourceDistPath = path.join(__dirname, '..', 'dist'); - if (this.project.targets) { - let browsers = browserslist(this.project.targets.browsers); - - if (browsers.find(browser => browser.startsWith('ie'))) { - emberSourceDistPath = path.join(emberSourceDistPath, 'ie'); - } + let emberCliBabel = this.addons.find(a => a.name === 'ember-cli-babel'); + let needsLegacyBuild = [ + 'transform-template-literals', + 'transform-literals', + 'transform-arrow-functions', + 'transform-destructuring', + 'transform-spread', + 'transform-parameters', + 'transform-computed-properties', + 'transform-shorthand-properties', + 'transform-block-scoping', + ].some(p => emberCliBabel.isPluginRequired(p)); + + if (needsLegacyBuild) { + emberSourceDistPath = path.join(emberSourceDistPath, 'legacy'); } let emberFiles = [ diff --git a/package.json b/package.json index a7bf848f6c7..749aff63c81 100644 --- a/package.json +++ b/package.json @@ -24,16 +24,16 @@ "dist/ember.min.map", "dist/ember.prod.js", "dist/ember.prod.map", - "dist/ie/ember-template-compiler.js", - "dist/ie/ember-template-compiler.map", - "dist/ie/ember-testing.js", - "dist/ie/ember-testing.map", - "dist/ie/ember.debug.js", - "dist/ie/ember.debug.map", - "dist/ie/ember.min.js", - "dist/ie/ember.min.map", - "dist/ie/ember.prod.js", - "dist/ie/ember.prod.map", + "dist/legacy/ember-template-compiler.js", + "dist/legacy/ember-template-compiler.map", + "dist/legacy/ember-testing.js", + "dist/legacy/ember-testing.map", + "dist/legacy/ember.debug.js", + "dist/legacy/ember.debug.map", + "dist/legacy/ember.min.js", + "dist/legacy/ember.min.map", + "dist/legacy/ember.prod.js", + "dist/legacy/ember.prod.map", "docs/data.json", "lib/index.js", "vendor/ember" @@ -63,8 +63,8 @@ "dependencies": { "broccoli-funnel": "^2.0.1", "broccoli-merge-trees": "^2.0.0", - "browserslist": "^4.3.4", "chalk": "^2.3.0", + "ember-cli-babel": "^7.1.3", "ember-cli-get-component-path-option": "^1.0.0", "ember-cli-is-package-missing": "^1.0.0", "ember-cli-normalize-entity-name": "^1.0.0", diff --git a/testem.dist.js b/testem.dist.js index 5747e8a216f..3c58bc8ada2 100644 --- a/testem.dist.js +++ b/testem.dist.js @@ -178,7 +178,7 @@ module.exports = { '-t', '1500', '--u', - '&ie=true', + '&legacy=true', ], protocol: 'browser', }, diff --git a/tests/index.html b/tests/index.html index 6e9a6b9644f..b63fd561354 100644 --- a/tests/index.html +++ b/tests/index.html @@ -74,9 +74,9 @@