@html-next/vertical-collection 4.0.0 → 4.0.2

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@ Changelog
2
2
  =========
3
3
 
4
4
 
5
+
6
+
7
+ ## v4.0.2 (2022-11-17)
8
+
9
+ #### :bug: Bug Fix
10
+ * [#396](https://github.com/html-next/vertical-collection/pull/396) Fix build for ember-source 4.0+ ([@wagenet](https://github.com/wagenet))
11
+
12
+ #### Committers: 1
13
+ - Peter Wagenet ([@wagenet](https://github.com/wagenet))
14
+
15
+ ## v4.0.1 (2022-11-07)
16
+
17
+ #### :memo: Documentation
18
+ * [#381](https://github.com/html-next/vertical-collection/pull/381) Fix README ([@runspired](https://github.com/runspired))
19
+
20
+ #### Committers: 4
21
+ - Alex Navasardyan ([@twokul](https://github.com/twokul))
22
+ - Chris Thoburn ([@runspired](https://github.com/runspired))
23
+ - Matthew Beale ([@mixonic](https://github.com/mixonic))
24
+ - [@Atrue](https://github.com/Atrue)
25
+
26
+
5
27
  ## v4.0.0 (2022-09-12)
6
28
 
7
29
  * Drops support for Ember < 3.12-LTS.
package/README.md CHANGED
@@ -88,7 +88,7 @@ It works via a scrollable div or scrollable body.
88
88
 
89
89
  ### Svelte Everything
90
90
 
91
- If it can be trimmer, smoke-and-mirrors likes to trim it.
91
+ If it can be trimmer, vertical-collection likes to trim it.
92
92
 
93
93
  ## Status
94
94
 
@@ -327,6 +327,7 @@ const VerticalCollection = Component.extend({
327
327
  _radar.bufferSize = this.bufferSize;
328
328
 
329
329
  _radar.scheduleUpdate(true);
330
+ this._clearScheduledActions();
330
331
 
331
332
  return _radar.virtualComponents;
332
333
  }),
@@ -335,6 +336,12 @@ const VerticalCollection = Component.extend({
335
336
  return scheduler.schedule(queueName, job, this.token);
336
337
  },
337
338
 
339
+ _clearScheduledActions() {
340
+ clearTimeout(this._nextSendActions);
341
+ this._nextSendActions = null;
342
+ this._scheduledActions.length = 0;
343
+ },
344
+
338
345
  _scheduleSendAction(action, index) {
339
346
  this._scheduledActions.push([action, index]);
340
347
 
package/index.js CHANGED
@@ -19,16 +19,16 @@ module.exports = {
19
19
  return '';
20
20
  },
21
21
 
22
- // Borrowed from ember-cli-babel
23
- _emberVersionRequiresModulesAPIPolyfill() {
24
- let checker = this.checker.for('ember-source', 'npm');
22
+ // Borrowed from ember-cli-babel
23
+ _emberVersionRequiresModulesAPIPolyfill() {
24
+ let checker = this.checker.for('ember-source', 'npm');
25
25
 
26
- if (!checker.exists()) {
27
- return true;
28
- }
26
+ if (!checker.exists()) {
27
+ return true;
28
+ }
29
29
 
30
- return checker.lt('3.27.0-alpha.1');
31
- },
30
+ return checker.lt('3.27.0-alpha.1');
31
+ },
32
32
 
33
33
  treeForAddon(tree) {
34
34
  let babel = this.addons.find((addon) => addon.name === 'ember-cli-babel');
@@ -41,38 +41,34 @@ module.exports = {
41
41
  destDir: '@html-next/vertical-collection'
42
42
  });
43
43
 
44
- // When compiling with `compileModules: false`, ember-cli-babel defaults to
45
- // using the modules polyfill, since it assumes we are concatenating the
46
- // output script using `app.import` without an AMD wrapper.
47
- //
48
- // This does not apply to us, since we are compiling the `-private` modules
49
- // into a single AMD module (via rollup below), which can in fact have
50
- // external dependencies.
51
- //
52
- // We can opt-out of this with `disableEmberModulesAPIPolyfill: true`. In
53
- // Ember versions with "real modules", that is what we want in order to
54
- // avoid the Ember global deprecation (or just completely not working in
55
- // 4.0+).
56
- //
57
- // It seems like the intent may have been that we should be able to set
58
- // this to `true` unconditionally, and `ember-cli-babel` will ignore this
59
- // setting if the Ember verion requires the modules API polyfill. However,
60
- // presumably due to a bug, ember-cli-babel actually checks for this value
61
- // first and return out of the function early if its value is truthy. This
62
- // means that if we set this to true unconditionally, then we would have
63
- // disabled the modules polyfill for Ember versions that needs it, which
64
- // would be incorrect. Therefore, we have to duplicate the detection logic
65
- // here in order to set this value appropriately.
66
- //
67
- // Ideally, we should just stop trying to rollup the -private modules and
68
- // let the modern build pipeline optimizes things for us, then none of this
69
- // would have been necessary.
70
44
  let privateTree = babel.transpileTree(withPrivate, {
71
45
  babel: this.options.babel,
72
46
  'ember-cli-babel': {
47
+ // we leave our output as valid ES
48
+ // for the consuming app's config to transpile as desired
49
+ // so we don't want to compileModules to amd here
73
50
  compileModules: false,
74
- disableEmberModulesAPIPolyfill:
75
- !this._emberVersionRequiresModulesAPIPolyfill(),
51
+
52
+ disableEmberModulesAPIPolyfill: !this._emberVersionRequiresModulesAPIPolyfill(),
53
+
54
+ // TODO for the embroider world we want to leave our -private module
55
+ // as an es module and only transpile the few things we genuinely care about.
56
+ // ideally this would occur as a pre-publish step so that consuming apps would
57
+ // just see a `-private.js` file and not pay any additional costs.
58
+ // CURRENTLY we transpile the -private module fully acccording to the
59
+ // consuming app's config, so we must leave these enabled.
60
+ disablePresetEnv: false,
61
+ disableDebugTooling: false,
62
+ disableDecoratorTransforms: false,
63
+ enableTypeScriptTransform: true,
64
+
65
+ throwUnlessParallelizable: true,
66
+
67
+ // consuming app will take care of this if needed,
68
+ // we don't need to also include
69
+ includePolyfill: false,
70
+
71
+ extensions: ['js', 'ts'],
76
72
  },
77
73
  });
78
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-next/vertical-collection",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "infinite-scroll, done right. done.",
5
5
  "keywords": [
6
6
  "occlusion",