@html-next/vertical-collection 1.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,79 @@
1
+ name: Vertical Collection CI
2
+ on:
3
+ pull_request:
4
+ types: [opened, synchronize, reopened, ready_for_review]
5
+
6
+ jobs:
7
+ test:
8
+ name: Run Tests
9
+ runs-on: ubuntu-latest
10
+ timeout-minutes: 6
11
+
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v2
15
+
16
+ - name: Use Node 12
17
+ uses: actions/setup-node@v2-beta
18
+ with:
19
+ node-version: 12.x
20
+
21
+ - name: Node Modules Cache
22
+ uses: actions/cache@v2
23
+ with:
24
+ path: '**/node_modules'
25
+ key: ci-yarn-${{ hashFiles('**/yarn.lock') }}
26
+
27
+ - name: Install Dependencies
28
+ run: yarn install --frozen-lockfile
29
+
30
+ - name: Lint
31
+ run: yarn lint
32
+
33
+ - name: Run Tests
34
+ run: yarn test:ember
35
+ env:
36
+ CI: true
37
+
38
+ test-ember-try:
39
+ name: Run Tests
40
+ runs-on: ubuntu-latest
41
+ timeout-minutes: 10
42
+
43
+ strategy:
44
+ fail-fast: false
45
+ matrix:
46
+ ember-version:
47
+ [
48
+ ember-lts-2.8,
49
+ ember-lts-2.12,
50
+ ember-lts-2.18,
51
+ ember-lts-3.4,
52
+ ember-lts-3.8,
53
+ ember-lts-3.12,
54
+ ember-lts-3.16,
55
+ ember-lts-3.20,
56
+ ember-lts-3.24,
57
+ ember-lts-3.26,
58
+ ]
59
+
60
+ steps:
61
+ - name: Checkout
62
+ uses: actions/checkout@v2
63
+
64
+ - name: Use Node 12
65
+ uses: actions/setup-node@v2-beta
66
+ with:
67
+ node-version: 12.x
68
+
69
+ - name: Node Modules Cache
70
+ uses: actions/cache@v2
71
+ with:
72
+ path: '**/node_modules'
73
+ key: ci-yarn-${{ matrix.ember-version }}-${{ hashFiles('**/yarn.lock') }}
74
+
75
+ - name: Install
76
+ run: yarn install --frozen-lockfile --ignore-engines
77
+
78
+ - name: Run Tests
79
+ run: node_modules/.bin/ember try:one ${{ matrix.ember-version }} --skip-cleanup --- bin/run-tests-with-retry.sh
package/CHANGELOG.md CHANGED
@@ -1,6 +1,31 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## v2.1.0 (2021-12-09)
5
+
6
+ Changelog:
7
+
8
+ * Upgrade ember-cli and dev deps (#348) (e8924e9)
9
+ * Drop Ember global use in favor of native API (#347) (d101d8a)
10
+ * Proper runloop imports (#346) (a765241)
11
+ * Remove property fallback lookup (no implicit this) (#345) (506d798)
12
+ * Modernize `htmlSafe` module imports / More cleanup (#344) (32e9460)
13
+ * Update CI for vertical-collection v2 (#342) (5613faa)
14
+
15
+
16
+ ## v2.0.1 (2021-12-07)
17
+
18
+ #### :bug: Bug Fix
19
+ * [#322](https://github.com/html-next/vertical-collection/pull/322) Remove comma in selector list in css ([@CubeSquared](https://github.com/CubeSquared))
20
+
21
+ #### :house: Internal
22
+ * [#336](https://github.com/html-next/vertical-collection/pull/336) Add rwjblue release-it setup ([@rwwagner90](https://github.com/rwwagner90))
23
+
24
+ #### Committers: 2
25
+ - Matthew Jacobs ([@CubeSquared](https://github.com/CubeSquared))
26
+ - Robert Wagner ([@rwwagner90](https://github.com/rwwagner90))
27
+
28
+
4
29
  ## 0.5.5
5
30
 
6
31
  ### Pull Requests
package/README.md CHANGED
@@ -62,10 +62,10 @@ ember install @html-next/vertical-collection
62
62
 
63
63
  ## Support Matrix
64
64
 
65
- | `vertical-collection` version | Supported Ember versions |
66
- | ----------------------------- | ------------------------ |
67
- | `^v1.0.0` | `v1.12.0 - v3.8.0` |
68
- | `^v2.0.0` | `v3.8.0+` |
65
+ | `vertical-collection` version | Supported Ember versions | Supported Node versions |
66
+ | ----------------------------- | ------------------------ | ----------------------- |
67
+ | `^v1.x.x` | `v1.12.0 - v3.8.x` | `?` |
68
+ | `^v2.x.x` | `v2.8.0 - v3.26.x` | `v12 - ?` |
69
69
 
70
70
  ## Support, Questions, Collaboration
71
71
 
@@ -113,3 +113,8 @@ For updated documentation and demos see [http://html-next.github.io/vertical-col
113
113
  Make sure you register the test waiter from [ember-raf-scheduler](https://github.com/html-next/ember-raf-scheduler). So `ember-test-helpers`'s `wait` is aware of the scheduled updates.
114
114
 
115
115
  An example can be found [here](https://github.com/html-next/vertical-collection/blob/master/tests/test-helper.js#L2)
116
+
117
+ License
118
+ ------------------------------------------------------------------------------
119
+
120
+ This project is licensed under the [MIT License](LICENSE.md).
package/RELEASE.md ADDED
@@ -0,0 +1,60 @@
1
+ # Release Process
2
+
3
+ Releases are mostly automated using
4
+ [release-it](https://github.com/release-it/release-it/) and
5
+ [lerna-changelog](https://github.com/lerna/lerna-changelog/).
6
+
7
+ ## Preparation
8
+
9
+ Since the majority of the actual release process is automated, the primary
10
+ remaining task prior to releasing is confirming that all pull requests that
11
+ have been merged since the last release have been labeled with the appropriate
12
+ `lerna-changelog` labels and the titles have been updated to ensure they
13
+ represent something that would make sense to our users. Some great information
14
+ on why this is important can be found at
15
+ [keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
16
+ guiding principle here is that changelogs are for humans, not machines.
17
+
18
+ When reviewing merged PR's the labels to be used are:
19
+
20
+ * breaking - Used when the PR is considered a breaking change.
21
+ * enhancement - Used when the PR adds a new feature or enhancement.
22
+ * bug - Used when the PR fixes a bug included in a previous release.
23
+ * documentation - Used when the PR adds or updates documentation.
24
+ * internal - Used for internal changes that still require a mention in the
25
+ changelog/release notes.
26
+
27
+ ## Release
28
+
29
+ Once the prep work is completed, the actual release is straight forward:
30
+
31
+ * First, ensure that you have installed your projects dependencies:
32
+
33
+ ```sh
34
+ yarn install
35
+ ```
36
+
37
+ * Second, ensure that you have obtained a
38
+ [GitHub personal access token][generate-token] with the `repo` scope (no
39
+ other permissions are needed). Make sure the token is available as the
40
+ `GITHUB_AUTH` environment variable.
41
+
42
+ For instance:
43
+
44
+ ```bash
45
+ export GITHUB_AUTH=abc123def456
46
+ ```
47
+
48
+ [generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
49
+
50
+ * And last (but not least 😁) do your release.
51
+
52
+ ```sh
53
+ npx release-it
54
+ ```
55
+
56
+ [release-it](https://github.com/release-it/release-it/) manages the actual
57
+ release process. It will prompt you to to choose the version number after which
58
+ you will have the chance to hand tweak the changelog to be used (for the
59
+ `CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
60
+ pushing the tag and commits, etc.
@@ -1,4 +1,3 @@
1
- /* global document */
2
1
  import { ViewportContainer } from '../../-private';
3
2
 
4
3
  function applyVerticalStyles(element, geography) {
@@ -1,7 +1,7 @@
1
1
  import { set } from '@ember/object';
2
2
  import { DEBUG } from '@glimmer/env';
3
-
4
3
  import { IS_GLIMMER_2, gte as emberVersionGTE } from 'ember-compatibility-helpers';
4
+
5
5
  import document from '../../utils/document-shim';
6
6
 
7
7
  let OC_IDENTITY = 0;
@@ -27,11 +27,13 @@ export default class OccludedContent {
27
27
  this.isOccludedContent = true;
28
28
  this.rendered = false;
29
29
 
30
- // In older versions of Ember/IE, binding anything on an object in the template
31
- // adds observers which creates __ember_meta__
32
- this.__ember_meta__ = null; // eslint-disable-line camelcase
30
+ if (!emberVersionGTE('3.0.0')) {
31
+ // In older versions of Ember, binding anything on an object in the template
32
+ // adds observers which creates __ember_meta__
33
+ this.__ember_meta__ = null; // eslint-disable-line camelcase
34
+ }
33
35
 
34
- if (DEBUG && emberVersionGTE('1.13.0')) {
36
+ if (DEBUG) {
35
37
  Object.preventExtensions(this);
36
38
  }
37
39
  }
@@ -22,7 +22,7 @@ export function ViewportContainer() {
22
22
  || document.documentElement.scrollTop;
23
23
  },
24
24
  set(v) {
25
- return document.body.scrollTop = document.documentElement.scrollTop = v;
25
+ document.body.scrollTop = document.documentElement.scrollTop = v;
26
26
  }
27
27
  });
28
28
 
@@ -34,7 +34,7 @@ export function ViewportContainer() {
34
34
  || document.documentElement.scrollLeft;
35
35
  },
36
36
  set(v) {
37
- return window.scrollX
37
+ window.scrollX
38
38
  = window.pageXOffset
39
39
  = document.body.scrollLeft
40
40
  = document.documentElement.scrollLeft = v;
@@ -1,8 +1,8 @@
1
1
  import { set } from '@ember/object';
2
2
  import { assert } from '@ember/debug';
3
3
  import { DEBUG } from '@glimmer/env';
4
-
5
4
  import { IS_GLIMMER_2, gte as emberVersionGTE } from 'ember-compatibility-helpers';
5
+
6
6
  import document from '../../utils/document-shim';
7
7
 
8
8
  let VC_IDENTITY = 0;
@@ -22,11 +22,13 @@ export default class VirtualComponent {
22
22
 
23
23
  this.rendered = false;
24
24
 
25
- // In older versions of Ember/IE, binding anything on an object in the template
26
- // adds observers which creates __ember_meta__
27
- this.__ember_meta__ = null; // eslint-disable-line camelcase
25
+ if (!emberVersionGTE('3.0.0')) {
26
+ // In older versions of Ember, binding anything on an object in the template
27
+ // adds observers which creates __ember_meta__
28
+ this.__ember_meta__ = null; // eslint-disable-line camelcase
29
+ }
28
30
 
29
- if (DEBUG && emberVersionGTE('1.13.0')) {
31
+ if (DEBUG) {
30
32
  Object.preventExtensions(this);
31
33
  }
32
34
  }
@@ -1,4 +1,4 @@
1
- import { run } from '@ember/runloop';
1
+ import { begin, end } from '@ember/runloop';
2
2
  import { scheduler } from 'ember-raf-scheduler';
3
3
  import SUPPORTS_PASSIVE from './supports-passive';
4
4
  const DEFAULT_ARRAY_SIZE = 10;
@@ -110,11 +110,11 @@ export class ScrollHandler {
110
110
 
111
111
  // TODO add explicit test
112
112
  if (topChanged || leftChanged) {
113
- run.begin();
113
+ begin();
114
114
  for (let j = 0; j < meta.handlers.length; j++) {
115
115
  meta.handlers[j](event);
116
116
  }
117
- run.end();
117
+ end();
118
118
  }
119
119
  }
120
120
 
@@ -22,7 +22,7 @@ export function ViewportContainer() {
22
22
  || document.documentElement.scrollTop;
23
23
  },
24
24
  set(v) {
25
- return document.body.scrollTop = document.documentElement.scrollTop = v;
25
+ document.body.scrollTop = document.documentElement.scrollTop = v;
26
26
  }
27
27
  });
28
28
 
@@ -34,7 +34,7 @@ export function ViewportContainer() {
34
34
  || document.documentElement.scrollLeft;
35
35
  },
36
36
  set(v) {
37
- return window.scrollX
37
+ window.scrollX
38
38
  = window.pageXOffset
39
39
  = document.body.scrollLeft
40
40
  = document.documentElement.scrollLeft = v;
@@ -7,8 +7,6 @@ import layout from './template';
7
7
 
8
8
  import { scheduler, Token } from 'ember-raf-scheduler';
9
9
 
10
- import { SUPPORTS_INVERSE_BLOCK, SUPPORTS_CLOSURE_ACTIONS } from 'ember-compatibility-helpers';
11
-
12
10
  import {
13
11
  keyForItem,
14
12
  DynamicRadar,
@@ -189,14 +187,10 @@ const VerticalCollection = Component.extend({
189
187
  const key = keyForItem(item, keyPath, index);
190
188
 
191
189
  // this.sendAction will be deprecated in ember 4.0
192
- if (SUPPORTS_CLOSURE_ACTIONS) {
193
- const _action = get(this, action);
194
- if (typeof _action == 'function') {
195
- _action(item, index, key);
196
- } else if (typeof _action === 'string') {
197
- this.sendAction(action, item, index, key);
198
- }
199
- } else {
190
+ const _action = get(this, action);
191
+ if (typeof _action == 'function') {
192
+ _action(item, index, key);
193
+ } else if (typeof _action === 'string') {
200
194
  this.sendAction(action, item, index, key);
201
195
  }
202
196
  });
@@ -293,12 +287,6 @@ VerticalCollection.reopenClass({
293
287
  positionalParams: ['items']
294
288
  });
295
289
 
296
- if (!SUPPORTS_INVERSE_BLOCK) {
297
- VerticalCollection.reopen({
298
- shouldYieldToInverse: false
299
- });
300
- }
301
-
302
290
  function calculateStartingIndex(items, idForFirstItem, key, renderFromLast) {
303
291
  const totalItems = get(items, 'length');
304
292
 
@@ -1,4 +1,4 @@
1
- {{#each virtualComponents key="id" as |virtualComponent| ~}}
1
+ {{#each this.virtualComponents key="id" as |virtualComponent| ~}}
2
2
  {{~unbound virtualComponent.upperBound~}}
3
3
  {{~#if virtualComponent.isOccludedContent ~}}
4
4
  {{{unbound virtualComponent.element}}}
@@ -8,6 +8,6 @@
8
8
  {{~unbound virtualComponent.lowerBound~}}
9
9
  {{~/each}}
10
10
 
11
- {{#if shouldYieldToInverse}}
11
+ {{#if this.shouldYieldToInverse}}
12
12
  {{yield to="inverse"}}
13
13
  {{/if}}
@@ -13,7 +13,7 @@
13
13
  table .occluded-content,
14
14
  tbody .occluded-content,
15
15
  thead .occluded-content,
16
- tfoot .occluded-content, {
16
+ tfoot .occluded-content {
17
17
  display: table-row;
18
18
  position: relative;
19
19
  width: 100%;
@@ -0,0 +1,27 @@
1
+ #!/bin/bash
2
+
3
+ function retry {
4
+ command="$*"
5
+ retval=1
6
+ attempt=1
7
+ until [[ $retval -eq 0 ]] || [[ $attempt -gt 5 ]]; do
8
+ # Execute inside of a subshell in case parent
9
+ # script is running with "set -e"
10
+ (
11
+ set +e
12
+ $command
13
+ )
14
+ retval=$?
15
+ attempt=$(( $attempt + 1 ))
16
+ if [[ $retval -ne 0 ]]; then
17
+ # If there was an error wait 10 seconds
18
+ sleep 10
19
+ fi
20
+ done
21
+ if [[ $retval -ne 0 ]] && [[ $attempt -gt 2 ]]; then
22
+ # Something is fubar, go ahead and exit
23
+ exit $retval
24
+ fi
25
+ }
26
+
27
+ retry ember test
@@ -1,5 +1 @@
1
- {
2
- "babel": {
3
- "includePolyfill": true
4
- }
5
- }
1
+ {}
package/index.js CHANGED
@@ -139,10 +139,6 @@ module.exports = {
139
139
  exclude.push('initializers/debug.js');
140
140
  }
141
141
 
142
- if (this.checker.forEmber().isAbove('1.13.0')) {
143
- exclude.push('initializers/vertical-collection-legacy-compat.js');
144
- }
145
-
146
142
  return new Funnel(tree, { exclude });
147
143
  }
148
144
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-next/vertical-collection",
3
- "version": "1.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "infinite-scroll, done right. done.",
5
5
  "keywords": [
6
6
  "occlusion",
@@ -15,6 +15,9 @@
15
15
  "lists",
16
16
  "ember-addon"
17
17
  ],
18
+ "homepage": "https://github.com/html-next/vertical-collection",
19
+ "bugs": "https://github.com/html-next/vertical-collection/issues",
20
+ "repository": "https://github.com/html-next/vertical-collection.git",
18
21
  "license": "MIT",
19
22
  "author": {
20
23
  "name": "Chris Thoburn (@runspired)",
@@ -36,65 +39,92 @@
36
39
  "doc": "doc",
37
40
  "test": "tests"
38
41
  },
39
- "repository": "https://github.com/html-next/vertical-collection.git",
40
- "homepage": "https://github.com/html-next/vertical-collection",
41
- "bugs": "https://github.com/html-next/vertical-collection/issues",
42
42
  "scripts": {
43
- "build": "ember build",
43
+ "build": "ember build --environment=production",
44
+ "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
45
+ "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
44
46
  "lint:hbs": "ember-template-lint .",
45
- "lint:js": "eslint .",
47
+ "lint:hbs:fix": "ember-template-lint . --fix",
48
+ "lint:js": "eslint . --cache",
49
+ "lint:js:fix": "eslint . --fix",
46
50
  "start": "ember serve",
47
- "test": "ember test",
48
- "test:all": "ember try:each"
51
+ "test": "npm-run-all lint test:*",
52
+ "test:ember": "ember test",
53
+ "test:ember-compatibility": "ember try:each"
49
54
  },
50
55
  "dependencies": {
51
56
  "babel6-plugin-strip-class-callcheck": "^6.0.0",
52
57
  "broccoli-funnel": "^2.0.2",
53
58
  "broccoli-merge-trees": "^3.0.1",
54
59
  "broccoli-rollup": "^4.1.1",
55
- "ember-cli-babel": "^7.7.3",
60
+ "ember-cli-babel": "^7.12.0",
56
61
  "ember-cli-htmlbars": "^3.0.0",
57
62
  "ember-cli-version-checker": "^3.1.3",
58
- "ember-compatibility-helpers": "^1.2.0",
59
- "ember-raf-scheduler": "0.1.0"
63
+ "ember-compatibility-helpers": "^1.2.1",
64
+ "ember-raf-scheduler": "0.2.0"
60
65
  },
61
66
  "devDependencies": {
62
- "@ember/optional-features": "^0.7.0",
67
+ "@ember/optional-features": "^2.0.0",
68
+ "babel-eslint": "^10.1.0",
63
69
  "bootstrap": "~3.3.5",
64
70
  "broccoli-asset-rev": "^3.0.0",
65
- "ember-cli": "~3.11.0",
66
- "ember-cli-app-version": "^3.2.0",
67
- "ember-cli-dependency-checker": "^3.1.0",
71
+ "ember-cli": "~3.28.0",
72
+ "ember-cli-dependency-checker": "^3.2.0",
68
73
  "ember-cli-eslint": "^5.1.0",
69
74
  "ember-cli-fastboot": "^2.1.3",
70
75
  "ember-cli-github-pages": "^0.2.2",
71
- "ember-cli-htmlbars-inline-precompile": "^2.1.0",
72
- "ember-cli-inject-live-reload": "^2.0.1",
76
+ "ember-cli-htmlbars-inline-precompile": "^3.0.0",
77
+ "ember-cli-inject-live-reload": "^2.1.0",
73
78
  "ember-cli-sri": "^2.1.1",
74
- "ember-cli-template-lint": "^1.0.0-beta.1",
75
- "ember-cli-uglify": "^3.0.0",
79
+ "ember-cli-terser": "^4.0.2",
80
+ "ember-cli-template-lint": "^1.0.0",
76
81
  "ember-code-snippet": "^2.4.1",
77
- "ember-data": "^3.11.4",
82
+ "ember-data": "~3.12.0",
78
83
  "ember-disable-prototype-extensions": "^1.1.3",
79
- "ember-export-application-global": "^2.0.0",
80
- "ember-load-initializers": "^2.0.0",
81
- "ember-maybe-import-regenerator": "^0.1.6",
82
- "ember-native-dom-helpers": "^0.6.3",
84
+ "ember-export-application-global": "^2.0.1",
85
+ "ember-load-initializers": "^2.1.2",
86
+ "ember-native-dom-helpers": "^0.7.0",
83
87
  "ember-perf-timeline": "^1.2.1",
84
88
  "ember-qunit": "^4.5.1",
85
- "ember-resolver": "^5.0.1",
86
- "ember-source": "~3.11.1",
87
- "ember-source-channel-url": "^2.0.1",
88
- "ember-try": "^1.2.1",
89
+ "ember-resolver": "^8.0.2",
90
+ "ember-source": "~3.12.0",
91
+ "ember-source-channel-url": "^3.0.0",
92
+ "ember-try": "^1.4.0",
93
+ "eslint": "^7.32.0",
89
94
  "eslint-plugin-ember": "^6.7.1",
90
95
  "eslint-plugin-node": "^9.1.0",
91
96
  "loader.js": "^4.7.0",
92
- "qunit-dom": "^0.9.0"
97
+ "npm-run-all": "^4.1.5",
98
+ "qunit-dom": "^0.9.0",
99
+ "release-it": "^14.2.1",
100
+ "release-it-lerna-changelog": "^3.1.0"
93
101
  },
94
102
  "engines": {
95
- "node": "8.* || >= 10.*"
103
+ "node": ">= 10.*"
104
+ },
105
+ "publishConfig": {
106
+ "registry": "https://registry.npmjs.org"
96
107
  },
97
108
  "ember-addon": {
98
109
  "configPath": "tests/dummy/config"
110
+ },
111
+ "release-it": {
112
+ "plugins": {
113
+ "release-it-lerna-changelog": {
114
+ "infile": "CHANGELOG.md",
115
+ "launchEditor": true
116
+ }
117
+ },
118
+ "git": {
119
+ "tagName": "v${version}"
120
+ },
121
+ "github": {
122
+ "release": true,
123
+ "tokenRef": "GITHUB_AUTH"
124
+ }
125
+ },
126
+ "volta": {
127
+ "node": "12.22.7",
128
+ "yarn": "1.22.17"
99
129
  }
100
130
  }
@@ -1,16 +0,0 @@
1
- import Ember from 'ember';
2
- import VerticalCollection from '@html-next/vertical-collection/components/vertical-collection/component';
3
-
4
- const { HTMLBars } = Ember;
5
-
6
- HTMLBars._registerHelper('vertical-collection', (params, hash, options, env) => {
7
- hash.items = params.pop();
8
-
9
- return env.helpers.view.helperFunction.call(this, [VerticalCollection], hash, options, env);
10
- });
11
-
12
- export default {
13
- name: 'vertical-collection-legacy-compat',
14
-
15
- initialize() {}
16
- };