@codecademy/tracking 0.16.0 → 0.17.1-alpha.e28253.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/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [0.17.1-alpha.e28253.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.17.0...@codecademy/tracking@0.17.1-alpha.e28253.0) (2021-12-13)
7
+
8
+ **Note:** Version bump only for package @codecademy/tracking
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.17.0](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.16.1...@codecademy/tracking@0.17.0) (2021-11-30)
15
+
16
+
17
+ ### ⚠ BREAKING CHANGES
18
+
19
+ * **eslint-config:** bump ESLint to 8 and typescript-eslint to 5 (#4)
20
+
21
+ ### Features
22
+
23
+ * **eslint-config:** bump ESLint to 8 and typescript-eslint to 5 ([#4](https://github.com/Codecademy/client-modules/issues/4)) ([64423d6](https://github.com/Codecademy/client-modules/commit/64423d69ad0f90f2e717373db6b1988b715681cc))
24
+
25
+
26
+
27
+ ### [0.16.1](https://github.com/Codecademy/client-modules/compare/@codecademy/tracking@0.16.0...@codecademy/tracking@0.16.1) (2021-11-12)
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * **tracking:** super-bind the sendBeacon to navigator ([b32a8ec](https://github.com/Codecademy/client-modules/commit/b32a8ece14b2c2d62abf98f762f1be17690406f8))
33
+
34
+
35
+
6
36
  ## 0.16.0 (2021-11-10)
7
37
 
8
38
 
@@ -40,11 +40,14 @@ export var createTracker = function createTracker(_ref) {
40
40
  var v = _ref3[1];
41
41
  form.append(k, v.toString());
42
42
  } // Firefox allows users to disable navigator.sendBeacon, and very old Safari versions don't have it.
43
- // [WEB-1700]: Additionally, Chrome 79-80 gives "Illegal invocation" with ?., so through 2022 we should support them.
44
- // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
45
43
 
46
44
 
47
- if (navigator.sendBeacon && navigator.sendBeacon(uri, form)) {
45
+ var sendBeacon = // [WEB-1700]: Additionally, Chrome 79-80 gives "Illegal invocation" with ?., so through 2022 we should support them.
46
+ // It seems similar to this: https://github.com/vercel/next.js/issues/23856
47
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
48
+ navigator.sendBeacon && navigator.sendBeacon.bind(navigator);
49
+
50
+ if (sendBeacon !== null && sendBeacon !== void 0 && sendBeacon(uri, form)) {
48
51
  return;
49
52
  } // Either way, we fall back to standard fetch if sendBeacon fails.
50
53
  // We don't mind this rejecting with an error because it's tracking, and we'll know if that starts to fail.
@@ -4,10 +4,10 @@ export interface UserIntegrationSummary {
4
4
  id: string;
5
5
  }
6
6
  export interface SegmentAnalytics {
7
- identify(id: string, details: Record<string, string>, options: SegmentAnalyticsOptions): void;
7
+ identify: (id: string, details: Record<string, string>, options: SegmentAnalyticsOptions) => void;
8
8
  initialize?: boolean;
9
- load(writeKey: string, options: SegmentAnalyticsOptions): void;
10
- page(): void;
9
+ load: (writeKey: string, options: SegmentAnalyticsOptions) => void;
10
+ page: () => void;
11
11
  }
12
12
  export interface SegmentDestination {
13
13
  category: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codecademy/tracking",
3
3
  "description": "Tracking library for Codecademy apps.",
4
- "version": "0.16.0",
4
+ "version": "0.17.1-alpha.e28253.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "module": "./dist/index.js",
7
7
  "main": "./dist/index.js",
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "39b1e31d1addd545ff8b493d1c97bea33f303ea9"
39
+ "gitHead": "1643cfff92132c0ef6f3861e10f0c36fd673fcf3"
40
40
  }