Skip to content

Commit ece60a5

Browse files
authored
Merge pull request #84 from yappbox/ember-3.28
Update to ember 3.28 and address deprecations
2 parents bf58dcf + f823eca commit ece60a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2068
-807
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# misc
1414
/coverage/
1515
!.*
16+
.*/
17+
.eslintcache
1618

1719
# ember-try
1820
/.node_modules.ember-try/

.eslintrc.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,47 @@ module.exports = {
77
ecmaVersion: 2018,
88
sourceType: 'module',
99
ecmaFeatures: {
10-
legacyDecorators: true
11-
}
10+
legacyDecorators: true,
11+
},
1212
},
13-
plugins: [
14-
'ember'
15-
],
13+
plugins: ['ember'],
1614
extends: [
1715
'eslint:recommended',
18-
'plugin:ember/recommended'
16+
'plugin:ember/recommended',
17+
'plugin:prettier/recommended',
1918
],
2019
env: {
21-
browser: true
20+
browser: true,
2221
},
2322
rules: {},
2423
overrides: [
2524
// node files
2625
{
2726
files: [
28-
'.eslintrc.js',
29-
'ember-cli-build.js',
30-
'index.js',
31-
'testem.js',
32-
'blueprints/*/index.js',
33-
'config/**/*.js',
34-
'tests/dummy/config/**/*.js'
35-
],
36-
excludedFiles: [
37-
'addon/**',
38-
'addon-test-support/**',
39-
'app/**',
40-
'tests/dummy/app/**'
27+
'./.eslintrc.js',
28+
'./.prettierrc.js',
29+
'./.template-lintrc.js',
30+
'./ember-cli-build.js',
31+
'./index.js',
32+
'./testem.js',
33+
'./blueprints/*/index.js',
34+
'./config/**/*.js',
35+
'./tests/dummy/config/**/*.js',
4136
],
4237
parserOptions: {
43-
sourceType: 'script'
38+
sourceType: 'script',
4439
},
4540
env: {
4641
browser: false,
47-
node: true
42+
node: true,
4843
},
4944
plugins: ['node'],
50-
extends: ['plugin:node/recommended']
51-
}
52-
]
45+
extends: ['plugin:node/recommended'],
46+
},
47+
{
48+
// Test files:
49+
files: ['tests/**/*-test.{js,ts}'],
50+
extends: ['plugin:qunit/recommended'],
51+
},
52+
],
5353
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/.env*
1313
/.pnp*
1414
/.sass-cache
15+
/.eslintcache
1516
/connect.lock
1617
/coverage/
1718
/libpeerconnection.log

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@
1010
/.editorconfig
1111
/.ember-cli
1212
/.env*
13+
/.eslintcache
1314
/.eslintignore
1415
/.eslintrc.js
1516
/.git/
1617
/.gitignore
18+
/.prettierignore
19+
/.prettierrc.js
20+
/.template-lintrc.js
1721
/.travis.yml
1822
/.watchmanconfig
1923
/bower.json
@@ -22,6 +26,7 @@
2226
/ember-cli-build.js
2327
/testem.js
2428
/tests/
29+
/yarn-error.log
2530
/yarn.lock
2631
.gitkeep
2732

.prettierignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
/vendor/
4+
5+
# compiled output
6+
/dist/
7+
/tmp/
8+
9+
# dependencies
10+
/bower_components/
11+
/node_modules/
12+
13+
# misc
14+
/coverage/
15+
!.*
16+
.eslintcache
17+
18+
# ember-try
19+
/.node_modules.ember-try/
20+
/bower.json.ember-try
21+
/package.json.ember-try

.prettierrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
module.exports = {
4+
singleQuote: true,
5+
};

.template-lintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
module.exports = {
4+
extends: 'recommended',
5+
rules: {
6+
'no-curly-component-invocation': {
7+
allow: ['emitter-action'],
8+
},
9+
},
10+
};

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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-
- "10"
6+
- "12"
77

88
dist: xenial
99

@@ -47,13 +47,15 @@ jobs:
4747

4848
# we recommend new addons test the current and previous LTS
4949
# as well as latest stable release (bonus points to beta/canary)
50-
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
51-
- env: EMBER_TRY_SCENARIO=ember-lts-3.20
50+
- env: EMBER_TRY_SCENARIO=ember-lts-3.24
51+
- env: EMBER_TRY_SCENARIO=ember-lts-3.28
5252
- env: EMBER_TRY_SCENARIO=ember-release
5353
- env: EMBER_TRY_SCENARIO=ember-beta
5454
- env: EMBER_TRY_SCENARIO=ember-canary
5555
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
5656
- env: EMBER_TRY_SCENARIO=ember-classic
57+
- env: EMBER_TRY_SCENARIO=embroider-safe
58+
- env: EMBER_TRY_SCENARIO=embroider-optimized
5759

5860
before_install:
5961
- curl -o- -L https://yarnpkg.com/install.sh | bash

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
## Linting
1010

11-
* `npm run lint:hbs`
12-
* `npm run lint:js`
13-
* `npm run lint:js -- --fix`
11+
* `yarn lint`
12+
* `yarn lint:fix`
1413

1514
## Running tests
1615

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
Compatibility
88
------------------------------------------------------------------------------
99

10-
* Ember.js v3.16 or above
11-
* Ember CLI v2.13 or above
12-
* Node.js v10 or above
10+
* Ember.js v3.24 or above
11+
* Ember CLI v3.24 or above
12+
* Node.js v12 or above
1313

1414

1515
Installation

addon/components/collection-scroll-view/collection-items/index.js

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,17 @@ export default class CollectionScrollViewCollectionItems extends Component {
4343
return clientSize ? clientSize.height : estimatedSize.height;
4444
}
4545

46-
safeRerender(){
47-
if (this.isDestroyed || this.isDestroying) {return;}
46+
safeRerender() {
47+
if (this.isDestroyed || this.isDestroying) {
48+
return;
49+
}
4850
this.rerender();
4951
}
5052

5153
get contentSize() {
52-
this._contentSize = this._contentSize || this.cellLayout.contentSize(this.clientWidth, this.clientHeight);
54+
this._contentSize =
55+
this._contentSize ||
56+
this.cellLayout.contentSize(this.clientWidth, this.clientHeight);
5357
return this._contentSize;
5458
}
5559

@@ -64,7 +68,15 @@ export default class CollectionScrollViewCollectionItems extends Component {
6468
}
6569

6670
get renderCells() {
67-
let { cellLayout, cells, items, scrollLeft, scrollTop, clientWidth, clientHeight } = this;
71+
let {
72+
cellLayout,
73+
cells,
74+
items,
75+
scrollLeft,
76+
scrollTop,
77+
clientWidth,
78+
clientHeight,
79+
} = this;
6880
const numItems = items.length;
6981
if (cellLayout.length !== numItems) {
7082
cellLayout.length = numItems;
@@ -73,8 +85,18 @@ export default class CollectionScrollViewCollectionItems extends Component {
7385
let priorMap = this.cellMap;
7486
let cellMap = Object.create(null);
7587

76-
let index = cellLayout.indexAt(scrollLeft, scrollTop, clientWidth, clientHeight);
77-
let count = cellLayout.count(scrollLeft, scrollTop, clientWidth, clientHeight);
88+
let index = cellLayout.indexAt(
89+
scrollLeft,
90+
scrollTop,
91+
clientWidth,
92+
clientHeight
93+
);
94+
let count = cellLayout.count(
95+
scrollLeft,
96+
scrollTop,
97+
clientWidth,
98+
clientHeight
99+
);
78100
let bufferBefore = Math.min(index, this.buffer);
79101
index -= bufferBefore;
80102
count += bufferBefore;
@@ -83,14 +105,18 @@ export default class CollectionScrollViewCollectionItems extends Component {
83105

84106
let newItems = [];
85107

86-
for (i=0; i<count; i++) {
87-
itemIndex = index+i;
108+
for (i = 0; i < count; i++) {
109+
itemIndex = index + i;
88110
itemKey = identity(items[itemIndex]);
89111
if (priorMap) {
90112
cell = priorMap[itemKey];
91113
}
92114
if (cell) {
93-
style = cellLayout.formatItemStyle(itemIndex, clientWidth, clientHeight);
115+
style = cellLayout.formatItemStyle(
116+
itemIndex,
117+
clientWidth,
118+
clientHeight
119+
);
94120
cell.style = style;
95121
cell.hidden = false;
96122
cell.key = itemKey;
@@ -101,14 +127,18 @@ export default class CollectionScrollViewCollectionItems extends Component {
101127
}
102128
}
103129

104-
for (i=0; i < cells.length; i++) {
130+
for (i = 0; i < cells.length; i++) {
105131
cell = cells[i];
106132
if (!cellMap[cell.key]) {
107133
if (newItems.length) {
108134
itemIndex = newItems.pop();
109135
let item = items[itemIndex];
110136
itemKey = identity(item);
111-
style = cellLayout.formatItemStyle(itemIndex, clientWidth, clientHeight);
137+
style = cellLayout.formatItemStyle(
138+
itemIndex,
139+
clientWidth,
140+
clientHeight
141+
);
112142
cell.style = style;
113143
cell.key = itemKey;
114144
cell.index = itemIndex;

addon/components/collection-scroll-view/index.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</div>
2828
{{/if}}
2929

30-
{{#unless (and (has-block 'header') (is-empty this.headerDimensions))}}
30+
{{#if (not (and (has-block 'header') (is-empty this.headerDimensions)))}}
3131
<div data-test-collection-items-container style={{html-safe (concat "position:relative;height:" this.contentSize.height "px;width:" this.contentSize.width "px")}}>
3232
<CollectionScrollView::CollectionItems
3333
@clientSize={{this.collectionClientSize}}
@@ -44,7 +44,7 @@
4444
{{~/each~}}
4545
</CollectionScrollView::CollectionItems>
4646
</div>
47-
{{/unless}}
47+
{{/if}}
4848

4949
{{#if @revealService}}
5050
{{emitter-action

0 commit comments

Comments
 (0)