@adobe/helix-rum-enhancer 2.22.0 → 2.24.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.
- package/.releaserc.cjs +7 -1
- package/CHANGELOG.md +15 -0
- package/modules/fflags.js +1 -0
- package/modules/index.js +14 -3
- package/package.json +4 -3
- package/src/index.js +15 -3
- package/src/index.md5 +1 -1
package/.releaserc.cjs
CHANGED
|
@@ -21,7 +21,13 @@ module.exports = {
|
|
|
21
21
|
"label": "RUM Enhancer Hash"
|
|
22
22
|
}
|
|
23
23
|
]
|
|
24
|
-
}]
|
|
24
|
+
}],
|
|
25
|
+
["semantic-release-slack-bot", {
|
|
26
|
+
notifyOnSuccess: true,
|
|
27
|
+
notifyOnFail: true,
|
|
28
|
+
markdownReleaseNotes: true,
|
|
29
|
+
slackChannel: "rum-explorers",
|
|
30
|
+
}],
|
|
25
31
|
],
|
|
26
32
|
branches: ['main'],
|
|
27
33
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [2.24.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.23.0...v2.24.0) (2024-09-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **navigation:** add support for `redirect` checkpoint ([87b2c05](https://github.com/adobe/helix-rum-enhancer/commit/87b2c057a5e0afbe21cd6224bd995f48ebafa30e))
|
|
7
|
+
* **redirect:** support soft-redirects ([00392c1](https://github.com/adobe/helix-rum-enhancer/commit/00392c18ad8a0677437f5846b9e63ea32df163cb))
|
|
8
|
+
|
|
9
|
+
# [2.23.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.22.0...v2.23.0) (2024-09-19)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **index:** support to attach custom URL parameters to collection URL ([02f4d0b](https://github.com/adobe/helix-rum-enhancer/commit/02f4d0b366505fc17bc251e29364efa2e497c299))
|
|
15
|
+
|
|
1
16
|
# [2.22.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.21.1...v2.22.0) (2024-09-18)
|
|
2
17
|
|
|
3
18
|
|
package/modules/fflags.js
CHANGED
package/modules/index.js
CHANGED
|
@@ -41,7 +41,8 @@ function trackCheckpoint(checkpoint, data, t) {
|
|
|
41
41
|
const sendPing = (pdata = data) => {
|
|
42
42
|
// eslint-disable-next-line object-curly-newline, max-len
|
|
43
43
|
const body = JSON.stringify({ weight, id, referer: urlSanitizers[window.hlx.RUM_MASK_URL || 'path'](), checkpoint, t, ...data }, KNOWN_PROPERTIES);
|
|
44
|
-
const
|
|
44
|
+
const urlParams = window.RUM_PARAMS ? `?${new URLSearchParams(window.RUM_PARAMS).toString()}` : '';
|
|
45
|
+
const { href: url, origin } = new URL(`.rum/${weight}${urlParams}`, sampleRUM.collectBaseURL);
|
|
45
46
|
if (window.location.origin === origin) {
|
|
46
47
|
const headers = { type: 'application/json' };
|
|
47
48
|
navigator.sendBeacon(url, new Blob([body], headers));
|
|
@@ -110,7 +111,7 @@ function addCWVTracking() {
|
|
|
110
111
|
|
|
111
112
|
function addNavigationTracking() {
|
|
112
113
|
// enter checkpoint when referrer is not the current page url
|
|
113
|
-
const navigate = (source, type) => {
|
|
114
|
+
const navigate = (source, type, redirectCount) => {
|
|
114
115
|
const payload = { source, target: document.visibilityState };
|
|
115
116
|
// reload: same page, navigate: same origin, enter: everything else
|
|
116
117
|
if (type === 'reload' || source === window.location.href) {
|
|
@@ -122,10 +123,20 @@ function addNavigationTracking() {
|
|
|
122
123
|
} else {
|
|
123
124
|
sampleRUM('enter', payload); // enter site
|
|
124
125
|
}
|
|
126
|
+
fflags.enabled('redirect', () => {
|
|
127
|
+
const from = new URLSearchParams(window.location.search).get('redirect-from');
|
|
128
|
+
if (redirectCount || from) {
|
|
129
|
+
sampleRUM('redirect', { source: from, target: redirectCount || 1 });
|
|
130
|
+
}
|
|
131
|
+
});
|
|
125
132
|
};
|
|
126
133
|
|
|
127
134
|
new PerformanceObserver((list) => list
|
|
128
|
-
.getEntries().map((entry) => navigate(
|
|
135
|
+
.getEntries().map((entry) => navigate(
|
|
136
|
+
window.hlx.referrer || document.referrer,
|
|
137
|
+
entry.type,
|
|
138
|
+
entry.redirectCount,
|
|
139
|
+
)))
|
|
129
140
|
.observe({ type: 'navigation', buffered: true });
|
|
130
141
|
}
|
|
131
142
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-rum-enhancer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.24.0",
|
|
4
4
|
"description": "Helix RUM Enhancer",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@adobe/eslint-config-helix": "2.0.7",
|
|
37
|
-
"@adobe/helix-rum-js": "2.
|
|
37
|
+
"@adobe/helix-rum-js": "2.6.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",
|
|
@@ -55,10 +55,11 @@
|
|
|
55
55
|
"mocha": "10.7.3",
|
|
56
56
|
"mocha-multi-reporters": "1.5.1",
|
|
57
57
|
"rollup": "4.21.3",
|
|
58
|
-
"rollup-plugin-cleanup": "3.2.1",
|
|
59
58
|
"rollup-plugin-checksum": "1.0.1",
|
|
59
|
+
"rollup-plugin-cleanup": "3.2.1",
|
|
60
60
|
"rollup-plugin-eslint-bundle": "9.0.0",
|
|
61
61
|
"semantic-release": "24.1.1",
|
|
62
|
+
"semantic-release-slack-bot": "^4.0.2",
|
|
62
63
|
"web-vitals": "4.2.3"
|
|
63
64
|
},
|
|
64
65
|
"lint-staged": {
|
package/src/index.js
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
enabled: (flag, callback) => fflags.has(flag) && callback(),
|
|
21
21
|
disabled: (flag, callback) => !fflags.has(flag) && callback(),
|
|
22
22
|
eagercwv: [683],
|
|
23
|
+
redirect: [620, 1139],
|
|
23
24
|
example: [543, 770, 1136],
|
|
24
25
|
language: [543, 959, 1139, 620],
|
|
25
26
|
};
|
|
@@ -199,7 +200,8 @@
|
|
|
199
200
|
if (isSelected) {
|
|
200
201
|
const sendPing = (pdata = data) => {
|
|
201
202
|
const body = JSON.stringify({ weight, id, referer: urlSanitizers[window.hlx.RUM_MASK_URL || 'path'](), checkpoint, t, ...data }, KNOWN_PROPERTIES);
|
|
202
|
-
const
|
|
203
|
+
const urlParams = window.RUM_PARAMS ? `?${new URLSearchParams(window.RUM_PARAMS).toString()}` : '';
|
|
204
|
+
const { href: url, origin } = new URL(`.rum/${weight}${urlParams}`, sampleRUM.collectBaseURL);
|
|
203
205
|
if (window.location.origin === origin) {
|
|
204
206
|
const headers = { type: 'application/json' };
|
|
205
207
|
navigator.sendBeacon(url, new Blob([body], headers));
|
|
@@ -255,7 +257,7 @@
|
|
|
255
257
|
}, 2000);
|
|
256
258
|
}
|
|
257
259
|
function addNavigationTracking() {
|
|
258
|
-
const navigate = (source, type) => {
|
|
260
|
+
const navigate = (source, type, redirectCount) => {
|
|
259
261
|
const payload = { source, target: document.visibilityState };
|
|
260
262
|
if (type === 'reload' || source === window.location.href) {
|
|
261
263
|
sampleRUM('reload', payload);
|
|
@@ -266,9 +268,19 @@
|
|
|
266
268
|
} else {
|
|
267
269
|
sampleRUM('enter', payload);
|
|
268
270
|
}
|
|
271
|
+
fflags.enabled('redirect', () => {
|
|
272
|
+
const from = new URLSearchParams(window.location.search).get('redirect-from');
|
|
273
|
+
if (redirectCount || from) {
|
|
274
|
+
sampleRUM('redirect', { source: from, target: redirectCount || 1 });
|
|
275
|
+
}
|
|
276
|
+
});
|
|
269
277
|
};
|
|
270
278
|
new PerformanceObserver((list) => list
|
|
271
|
-
.getEntries().map((entry) => navigate(
|
|
279
|
+
.getEntries().map((entry) => navigate(
|
|
280
|
+
window.hlx.referrer || document.referrer,
|
|
281
|
+
entry.type,
|
|
282
|
+
entry.redirectCount,
|
|
283
|
+
)))
|
|
272
284
|
.observe({ type: 'navigation', buffered: true });
|
|
273
285
|
}
|
|
274
286
|
function addLoadResourceTracking() {
|
package/src/index.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
734919c8255ab6180ebd17f83f09b78f
|