@openreplay/tracker 6.0.1-beta.2 → 6.0.1

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
@@ -8,6 +8,7 @@
8
8
  - remove useless logs
9
9
  - tune mouse thrashing detection
10
10
  - fix iframe handling
11
+ - improve node counting for dom drop
11
12
 
12
13
  # 6.0.0
13
14
 
package/cjs/app/index.js CHANGED
@@ -34,7 +34,7 @@ class App {
34
34
  this.stopCallbacks = [];
35
35
  this.commitCallbacks = [];
36
36
  this.activityState = ActivityState.NotActive;
37
- this.version = '6.0.1-beta.2'; // TODO: version compatability check inside each plugin.
37
+ this.version = '6.0.1'; // TODO: version compatability check inside each plugin.
38
38
  this.compressionThreshold = 24 * 1000;
39
39
  this._usingOldFetchPlugin = false;
40
40
  this.delay = 0;
@@ -2,6 +2,7 @@ type NodeCallback = (node: Node, isStart: boolean) => void;
2
2
  export default class Nodes {
3
3
  private readonly node_id;
4
4
  private nodes;
5
+ private totalNodeAmount;
5
6
  private readonly nodeCallbacks;
6
7
  private readonly elementListeners;
7
8
  constructor(node_id: string);
package/cjs/app/nodes.js CHANGED
@@ -4,6 +4,7 @@ class Nodes {
4
4
  constructor(node_id) {
5
5
  this.node_id = node_id;
6
6
  this.nodes = [];
7
+ this.totalNodeAmount = 0;
7
8
  this.nodeCallbacks = [];
8
9
  this.elementListeners = new Map();
9
10
  }
@@ -28,6 +29,7 @@ class Nodes {
28
29
  let id = node[this.node_id];
29
30
  const isNew = id === undefined;
30
31
  if (isNew) {
32
+ this.totalNodeAmount++;
31
33
  id = this.nodes.length;
32
34
  this.nodes[id] = node;
33
35
  node[this.node_id] = id;
@@ -44,6 +46,7 @@ class Nodes {
44
46
  this.elementListeners.delete(id);
45
47
  listeners.forEach((listener) => node.removeEventListener(listener[0], listener[1], listener[2]));
46
48
  }
49
+ this.totalNodeAmount--;
47
50
  }
48
51
  return id;
49
52
  }
@@ -69,7 +72,7 @@ class Nodes {
69
72
  return this.nodes[id];
70
73
  }
71
74
  getNodeCount() {
72
- return this.nodes.filter(Boolean).length;
75
+ return this.totalNodeAmount;
73
76
  }
74
77
  clear() {
75
78
  for (let id = 0; id < this.nodes.length; id++) {
package/cjs/index.js CHANGED
@@ -142,7 +142,7 @@ class API {
142
142
  // no-cors issue only with text/plain or not-set Content-Type
143
143
  // req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
144
144
  req.send(JSON.stringify({
145
- trackerVersion: '6.0.1-beta.2',
145
+ trackerVersion: '6.0.1',
146
146
  projectKey: options.projectKey,
147
147
  doNotTrack,
148
148
  // TODO: add precise reason (an exact API missing)
package/lib/app/index.js CHANGED
@@ -31,7 +31,7 @@ export default class App {
31
31
  this.stopCallbacks = [];
32
32
  this.commitCallbacks = [];
33
33
  this.activityState = ActivityState.NotActive;
34
- this.version = '6.0.1-beta.2'; // TODO: version compatability check inside each plugin.
34
+ this.version = '6.0.1'; // TODO: version compatability check inside each plugin.
35
35
  this.compressionThreshold = 24 * 1000;
36
36
  this._usingOldFetchPlugin = false;
37
37
  this.delay = 0;
@@ -2,6 +2,7 @@ type NodeCallback = (node: Node, isStart: boolean) => void;
2
2
  export default class Nodes {
3
3
  private readonly node_id;
4
4
  private nodes;
5
+ private totalNodeAmount;
5
6
  private readonly nodeCallbacks;
6
7
  private readonly elementListeners;
7
8
  constructor(node_id: string);
package/lib/app/nodes.js CHANGED
@@ -2,6 +2,7 @@ export default class Nodes {
2
2
  constructor(node_id) {
3
3
  this.node_id = node_id;
4
4
  this.nodes = [];
5
+ this.totalNodeAmount = 0;
5
6
  this.nodeCallbacks = [];
6
7
  this.elementListeners = new Map();
7
8
  }
@@ -26,6 +27,7 @@ export default class Nodes {
26
27
  let id = node[this.node_id];
27
28
  const isNew = id === undefined;
28
29
  if (isNew) {
30
+ this.totalNodeAmount++;
29
31
  id = this.nodes.length;
30
32
  this.nodes[id] = node;
31
33
  node[this.node_id] = id;
@@ -42,6 +44,7 @@ export default class Nodes {
42
44
  this.elementListeners.delete(id);
43
45
  listeners.forEach((listener) => node.removeEventListener(listener[0], listener[1], listener[2]));
44
46
  }
47
+ this.totalNodeAmount--;
45
48
  }
46
49
  return id;
47
50
  }
@@ -67,7 +70,7 @@ export default class Nodes {
67
70
  return this.nodes[id];
68
71
  }
69
72
  getNodeCount() {
70
- return this.nodes.filter(Boolean).length;
73
+ return this.totalNodeAmount;
71
74
  }
72
75
  clear() {
73
76
  for (let id = 0; id < this.nodes.length; id++) {
package/lib/index.js CHANGED
@@ -137,7 +137,7 @@ export default class API {
137
137
  // no-cors issue only with text/plain or not-set Content-Type
138
138
  // req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
139
139
  req.send(JSON.stringify({
140
- trackerVersion: '6.0.1-beta.2',
140
+ trackerVersion: '6.0.1',
141
141
  projectKey: options.projectKey,
142
142
  doNotTrack,
143
143
  // TODO: add precise reason (an exact API missing)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openreplay/tracker",
3
3
  "description": "The OpenReplay tracker main package",
4
- "version": "6.0.1-beta.2",
4
+ "version": "6.0.1",
5
5
  "keywords": [
6
6
  "logging",
7
7
  "replay"