Skip to content

Commit

Permalink
[BUGFIX beta] Adds early Android versions to legacy target list
Browse files Browse the repository at this point in the history
  • Loading branch information
pzuraq committed Dec 6, 2018
1 parent 957eda9 commit 6512a5a
Show file tree
Hide file tree
Showing 7 changed files with 846 additions and 33 deletions.
8 changes: 4 additions & 4 deletions bin/run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}

Expand Down
2 changes: 1 addition & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
22 changes: 15 additions & 7 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const fs = require('fs');
const path = require('path');
const resolve = require('resolve');
const browserslist = require('browserslist');

const paths = {};
const absolutePaths = {};
Expand Down Expand Up @@ -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 = [
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion testem.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ module.exports = {
'-t',
'1500',
'--u',
'<url>&ie=true',
'<url>&legacy=true',
],
protocol: 'browser',
},
Expand Down
12 changes: 6 additions & 6 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@

<script>
var dist = QUnit.urlParams.dist;
var ie = QUnit.urlParams.ie;
var legacy = QUnit.urlParams.legacy;

var relativePath = ie ? '../ie' : '..';
var relativePath = legacy ? '../legacy' : '..';

switch (dist) {
case 'prod':
Expand All @@ -99,9 +99,9 @@

<script>
var dist = QUnit.urlParams.dist;
var ie = QUnit.urlParams.ie;
var legacy = QUnit.urlParams.legacy;

var relativePath = ie ? '../ie' : '..';
var relativePath = legacy ? '../legacy' : '..';

if (dist === 'es') {
// do nothing template compiler already included
Expand All @@ -113,9 +113,9 @@
<script>
var prod = QUnit.urlParams.prod;
var dist = QUnit.urlParams.dist;
var ie = QUnit.urlParams.ie;
var legacy = QUnit.urlParams.legacy;

var relativePath = ie ? '../ie' : '..';
var relativePath = legacy ? '../legacy' : '..';

if (dist === 'es') {
// do nothing, tests are included
Expand Down
Loading

0 comments on commit 6512a5a

Please sign in to comment.