@snowplow/react-native-tracker 1.1.0 → 1.2.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 CHANGED
@@ -1,3 +1,9 @@
1
+ Version 1.2.0 (2022-03-25)
2
+ --------------------------
3
+ Add support for React Native for tvOS (#154)
4
+ Bump min RN version supported to v0.65+ (#153)
5
+ Add generic type for SelfDescribing event data (#156)
6
+
1
7
  Version 1.1.0 (2022-02-07)
2
8
  --------------------------
3
9
  Update mobile tracker dependencies to v3 (#141)
package/README.md CHANGED
@@ -70,6 +70,8 @@ npm run bootstrap
70
70
  cd DemoApp
71
71
  ```
72
72
 
73
+ Replace "placeholder" with the URI for your Snowplow Mini or other Snowplow collector in `DemoApp/App.js`.
74
+
73
75
  **For Android:**
74
76
 
75
77
  ```bash
@@ -105,6 +107,34 @@ bash .scripts/cleanBuildAndRun.sh ios
105
107
  bash .scripts/cleanBuildAndRun.sh both
106
108
  ```
107
109
 
110
+ ### Launching the Demo App for Apple TV and Android TV
111
+
112
+ Assuming a [react-native environment][react-native-environment] is set up, from the root of the repository:
113
+
114
+ ```bash
115
+ npm install
116
+ npm run bootstrap
117
+ cd DemoAppTV
118
+ yarn
119
+ ```
120
+
121
+ Replace "placeholder" with the URI for your Snowplow Mini or other Snowplow collector in `DemoAppTV/App.js`.
122
+
123
+ **For Android TV:**
124
+
125
+ ```bash
126
+ yarn android
127
+ ```
128
+
129
+ _Note_: Linux users who want to run the DemoApp for Android, would also need to run `yarn start` in a separate terminal.
130
+
131
+ **For tvOS:**
132
+
133
+ ```bash
134
+ yarn pods && yarn tvos
135
+ ```
136
+
137
+ Note: If you are using simulator with a name different than "Apple TV", you will need to update the `--simulator` parameter in the "tvos" script call in `DemoAppTV/package.json`.
108
138
 
109
139
  ### End-to-end tests
110
140
 
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
12
12
  s.homepage = package['homepage']
13
13
  s.author = { "Snowplow Analytics Ltd" => "info@snowplowanalytics.com" }
14
14
 
15
- s.platforms = { :ios => "9.0" }
15
+ s.platforms = { :ios => "9.0", :tvos => "9.0" }
16
16
 
17
17
  s.source = { :git => "https://github.com/snowplow-incubator/snowplow-react-native-tracker.git", :tag => "#{s.version}" }
18
18
  s.source_files = "ios/**/*.{h,m}"
@@ -2,6 +2,6 @@ package com.snowplowanalytics.react.util;
2
2
 
3
3
  public class TrackerVersion {
4
4
 
5
- public final static String RN_TRACKER_VERSION = "rn-1.1.0";
5
+ public final static String RN_TRACKER_VERSION = "rn-1.2.0";
6
6
 
7
7
  }
package/dist/index.d.ts CHANGED
@@ -29,7 +29,7 @@ declare type ScreenSize = [number, number];
29
29
  /**
30
30
  * SelfDescribing type
31
31
  */
32
- declare type SelfDescribing = {
32
+ declare type SelfDescribing<T extends Record<keyof T, unknown> = Record<string, unknown>> = {
33
33
  /**
34
34
  * Schema
35
35
  */
@@ -37,7 +37,7 @@ declare type SelfDescribing = {
37
37
  /**
38
38
  * Data
39
39
  */
40
- data: Record<string, unknown>;
40
+ data: T;
41
41
  };
42
42
  /**
43
43
  * EventContext type
@@ -546,8 +546,9 @@ declare type ReactNativeTracker = {
546
546
  *
547
547
  * @param argmap - The self-describing event properties
548
548
  * @param contexts - The array of event contexts
549
+ * @typeParam TData - The type of the data object within the SelfDescribing object
549
550
  */
550
- readonly trackSelfDescribingEvent: (argmap: SelfDescribing, contexts?: EventContext[]) => Promise<void>;
551
+ readonly trackSelfDescribingEvent: <TData extends Record<keyof TData, unknown> = Record<string, unknown>>(argmap: SelfDescribing<TData>, contexts?: EventContext[]) => Promise<void>;
551
552
  /**
552
553
  * Tracks a screen-view event
553
554
  *
@@ -22,6 +22,6 @@
22
22
 
23
23
  @implementation RNTrackerVersion
24
24
 
25
- NSString * const kRNTrackerVersion = @"rn-1.1.0";
25
+ NSString * const kRNTrackerVersion = @"rn-1.2.0";
26
26
 
27
27
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowplow/react-native-tracker",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A library for tracking Snowplow events in React Native",
5
5
  "homepage": "https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/react-native-tracker/",
6
6
  "main": "dist/index.js",
@@ -40,24 +40,24 @@
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8.6",
43
- "react-native": ">=0.59.8"
43
+ "react-native": ">=0.65.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@types/jest": "^27.4.0",
47
- "@types/react": "^17.0.39",
48
- "@types/react-native": "^0.66.15",
49
- "@typescript-eslint/eslint-plugin": "^5.10.2",
50
- "@typescript-eslint/parser": "^5.10.2",
51
- "eslint": "^8.8.0",
52
- "eslint-plugin-jest": "^26.1.0",
46
+ "@types/jest": "^27.4.1",
47
+ "@types/react": "^16.8.25",
48
+ "@types/react-native": "^0.65.21",
49
+ "@typescript-eslint/eslint-plugin": "^5.13.0",
50
+ "@typescript-eslint/parser": "^5.13.0",
51
+ "eslint": "^8.10.0",
52
+ "eslint-plugin-jest": "^26.1.1",
53
53
  "eslint-plugin-promise": "^6.0.0",
54
- "jest": "^27.5.0",
54
+ "jest": "^27.5.1",
55
55
  "rimraf": "^3.0.2",
56
- "rollup": "^2.67.1",
57
- "rollup-plugin-dts": "^4.1.0",
56
+ "rollup": "^2.69.0",
57
+ "rollup-plugin-dts": "^4.2.0",
58
58
  "rollup-plugin-sourcemaps": "^0.6.3",
59
59
  "ts-jest": "^27.1.3",
60
- "typescript": "^4.5.5"
60
+ "typescript": "^4.6.2"
61
61
  },
62
62
  "jest": {
63
63
  "testEnvironment": "node",