@adobe/helix-rum-enhancer 2.30.2 → 2.30.4

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
@@ -1,3 +1,21 @@
1
+ ## [2.30.4](https://github.com/adobe/helix-rum-enhancer/compare/v2.30.3...v2.30.4) (2025-02-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **missingresource:** exclude specific RUM tracking resources from missing resource reports ([be1f077](https://github.com/adobe/helix-rum-enhancer/commit/be1f077e6aff202071ea3e5974b4092d6610d66e))
7
+
8
+ ## [2.30.3](https://github.com/adobe/helix-rum-enhancer/compare/v2.30.2...v2.30.3) (2025-02-03)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * collect repeating clicks upto max configuration ([6daba19](https://github.com/adobe/helix-rum-enhancer/commit/6daba19b6dcf3717e8330a923a0d87e61e3080ee))
14
+ * comment for max events tracking ([b4b1c6d](https://github.com/adobe/helix-rum-enhancer/commit/b4b1c6da79a31485bb2165382f9fb9ece611a716))
15
+ * implement flood control with 1024 max events ([e06e1e5](https://github.com/adobe/helix-rum-enhancer/commit/e06e1e51b6dd3db0a015f4dcccb3ab8dcfb11b9f))
16
+ * Implement flood control with 1024 max events ([ddfdb1e](https://github.com/adobe/helix-rum-enhancer/commit/ddfdb1e9dd58ff41cbd761774af9ad616290aae0))
17
+ * review feedback ([f4e6dd1](https://github.com/adobe/helix-rum-enhancer/commit/f4e6dd1b3fae8e37024045156c85923e776f40c3))
18
+
1
19
  ## [2.30.2](https://github.com/adobe/helix-rum-enhancer/compare/v2.30.1...v2.30.2) (2025-01-17)
2
20
 
3
21
 
package/modules/index.js CHANGED
@@ -34,10 +34,16 @@ const blocksMO = window.MutationObserver ? new MutationObserver(blocksMCB)
34
34
  // eslint-disable-next-line no-use-before-define, max-len
35
35
  const mediaMO = window.MutationObserver ? new MutationObserver(mediaMCB)
36
36
  /* c8 ignore next */ : {};
37
+ /**
38
+ * Maximum number of events. The first call will be made by rum-js,
39
+ * leaving 1023 events for the enhancer to track
40
+ */
41
+ let maxEvents = 1023;
37
42
 
38
43
  function trackCheckpoint(checkpoint, data, t) {
39
44
  const { weight, id } = window.hlx.rum;
40
- if (isSelected) {
45
+ if (isSelected && maxEvents) {
46
+ maxEvents -= 1;
41
47
  const sendPing = (pdata = data) => {
42
48
  // eslint-disable-next-line object-curly-newline, max-len
43
49
  const body = JSON.stringify({ weight, id, referer: urlSanitizers[window.hlx.RUM_MASK_URL || 'path'](), checkpoint, t, ...data }, KNOWN_PROPERTIES);
@@ -169,6 +175,7 @@ function addLoadResourceTracking() {
169
175
  });
170
176
  list.getEntries()
171
177
  .filter((e) => e.responseStatus >= 400)
178
+ .filter((e) => !(new URL(e.name).pathname.match('.*(/\\.rum/1[0-9]{0,3})')))
172
179
  .forEach((e) => {
173
180
  sampleRUM('missingresource', { source: e.name, target: e.responseStatus });
174
181
  });
@@ -301,17 +308,10 @@ function mediaMCB(mutations) {
301
308
  }
302
309
 
303
310
  function addTrackingFromConfig() {
304
- let lastSource;
305
- let lastTarget;
306
311
  document.addEventListener('click', (event) => {
307
- const source = sourceSelector(event.target);
308
- const target = targetSelector(event.target);
309
- if (source !== lastSource || target !== lastTarget) {
310
- sampleRUM('click', { target, source });
311
- lastSource = source;
312
- lastTarget = target;
313
- }
312
+ sampleRUM('click', { target: targetSelector(event.target), source: sourceSelector(event.target) });
314
313
  });
314
+
315
315
  addCWVTracking();
316
316
  addFormTracking(window.document.body);
317
317
  addNavigationTracking();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-rum-enhancer",
3
- "version": "2.30.2",
3
+ "version": "2.30.4",
4
4
  "description": "Helix RUM Enhancer",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -33,15 +33,15 @@
33
33
  "reporter-options": "configFile=.mocha-multi.json"
34
34
  },
35
35
  "devDependencies": {
36
- "@adobe/eslint-config-helix": "2.0.8",
36
+ "@adobe/eslint-config-helix": "2.0.9",
37
37
  "@adobe/helix-rum-js": "2.10.0",
38
38
  "@esm-bundle/chai": "4.3.4-fix.0",
39
39
  "@semantic-release/changelog": "6.0.3",
40
40
  "@semantic-release/git": "10.0.1",
41
41
  "@semantic-release/npm": "12.0.1",
42
- "@web/test-runner": "0.19.0",
42
+ "@web/test-runner": "0.20.0",
43
43
  "@web/test-runner-commands": "0.9.0",
44
- "@web/test-runner-junit-reporter": "0.7.2",
44
+ "@web/test-runner-junit-reporter": "0.8.0",
45
45
  "@web/test-runner-mocha": "0.9.0",
46
46
  "@web/test-runner-playwright": "0.11.0",
47
47
  "c8": "10.1.3",
@@ -52,14 +52,14 @@
52
52
  "husky": "9.1.7",
53
53
  "jsdoc-to-markdown": "9.1.1",
54
54
  "junit-report-builder": "5.1.1",
55
- "lint-staged": "15.3.0",
56
- "mocha": "11.0.1",
55
+ "lint-staged": "15.4.3",
56
+ "mocha": "11.1.0",
57
57
  "mocha-multi-reporters": "1.5.1",
58
- "rollup": "4.30.1",
58
+ "rollup": "4.34.8",
59
59
  "rollup-plugin-checksum": "1.0.1",
60
60
  "rollup-plugin-cleanup": "3.2.1",
61
61
  "rollup-plugin-eslint-bundle": "9.0.0",
62
- "semantic-release": "24.2.1",
62
+ "semantic-release": "24.2.3",
63
63
  "semantic-release-slack-bot": "^4.0.2",
64
64
  "web-vitals": "4.2.4"
65
65
  },
package/src/index.js CHANGED
@@ -199,9 +199,11 @@
199
199
  : {};
200
200
  const mediaMO = window.MutationObserver ? new MutationObserver(mediaMCB)
201
201
  : {};
202
+ let maxEvents = 1023;
202
203
  function trackCheckpoint(checkpoint, data, t) {
203
204
  const { weight, id } = window.hlx.rum;
204
- if (isSelected) {
205
+ if (isSelected && maxEvents) {
206
+ maxEvents -= 1;
205
207
  const sendPing = (pdata = data) => {
206
208
  const body = JSON.stringify({ weight, id, referer: urlSanitizers[window.hlx.RUM_MASK_URL || 'path'](), checkpoint, t, ...data }, KNOWN_PROPERTIES);
207
209
  const urlParams = window.RUM_PARAMS ? `?${new URLSearchParams(window.RUM_PARAMS).toString()}` : '';
@@ -312,6 +314,7 @@
312
314
  });
313
315
  list.getEntries()
314
316
  .filter((e) => e.responseStatus >= 400)
317
+ .filter((e) => !(new URL(e.name).pathname.match('.*(/\\.rum/1[0-9]{0,3})')))
315
318
  .forEach((e) => {
316
319
  sampleRUM('missingresource', { source: e.name, target: e.responseStatus });
317
320
  });
@@ -422,16 +425,8 @@
422
425
  });
423
426
  }
424
427
  function addTrackingFromConfig() {
425
- let lastSource;
426
- let lastTarget;
427
428
  document.addEventListener('click', (event) => {
428
- const source = sourceSelector(event.target);
429
- const target = targetSelector(event.target);
430
- if (source !== lastSource || target !== lastTarget) {
431
- sampleRUM('click', { target, source });
432
- lastSource = source;
433
- lastTarget = target;
434
- }
429
+ sampleRUM('click', { target: targetSelector(event.target), source: sourceSelector(event.target) });
435
430
  });
436
431
  addCWVTracking();
437
432
  addFormTracking(window.document.body);
package/src/index.md5 CHANGED
@@ -1 +1 @@
1
- 389f38e9847798177fc9bd3f8f9b763b
1
+ 05d822cf8ae941dba904233aab4bc490