Skip to content

Commit d3a8a86

Browse files
authored
Upgrade to Ember v3.20, drop Node 8 (#170)
* Upgrade to Ember.js v3.20, drop Node 8 * Fix ESLint issues * Fix failing tests * Switch template-lint back to 'recommended' for now * Fix dummy app errors from before already * Update ember-cli-code-coverage to latest * Fix missing await in tests
1 parent 4f249a9 commit d3a8a86

File tree

30 files changed

+16323
-9475
lines changed

30 files changed

+16323
-9475
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
root = true
66

7-
87
[*]
98
end_of_line = lf
109
charset = utf-8

.eslintrc.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
'use strict';
2+
13
module.exports = {
24
root: true,
5+
parser: 'babel-eslint',
36
parserOptions: {
47
ecmaVersion: 2018,
58
sourceType: 'module',
9+
ecmaFeatures: {
10+
legacyDecorators: true
11+
}
612
},
713
plugins: ['ember'],
814
extends: ['eslint:recommended', 'plugin:ember/recommended'],
915
env: {
10-
browser: true,
16+
browser: true
1117
},
1218
rules: {},
1319
overrides: [
@@ -31,21 +37,14 @@ module.exports = {
3137
'tests/dummy/app/**',
3238
],
3339
parserOptions: {
34-
sourceType: 'script',
35-
ecmaVersion: 2015,
40+
sourceType: 'script'
3641
},
3742
env: {
3843
browser: false,
3944
node: true,
4045
},
4146
plugins: ['node'],
42-
rules: Object.assign(
43-
{},
44-
require('eslint-plugin-node').configs.recommended.rules,
45-
{
46-
// add your custom rules and overrides for node files here
47-
}
48-
),
49-
},
50-
],
47+
extends: ['plugin:node/recommended']
48+
}
49+
]
5150
};

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/.env*
1313
/.eslintignore
1414
/.eslintrc.js
15+
/.git/
1516
/.gitignore
1617
/.template-lintrc.js
1718
/.travis.yml

.template-lintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

33
module.exports = {
4-
extends: 'recommended'
4+
extends: 'recommended' // TODO migrate to "octane"
55
};

.travis.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ language: node_js
33
node_js:
44
# we recommend testing addons with the same minimum supported node version as Ember CLI
55
# so that your addon works for all apps
6-
- "8"
6+
- "10"
77

8-
sudo: false
9-
dist: trusty
8+
dist: xenial
109

1110
addons:
1211
chrome: stable
@@ -22,29 +21,34 @@ env:
2221
- CC_TEST_REPORTER_ID=f1b6bcc83789c103f7822eb2ec34bbdc34be1b36bdc66bc6de53c26ed1a14e27
2322

2423
jobs:
25-
fail_fast: true
24+
fast_finish: true
2625
allow_failures:
2726
- env: EMBER_TRY_SCENARIO=ember-canary
2827

2928
include:
3029
# runs linting and tests with current locked deps
31-
3230
- stage: "Tests"
3331
name: "Tests"
3432
script:
35-
- npm run lint:hbs
36-
- npm run lint:js
37-
- npm test
33+
- npm run lint
34+
- npm run test:ember
35+
36+
- stage: "Additional Tests"
37+
name: "Floating Dependencies"
38+
install:
39+
- npm install --no-package-lock
40+
script:
41+
- npm run test:ember
3842

3943
# we recommend new addons test the current and previous LTS
4044
# as well as latest stable release (bonus points to beta/canary)
41-
- stage: "Additional Tests"
42-
env: EMBER_TRY_SCENARIO=ember-lts-2.18
43-
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
45+
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
46+
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
4447
- env: EMBER_TRY_SCENARIO=ember-release
4548
- env: EMBER_TRY_SCENARIO=ember-beta
4649
- env: EMBER_TRY_SCENARIO=ember-canary
4750
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
51+
- env: EMBER_TRY_SCENARIO=ember-classic
4852

4953
before_script:
5054
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
* `ember serve`
2424
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).
2525

26-
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
26+
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017
3+
Copyright (c) 2020
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Add `{{head-layout}}` to your application's `application.hbs` template.
1313
<details>
1414
<summary>Fastboot vs Non-Fastboot Notes</summary>
1515

16+
### Compatibility
17+
18+
* Ember.js v3.12 or above
19+
* Ember CLI v2.13 or above
20+
* Node.js v10 or above
21+
1622
#### Post Install Cleanup
1723

1824
As of v3.0.0 this addon maintains the page title by using the `<title>` tag in your document's `<head>`. This is necessary for [FastBoot](https://github.com/tildeio/ember-cli-fastboot) compatibility.

addon/helpers/page-title.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { scheduleOnce } from '@ember/runloop';
22
import { inject as service } from '@ember/service';
33
import Helper from '@ember/component/helper';
4-
import { set, get } from '@ember/object';
4+
import { set } from '@ember/object';
55
import { guidFor } from '@ember/object/internals';
66
import { assign } from '@ember/polyfills';
77
import { getOwner } from '@ember/application';
@@ -22,7 +22,7 @@ export default Helper.extend({
2222

2323
init() {
2424
this._super();
25-
let tokens = get(this, 'pageTitleList');
25+
let tokens = this.pageTitleList;
2626
tokens.push({ id: guidFor(this) });
2727
},
2828

@@ -35,24 +35,24 @@ export default Helper.extend({
3535
_hash._deprecate
3636
);
3737
}
38-
let tokens = get(this, 'pageTitleList');
38+
let tokens = this.pageTitleList;
3939
let hash = assign({}, _hash);
4040
hash.id = guidFor(this);
4141
hash.title = params.join('');
4242
tokens.push(hash);
43-
scheduleOnce('afterRender', get(this, 'headData'), updateTitle, tokens);
43+
scheduleOnce('afterRender', this.headData, updateTitle, tokens);
4444
return '';
4545
},
4646

4747
destroy() {
48-
let tokens = get(this, 'pageTitleList');
48+
let tokens = this.pageTitleList;
4949
let id = guidFor(this);
5050
tokens.remove(id);
5151

5252
let router = getOwner(this).lookup('router:main');
5353
let routes = router._routerMicrolib || router.router;
5454
let { activeTransition } = routes || {};
55-
let headData = get(this, 'headData');
55+
let headData = this.headData;
5656
if (activeTransition) {
5757
activeTransition.promise.finally(function () {
5858
if (headData.isDestroyed) {

addon/services/page-title-list.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { A } from '@ember/array';
22
import { getOwner } from '@ember/application';
33
import Service from '@ember/service';
4-
import { set, get, computed } from '@ember/object';
4+
import { set, computed } from '@ember/object';
55
import { copy } from 'ember-copy';
66
import { capitalize } from '@ember/string';
77
import { isPresent } from '@ember/utils';
@@ -54,9 +54,9 @@ export default Service.extend({
5454
tokens: null,
5555

5656
applyTokenDefaults(token) {
57-
let defaultSeparator = get(this, "defaultSeparator");
58-
let defaultPrepend = get(this, "defaultPrepend");
59-
let defaultReplace = get(this, "defaultReplace");
57+
let defaultSeparator = this.defaultSeparator;
58+
let defaultPrepend = this.defaultPrepend;
59+
let defaultReplace = this.defaultReplace;
6060

6161
if (token.separator == null) {
6262
token.separator = defaultSeparator;
@@ -112,7 +112,7 @@ export default Service.extend({
112112
let tokens = copy(this.tokens);
113113
tokens.push(token);
114114
set(this, 'tokens', A(tokens));
115-
set(this, 'length', get(this, 'length') + 1);
115+
set(this, 'length', this.length + 1);
116116
},
117117

118118
remove(id) {
@@ -131,12 +131,12 @@ export default Service.extend({
131131
let tokens = A(copy(this.tokens));
132132
tokens.removeObject(token);
133133
set(this, 'tokens', A(tokens));
134-
set(this, 'length', get(this, 'length') - 1);
134+
set(this, 'length', this.length - 1);
135135
},
136136

137137
visibleTokens: computed('tokens', {
138138
get() {
139-
let tokens = get(this, 'tokens');
139+
let tokens = this.tokens;
140140
let i = (tokens ? tokens.length : 0);
141141
let visible = [];
142142
while (i--) {
@@ -154,7 +154,7 @@ export default Service.extend({
154154

155155
sortedTokens: computed('visibleTokens', {
156156
get() {
157-
let visible = get(this, 'visibleTokens');
157+
let visible = this.visibleTokens;
158158
let appending = true;
159159
let group = [];
160160
let groups = A([group]);
@@ -191,7 +191,7 @@ export default Service.extend({
191191
}),
192192

193193
toString() {
194-
let tokens = get(this, 'sortedTokens');
194+
let tokens = this.sortedTokens;
195195
let title = [];
196196
for (let i = 0, len = tokens.length; i < len; i++) {
197197
let token = tokens[i];

0 commit comments

Comments
 (0)