@adobe/helix-rum-enhancer 2.7.4 → 2.7.6

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,17 @@
1
+ ## [2.7.6](https://github.com/adobe/helix-rum-enhancer/compare/v2.7.5...v2.7.6) (2024-05-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * no type leads to empty checkpoint ([#167](https://github.com/adobe/helix-rum-enhancer/issues/167)) ([c1d41ad](https://github.com/adobe/helix-rum-enhancer/commit/c1d41ad084fd9e0e71b3bea7aff54e543ee45953))
7
+
8
+ ## [2.7.5](https://github.com/adobe/helix-rum-enhancer/compare/v2.7.4...v2.7.5) (2024-05-14)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * in case window.hlx exists but window.hlx.rum is undefined ([581653b](https://github.com/adobe/helix-rum-enhancer/commit/581653b8e4e3e28c0c8de314454025cd8dbf4618))
14
+
1
15
  ## [2.7.4](https://github.com/adobe/helix-rum-enhancer/compare/v2.7.3...v2.7.4) (2024-05-02)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-rum-enhancer",
3
- "version": "2.7.4",
3
+ "version": "2.7.6",
4
4
  "description": "Helix RUM Enhancer",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "@adobe/eslint-config-helix": "2.0.6",
33
33
  "@semantic-release/changelog": "6.0.3",
34
34
  "@semantic-release/git": "10.0.1",
35
- "@semantic-release/npm": "12.0.0",
35
+ "@semantic-release/npm": "12.0.1",
36
36
  "c8": "9.1.0",
37
37
  "codecov": "3.8.3",
38
38
  "eslint": "8.57.0",
@@ -44,7 +44,7 @@
44
44
  "lint-staged": "15.2.2",
45
45
  "mocha": "10.4.0",
46
46
  "mocha-multi-reporters": "1.5.1",
47
- "semantic-release": "23.0.8"
47
+ "semantic-release": "23.1.1"
48
48
  },
49
49
  "lint-staged": {
50
50
  "*.js": "eslint",
package/src/index.js CHANGED
@@ -12,7 +12,7 @@
12
12
  /* eslint-env browser */
13
13
  const KNOWN_PROPERTIES = ['weight', 'id', 'referer', 'checkpoint', 't', 'source', 'target', 'cwv', 'CLS', 'FID', 'LCP', 'INP', 'TTFB'];
14
14
  const DEFAULT_TRACKING_EVENTS = ['click', 'cwv', 'form', 'enterleave', 'viewblock', 'viewmedia', 'loadresource', 'utm'];
15
- const { sampleRUM, queue, isSelected } = window.hlx ? window.hlx.rum : {};
15
+ const { sampleRUM, queue, isSelected } = (window.hlx && window.hlx.rum) ? window.hlx.rum : {};
16
16
 
17
17
  const urlSanitizers = {
18
18
  full: () => window.location.href,
@@ -161,7 +161,7 @@ function addEnterLeaveTracking() {
161
161
  // reload: same page, navigate: same origin, enter: everything else
162
162
  if (type === 'reload' || source === window.location.href) {
163
163
  sampleRUM('reload', payload);
164
- } else if (type !== 'navigate') {
164
+ } else if (type && type !== 'navigate') {
165
165
  sampleRUM(type, payload); // back, forward, prerender, etc.
166
166
  } else if (source && window.location.origin === new URL(source).origin) {
167
167
  sampleRUM('navigate', payload); // internal navigation
@@ -169,7 +169,6 @@ function addEnterLeaveTracking() {
169
169
  sampleRUM('enter', payload); // enter site
170
170
  }
171
171
  };
172
- navigate(document.referrer);
173
172
 
174
173
  new PerformanceObserver((list) => list
175
174
  .getEntries().map((entry) => navigate(document.referrer, entry.type)))