Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] Adds early Android versions to legacy target list #17246

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure that this does not cause any unintended side-effects? 1. because ember-cli-babel might do something at app-buildtime and 2. because it's Babel 7, but we're still using Babel 6 to build the Ember.js assets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that ember-cli-babel will only apply to addon source code, so ember-sources addon code, which doesn't exist. There's definitely the discrepancy with Babel 6, but since that is a _pre_publish step and fundamentally disconnected from ember-cli-babel, I figured it would make more sense to use the latest Babel instead. We can change this though if it seems problematic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I just looked at https://unpkg.com/ember-source@3.5.1/lib/index.js, and this does indeed seem safe to do.

"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