Skip to content

Commit

Permalink
Better Workaround for prod build error
Browse files Browse the repository at this point in the history
  • Loading branch information
0xadada committed Feb 6, 2018
1 parent 58624cd commit 4beb2af
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 22 deletions.
21 changes: 18 additions & 3 deletions config/targets.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
module.exports = {
browsers: [
/*
* compilation via Browserlist
* https://github.com/ai/browserslist
* tooling: http://browserl.ist/
*/

let browsers;
if (process.env.EMBER_ENV === 'development') {
// development performance optimization: transpile for developers browsers
browsers = ['last 1 Chrome versions', 'last 1 Firefox versions'];
} else {
browsers = [
// '> 0.5%' /* http://browserl.ist/?q=%3E+0.5%25 */
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
]
];
}

module.exports = {
browsers
};
6 changes: 0 additions & 6 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ module.exports = function(defaults) {
extensions: ['css', 'gif', 'js', 'jpg', 'png', 'map', 'svg']
},

'ember-cli-uglify': {
uglify: {
compress: false /* TODO: workaround for https://github.com/ember-cli/ember-cli-uglify/issues/35 */
}
},

inlineContent: {
host: {
content: HOST
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"node-fetch"
],
"resolutions": {
"ember-simple-auth": "0xadada/ember-simple-auth#13a8a1d461fdac769f566b41beda61972118c2b4"
"ember-simple-auth": "0xadada/ember-simple-auth#13a8a1d461fdac769f566b41beda61972118c2b4",
"broccoli-uglify-sourcemap": "0xadada/broccoli-uglify-sourcemap#update-deps"
}
}
9 changes: 6 additions & 3 deletions tests/acceptance/media/new-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,23 @@ module('Application | media/new', function(hooks) {
});

test('can add and delete valid media', async function(assert) {
server.logging = true;
assert.expect(3);
// create an OAuth token w/ ember-cli-mirage
await visit('/media/new');
await fillIn('[name=title]', 'asdf title');
await fillIn('[name=url]', 'http://t.co');
await click('button');
assert.equal(currentURL(), '/', 'user lands on home route');
let expected = this.element.querySelector('.ma-MediaListItem').length;
let expected = this.element.querySelectorAll('.ma-MediaListItem').length;
let msg = this.element.querySelector('.container').textContent;
assert.notEqual(msg.match(/asdf title/), null);
// delete new media
await click('.ma-MediaListItem .ma-MediaListItem-delete');
let result = this.element.querySelector('.ma-MediaListItem').length;
assert.equal(result, expected, 'media was deleted');
let result = this.element.querySelectorAll('.ma-MediaListItem')
? this.element.querySelectorAll('.ma-MediaListItem').length
: 0;
assert.equal(result, expected - 1, 'media was deleted');
});

test('ma-create-media can gracefully handle errors', async function(assert) {
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1904,9 +1904,9 @@ broccoli-templater@^1.0.0:
broccoli-stew "^1.2.0"
lodash.template "^3.3.2"

broccoli-uglify-sourcemap@^2.0.0:
broccoli-uglify-sourcemap@0xadada/broccoli-uglify-sourcemap#update-deps, broccoli-uglify-sourcemap@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/broccoli-uglify-sourcemap/-/broccoli-uglify-sourcemap-2.0.2.tgz#f4a73112f1f56b46043e2e89cba5ce7762cddeb3"
resolved "https://codeload.github.com/0xadada/broccoli-uglify-sourcemap/tar.gz/ae34496fe34c208cec15d00bca8389a356d2ebf4"
dependencies:
broccoli-plugin "^1.2.1"
debug "^3.1.0"
Expand All @@ -1915,7 +1915,7 @@ broccoli-uglify-sourcemap@^2.0.0:
mkdirp "^0.5.0"
source-map-url "^0.4.0"
symlink-or-copy "^1.0.1"
uglify-es "^3.1.3"
uglify-es "^3.1.9"
walk-sync "^0.3.2"

broccoli-unwatched-tree@^0.1.1:
Expand Down Expand Up @@ -2338,7 +2338,7 @@ combined-stream@^1.0.5, combined-stream@~1.0.5:
dependencies:
delayed-stream "~1.0.0"

[email protected], commander@~2.12.1:
[email protected]:
version "2.12.2"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555"

Expand All @@ -2348,7 +2348,7 @@ [email protected]:
dependencies:
graceful-readlink ">= 1.0.0"

commander@^2.5.0, commander@^2.6.0, commander@^2.9.0:
commander@^2.5.0, commander@^2.6.0, commander@^2.9.0, commander@~2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"

Expand Down Expand Up @@ -9376,11 +9376,11 @@ uc.micro@^1.0.1, uc.micro@^1.0.3:
version "1.0.5"
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.5.tgz#0c65f15f815aa08b560a61ce8b4db7ffc3f45376"

uglify-es@^3.1.3:
version "3.3.5"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.5.tgz#cf7e695da81999f85196b15e2978862f13212f88"
uglify-es@^3.1.9:
version "3.3.9"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
dependencies:
commander "~2.12.1"
commander "~2.13.0"
source-map "~0.6.1"

uglify-js@^2.6:
Expand Down

0 comments on commit 4beb2af

Please sign in to comment.