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 5, 2018
1 parent 6b173a9 commit 45e7565
Show file tree
Hide file tree
Showing 6 changed files with 845 additions and 30 deletions.
8 changes: 4 additions & 4 deletions bin/run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,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
21 changes: 15 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,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
21 changes: 11 additions & 10 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 @@ -65,6 +65,7 @@
"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
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 45e7565

Please sign in to comment.