@adobe/helix-rum-enhancer 2.26.0 → 2.26.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
@@ -1,3 +1,10 @@
1
+ ## [2.26.1](https://github.com/adobe/helix-rum-enhancer/compare/v2.26.0...v2.26.1) (2024-12-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **redirects:** use underscore in param ([bada92e](https://github.com/adobe/helix-rum-enhancer/commit/bada92e69aaa8f560d61d6264f578eb2958934ec))
7
+
1
8
  # [2.26.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.25.0...v2.26.0) (2024-10-16)
2
9
 
3
10
 
package/modules/dom.js CHANGED
@@ -60,8 +60,9 @@ function isButton(el) {
60
60
  }
61
61
 
62
62
  function getSourceContext(el) {
63
- if (el.closest('form')) {
64
- return `form${el.id ? `#${el.id}` : ''}`;
63
+ const formEl = el.closest('form');
64
+ if (formEl) {
65
+ return `form${formEl.id ? `#${formEl.id}` : ''}`;
65
66
  }
66
67
  const block = el.closest('.block[data-block-name]');
67
68
  if (block) return `.${block.getAttribute('data-block-name')}`;
package/modules/index.js CHANGED
@@ -138,7 +138,7 @@ function addNavigationTracking() {
138
138
  sampleRUM('enter', payload); // enter site
139
139
  }
140
140
  fflags.enabled('redirect', () => {
141
- const from = new URLSearchParams(window.location.search).get('redirect-from');
141
+ const from = new URLSearchParams(window.location.search).get('redirect_from');
142
142
  if (redirectCount || from) {
143
143
  sampleRUM('redirect', { source: from, target: redirectCount || 1 });
144
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-rum-enhancer",
3
- "version": "2.26.0",
3
+ "version": "2.26.1",
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.8",
37
- "@adobe/helix-rum-js": "2.6.0",
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",
@@ -48,19 +48,19 @@
48
48
  "eslint": "8.57.1",
49
49
  "eslint-plugin-header": "3.1.1",
50
50
  "eslint-plugin-import": "2.31.0",
51
- "husky": "9.1.6",
52
- "jsdoc-to-markdown": "9.0.2",
51
+ "husky": "9.1.7",
52
+ "jsdoc-to-markdown": "9.1.1",
53
53
  "junit-report-builder": "5.1.1",
54
54
  "lint-staged": "15.2.10",
55
- "mocha": "10.7.3",
55
+ "mocha": "11.0.1",
56
56
  "mocha-multi-reporters": "1.5.1",
57
- "rollup": "4.24.0",
57
+ "rollup": "4.28.1",
58
58
  "rollup-plugin-checksum": "1.0.1",
59
59
  "rollup-plugin-cleanup": "3.2.1",
60
60
  "rollup-plugin-eslint-bundle": "9.0.0",
61
- "semantic-release": "24.1.2",
61
+ "semantic-release": "24.2.0",
62
62
  "semantic-release-slack-bot": "^4.0.2",
63
- "web-vitals": "4.2.3"
63
+ "web-vitals": "4.2.4"
64
64
  },
65
65
  "lint-staged": {
66
66
  "*.js": "eslint",
package/src/index.js CHANGED
@@ -80,8 +80,9 @@
80
80
  return el.getAttribute('role') === 'button';
81
81
  }
82
82
  function getSourceContext(el) {
83
- if (el.closest('form')) {
84
- return `form${el.id ? `#${el.id}` : ''}`;
83
+ const formEl = el.closest('form');
84
+ if (formEl) {
85
+ return `form${formEl.id ? `#${formEl.id}` : ''}`;
85
86
  }
86
87
  const block = el.closest('.block[data-block-name]');
87
88
  if (block) return `.${block.getAttribute('data-block-name')}`;
@@ -286,7 +287,7 @@
286
287
  sampleRUM('enter', payload);
287
288
  }
288
289
  fflags.enabled('redirect', () => {
289
- const from = new URLSearchParams(window.location.search).get('redirect-from');
290
+ const from = new URLSearchParams(window.location.search).get('redirect_from');
290
291
  if (redirectCount || from) {
291
292
  sampleRUM('redirect', { source: from, target: redirectCount || 1 });
292
293
  }
package/src/index.md5 CHANGED
@@ -1 +1 @@
1
- 8094422990fd7a9219bffb7309cb92a2
1
+ 9516743215eadcd19f5b5cf311883d16
@@ -23,6 +23,7 @@ export default {
23
23
  'test/fixtures/**',
24
24
  'node_modules/**',
25
25
  '.rum/**',
26
+ 'src/**',
26
27
  ],
27
28
  },
28
29
  files: [
@@ -43,9 +44,10 @@ export default {
43
44
  context.url = '/node_modules/@adobe/helix-rum-js/dist/rum-standalone.js';
44
45
  await next();
45
46
  context.body = context.body
46
- .replace(/const weight.*/, 'const weight = 1')
47
+ .replace(/const weight =/, 'const weight = 1 ||')
47
48
  .replace(/navigator\.sendBeacon/g, 'fakeSendBeacon')
48
- .replace('.rum/@adobe/helix-rum-enhancer@^2/src/index.js', 'src/index.map.js');
49
+ // eslint-disable-next-line no-template-curly-in-string
50
+ .replace('.rum/@adobe/helix-rum-enhancer@${enhancerVersion || \'^2\'}/src/index.js', 'src/index.map.js');
49
51
  return true;
50
52
  } else if (context.url.startsWith('/.rum/web-vitals')) {
51
53
  context.url = '/node_modules/web-vitals/dist/web-vitals.iife.js';