Skip to content

Commit 99f3c42

Browse files
chore(release): 2.7.1 [skip ci]
## [2.7.1](v2.7.0...v2.7.1) (2024-10-17) ### Bug Fixes * **deps:** update dependency @adobe/helix-rum-js to v2.7.0 ([#106](#106)) ([a934e7b](a934e7b))
1 parent a934e7b commit 99f3c42

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [2.7.1](https://github.com/adobe/aem-lib/compare/v2.7.0...v2.7.1) (2024-10-17)
2+
3+
4+
### Bug Fixes
5+
6+
* **deps:** update dependency @adobe/helix-rum-js to v2.7.0 ([#106](https://github.com/adobe/aem-lib/issues/106)) ([a934e7b](https://github.com/adobe/aem-lib/commit/a934e7b9ae50148ddc6f554172587c6c4f6f613c))
7+
18
# [2.7.0](https://github.com/adobe/aem-lib/compare/v2.6.1...v2.7.0) (2024-10-17)
29

310

dist/aem.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ function sampleRUM(checkpoint, data) {
1818
window.hlx = window.hlx || {};
1919
sampleRUM.enhance = () => {};
2020
if (!window.hlx.rum) {
21+
const param = new URLSearchParams(window.location.search).get('rum');
2122
const weight = (window.SAMPLE_PAGEVIEWS_AT_RATE === 'high' && 10)
2223
|| (window.SAMPLE_PAGEVIEWS_AT_RATE === 'low' && 1000)
23-
|| (new URLSearchParams(window.location.search).get('rum') === 'on' && 1)
24+
|| (param === 'on' && 1)
2425
|| 100;
2526
const id = Math.random().toString(36).slice(-4);
26-
const isSelected = Math.random() * weight < 1;
27+
const isSelected = param !== 'off' && Math.random() * weight < 1;
2728
// eslint-disable-next-line object-curly-newline, max-len
2829
window.hlx.rum = {
2930
weight,
@@ -97,6 +98,9 @@ function sampleRUM(checkpoint, data) {
9798
sampleRUM.sendPing('top', timeShift());
9899

99100
sampleRUM.enhance = () => {
101+
// only enhance once
102+
if (document.querySelector('script[src*="rum-enhancer"]')) return;
103+
100104
const script = document.createElement('script');
101105
script.src = new URL(
102106
'.rum/@adobe/helix-rum-enhancer@^2/src/index.js',

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adobe/aem-lib",
3-
"version": "2.7.0",
3+
"version": "2.7.1",
44
"description": "AEM Library",
55
"type": "module",
66
"scripts": {

0 commit comments

Comments
 (0)