@adobe/helix-rum-enhancer 2.30.2 → 2.30.3
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 +11 -0
- package/modules/index.js +9 -10
- package/package.json +4 -4
- package/src/index.js +4 -10
- package/src/index.md5 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [2.30.3](https://github.com/adobe/helix-rum-enhancer/compare/v2.30.2...v2.30.3) (2025-02-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* collect repeating clicks upto max configuration ([6daba19](https://github.com/adobe/helix-rum-enhancer/commit/6daba19b6dcf3717e8330a923a0d87e61e3080ee))
|
|
7
|
+
* comment for max events tracking ([b4b1c6d](https://github.com/adobe/helix-rum-enhancer/commit/b4b1c6da79a31485bb2165382f9fb9ece611a716))
|
|
8
|
+
* implement flood control with 1024 max events ([e06e1e5](https://github.com/adobe/helix-rum-enhancer/commit/e06e1e51b6dd3db0a015f4dcccb3ab8dcfb11b9f))
|
|
9
|
+
* Implement flood control with 1024 max events ([ddfdb1e](https://github.com/adobe/helix-rum-enhancer/commit/ddfdb1e9dd58ff41cbd761774af9ad616290aae0))
|
|
10
|
+
* review feedback ([f4e6dd1](https://github.com/adobe/helix-rum-enhancer/commit/f4e6dd1b3fae8e37024045156c85923e776f40c3))
|
|
11
|
+
|
|
1
12
|
## [2.30.2](https://github.com/adobe/helix-rum-enhancer/compare/v2.30.1...v2.30.2) (2025-01-17)
|
|
2
13
|
|
|
3
14
|
|
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);
|
|
@@ -301,17 +307,10 @@ function mediaMCB(mutations) {
|
|
|
301
307
|
}
|
|
302
308
|
|
|
303
309
|
function addTrackingFromConfig() {
|
|
304
|
-
let lastSource;
|
|
305
|
-
let lastTarget;
|
|
306
310
|
document.addEventListener('click', (event) => {
|
|
307
|
-
|
|
308
|
-
const target = targetSelector(event.target);
|
|
309
|
-
if (source !== lastSource || target !== lastTarget) {
|
|
310
|
-
sampleRUM('click', { target, source });
|
|
311
|
-
lastSource = source;
|
|
312
|
-
lastTarget = target;
|
|
313
|
-
}
|
|
311
|
+
sampleRUM('click', { target: targetSelector(event.target), source: sourceSelector(event.target) });
|
|
314
312
|
});
|
|
313
|
+
|
|
315
314
|
addCWVTracking();
|
|
316
315
|
addFormTracking(window.document.body);
|
|
317
316
|
addNavigationTracking();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-rum-enhancer",
|
|
3
|
-
"version": "2.30.
|
|
3
|
+
"version": "2.30.3",
|
|
4
4
|
"description": "Helix RUM Enhancer",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -52,10 +52,10 @@
|
|
|
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
|
|
56
|
-
"mocha": "11.0
|
|
55
|
+
"lint-staged": "15.4.3",
|
|
56
|
+
"mocha": "11.1.0",
|
|
57
57
|
"mocha-multi-reporters": "1.5.1",
|
|
58
|
-
"rollup": "4.
|
|
58
|
+
"rollup": "4.32.0",
|
|
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",
|
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()}` : '';
|
|
@@ -422,16 +424,8 @@
|
|
|
422
424
|
});
|
|
423
425
|
}
|
|
424
426
|
function addTrackingFromConfig() {
|
|
425
|
-
let lastSource;
|
|
426
|
-
let lastTarget;
|
|
427
427
|
document.addEventListener('click', (event) => {
|
|
428
|
-
|
|
429
|
-
const target = targetSelector(event.target);
|
|
430
|
-
if (source !== lastSource || target !== lastTarget) {
|
|
431
|
-
sampleRUM('click', { target, source });
|
|
432
|
-
lastSource = source;
|
|
433
|
-
lastTarget = target;
|
|
434
|
-
}
|
|
428
|
+
sampleRUM('click', { target: targetSelector(event.target), source: sourceSelector(event.target) });
|
|
435
429
|
});
|
|
436
430
|
addCWVTracking();
|
|
437
431
|
addFormTracking(window.document.body);
|
package/src/index.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
6a3cb05a18fc7e179bd98f2c310e8e21
|