@logrocket/react-native 1.56.0 → 1.56.2
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/README.md +10 -8
- package/android/build.gradle +4 -1
- package/dist/build.js +1 -1
- package/logrocket-react-native.podspec +1 -1
- package/package.json +1 -1
- package/plugin/withLogRocket.js +6 -16
- package/types.d.ts +75 -66
package/package.json
CHANGED
package/plugin/withLogRocket.js
CHANGED
|
@@ -18,7 +18,7 @@ const path = require('path');
|
|
|
18
18
|
|
|
19
19
|
const LOGROCKET_MAVEN_URL = 'maven { url "https://storage.googleapis.com/logrocket-maven/" }';
|
|
20
20
|
const LOGROCKET_DEPENDENCY_CLASSPATH = 'classpath "com.logrocket.gradle:android:0.4.+"';
|
|
21
|
-
const LOGROCKET_PLUGIN =
|
|
21
|
+
const LOGROCKET_PLUGIN = "apply plugin: 'com.logrocket.gradle.android'";
|
|
22
22
|
|
|
23
23
|
const buildscriptRepositoriesRegex = new RegExp(/buildscript\s*{.*?repositories\s*{.*?(?=\n\s*})/, 'sg');
|
|
24
24
|
const buildscriptDependenciesRegex = new RegExp(/buildscript\s*{.*?dependencies\s*{.*?(?=\n\s*})/, 'sg');
|
|
@@ -105,28 +105,20 @@ function modApplicationGradle(buildGradle, pluginProps) {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
const withAndroidLogRocket = (config, pluginProps) => {
|
|
108
|
-
|
|
109
108
|
config = withProjectBuildGradle(config, gradleConfig => {
|
|
110
109
|
if (gradleConfig.modResults.language === 'groovy') {
|
|
111
|
-
|
|
112
110
|
gradleConfig.modResults.contents = modProjectGradle(gradleConfig.modResults.contents);
|
|
113
111
|
} else {
|
|
114
|
-
throw new Error(
|
|
115
|
-
'Cannot add LogRocket gradle config because the project build.gradle is not groovy'
|
|
116
|
-
);
|
|
112
|
+
throw new Error('Cannot add LogRocket gradle config because the project build.gradle is not groovy');
|
|
117
113
|
}
|
|
118
114
|
return gradleConfig;
|
|
119
115
|
});
|
|
120
116
|
|
|
121
|
-
|
|
122
117
|
config = withAppBuildGradle(config, gradleConfig => {
|
|
123
118
|
if (gradleConfig.modResults.language === 'groovy') {
|
|
124
|
-
|
|
125
119
|
gradleConfig.modResults.contents = modApplicationGradle(gradleConfig.modResults.contents, pluginProps);
|
|
126
120
|
} else {
|
|
127
|
-
throw new Error(
|
|
128
|
-
'Cannot add LogRocket gradle config because the application build.gradle is not groovy'
|
|
129
|
-
);
|
|
121
|
+
throw new Error('Cannot add LogRocket gradle config because the application build.gradle is not groovy');
|
|
130
122
|
}
|
|
131
123
|
return gradleConfig;
|
|
132
124
|
});
|
|
@@ -135,11 +127,12 @@ const withAndroidLogRocket = (config, pluginProps) => {
|
|
|
135
127
|
};
|
|
136
128
|
|
|
137
129
|
const withIosLogRocket = (config, pluginProps) => {
|
|
138
|
-
|
|
139
130
|
config = withXcodeProject(config, xcodeProjConfig => {
|
|
140
131
|
const xcodeProject = xcodeProjConfig.modResults;
|
|
141
132
|
const LOGROCKET_UPLOAD_SCRIPT = fs.readFileSync(
|
|
142
|
-
path.resolve(__dirname, '../scripts/asset-upload-script.rb'),
|
|
133
|
+
path.resolve(__dirname, '../scripts/asset-upload-script.rb'),
|
|
134
|
+
'utf-8'
|
|
135
|
+
);
|
|
143
136
|
|
|
144
137
|
// add run script build phase to run ruby script
|
|
145
138
|
const logRocketBuildPhase = xcodeProject.pbxItemByComment(
|
|
@@ -211,7 +204,6 @@ const withIosLogRocket = (config, pluginProps) => {
|
|
|
211
204
|
*/
|
|
212
205
|
|
|
213
206
|
const withLogRocket = (config, pluginProps = {}) => {
|
|
214
|
-
|
|
215
207
|
config = withBuildProperties(config, {
|
|
216
208
|
android: {
|
|
217
209
|
extraMavenRepos: ['https://storage.googleapis.com/logrocket-maven/'],
|
|
@@ -219,12 +211,10 @@ const withLogRocket = (config, pluginProps = {}) => {
|
|
|
219
211
|
});
|
|
220
212
|
|
|
221
213
|
if (pluginProps.android && pluginProps.android.assetCapture) {
|
|
222
|
-
|
|
223
214
|
config = withAndroidLogRocket(config, pluginProps);
|
|
224
215
|
}
|
|
225
216
|
|
|
226
217
|
if (pluginProps.ios && pluginProps.ios.assetCapture) {
|
|
227
|
-
|
|
228
218
|
config = withIosLogRocket(config, pluginProps);
|
|
229
219
|
}
|
|
230
220
|
|
package/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
|
|
3
3
|
type Nullable<T> = {
|
|
4
4
|
[Property in keyof T]: T[Property] | null;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
|
|
7
7
|
declare let LogRocket: ILogRocket;
|
|
8
8
|
|
|
@@ -25,58 +25,60 @@ interface IResponse {
|
|
|
25
25
|
headers: { [key: string]: string | null | undefined };
|
|
26
26
|
body?: string;
|
|
27
27
|
method: string;
|
|
28
|
-
url?: string
|
|
28
|
+
url?: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
interface IOptions {
|
|
32
|
-
serverURL?: string
|
|
33
|
-
enableIPCapture?: boolean
|
|
34
|
-
uploadIntervalMs?: number
|
|
35
|
-
viewScanIntervalSeconds?: number
|
|
36
|
-
logLevel?: string
|
|
32
|
+
serverURL?: string;
|
|
33
|
+
enableIPCapture?: boolean;
|
|
34
|
+
uploadIntervalMs?: number;
|
|
35
|
+
viewScanIntervalSeconds?: number;
|
|
36
|
+
logLevel?: string;
|
|
37
37
|
network?: {
|
|
38
|
-
isEnabled?: boolean
|
|
39
|
-
requestSanitizer?(request: IRequest): null | Nullable<IRequest
|
|
40
|
-
responseSanitizer?(response: IResponse): null | Nullable<IResponse
|
|
41
|
-
}
|
|
38
|
+
isEnabled?: boolean;
|
|
39
|
+
requestSanitizer?(request: IRequest): null | Nullable<IRequest>;
|
|
40
|
+
responseSanitizer?(response: IResponse): null | Nullable<IResponse>;
|
|
41
|
+
};
|
|
42
42
|
console?: {
|
|
43
|
-
isEnabled?:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
isEnabled?:
|
|
44
|
+
| boolean
|
|
45
|
+
| {
|
|
46
|
+
log?: boolean;
|
|
47
|
+
info?: boolean;
|
|
48
|
+
debug?: boolean;
|
|
49
|
+
warn?: boolean;
|
|
50
|
+
error?: boolean;
|
|
51
|
+
};
|
|
52
|
+
shouldAggregateConsoleErrors?: boolean;
|
|
53
|
+
};
|
|
54
|
+
allowTags?: string[];
|
|
55
|
+
redactionTags?: string[];
|
|
56
|
+
textSanitizer?: 'excluded' | 'none';
|
|
57
|
+
enablePersistence?: boolean;
|
|
58
|
+
connectionType?: 'MOBILE' | 'WIFI';
|
|
59
|
+
iosProxyConfiguration?: IosProxyConfiguration;
|
|
60
|
+
androidProxy?: AndroidProxyConfiguration;
|
|
59
61
|
/** Controls automatic detection of JS errors using Raven.js
|
|
60
62
|
* Does not impact captureException or aggregation of console errors
|
|
61
63
|
*/
|
|
62
|
-
shouldDetectExceptions?: boolean
|
|
63
|
-
forceCleanStart?: boolean
|
|
64
|
-
iosThroughputTrackingEnabled?: boolean
|
|
65
|
-
captureRedactedViewTouches?: boolean
|
|
66
|
-
disableScrollDelegate?: boolean
|
|
67
|
-
iosExtendedViewTextCapture?: boolean
|
|
64
|
+
shouldDetectExceptions?: boolean;
|
|
65
|
+
forceCleanStart?: boolean;
|
|
66
|
+
iosThroughputTrackingEnabled?: boolean;
|
|
67
|
+
captureRedactedViewTouches?: boolean;
|
|
68
|
+
disableScrollDelegate?: boolean;
|
|
69
|
+
iosExtendedViewTextCapture?: boolean;
|
|
68
70
|
/** The specified updateId is manually appended to the release version.
|
|
69
71
|
* This is intended to be used for tracking Expo Update IDs.
|
|
70
72
|
*/
|
|
71
|
-
updateId?: string | null
|
|
73
|
+
updateId?: string | null;
|
|
72
74
|
/** The specified expoChannel is manually appended to the release version.
|
|
73
75
|
* This is intended to be used for tracking Expo channels.
|
|
74
76
|
*/
|
|
75
|
-
expoChannel?: string | null
|
|
76
|
-
viewScanningEnabled?: boolean
|
|
77
|
+
expoChannel?: string | null;
|
|
78
|
+
viewScanningEnabled?: boolean;
|
|
77
79
|
/** Controls whether touch events are captured on iOS */
|
|
78
|
-
registerTouchHandlers?: boolean
|
|
79
|
-
shouldParseXHRBlob?: boolean
|
|
80
|
+
registerTouchHandlers?: boolean;
|
|
81
|
+
shouldParseXHRBlob?: boolean;
|
|
80
82
|
/**
|
|
81
83
|
* Control whether automatically registered navigation events
|
|
82
84
|
* for Android activity/iOS view lifecycle changes are disabled.
|
|
@@ -84,7 +86,7 @@ interface IOptions {
|
|
|
84
86
|
*
|
|
85
87
|
* Defaults to `true`.
|
|
86
88
|
*/
|
|
87
|
-
enableAutomaticLifecycleCapture?: boolean
|
|
89
|
+
enableAutomaticLifecycleCapture?: boolean;
|
|
88
90
|
/**
|
|
89
91
|
* @deprecated WARNING:
|
|
90
92
|
* Changing this setting may result in highly limited capture or causing the app to hang for extreme lengths of time
|
|
@@ -93,8 +95,8 @@ interface IOptions {
|
|
|
93
95
|
* prevent the app from hanging.
|
|
94
96
|
* Defualts to 100 milliseconds.
|
|
95
97
|
*/
|
|
96
|
-
viewCaptureTimeoutThreshold?: number
|
|
97
|
-
|
|
98
|
+
viewCaptureTimeoutThreshold?: number;
|
|
99
|
+
/**
|
|
98
100
|
* @deprecated WARNING:
|
|
99
101
|
* Increasing this value may result in the app hangs during view capture
|
|
100
102
|
* Specifies, in milliseconds, how much additional time past viewCaptureTimeoutThreshold the LogRocket SDK should
|
|
@@ -102,46 +104,46 @@ interface IOptions {
|
|
|
102
104
|
* You may safely disable wireframe capture by setting this config value to 0.
|
|
103
105
|
* Defualts to 20 milliseconds.
|
|
104
106
|
*/
|
|
105
|
-
viewCaptureAdditionalWireframeDuration?: number
|
|
107
|
+
viewCaptureAdditionalWireframeDuration?: number;
|
|
106
108
|
/**
|
|
107
109
|
* Controls whether the LogRocket SDK will automatically capture native iOS logs.
|
|
108
110
|
* Native logs are not captured on Android. This does not affect the capture of console logs.
|
|
109
111
|
* This is enabled by default.
|
|
110
112
|
*/
|
|
111
|
-
nativeLogCaptureEnabled?: boolean
|
|
113
|
+
nativeLogCaptureEnabled?: boolean;
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
type IosProxyConfiguration = {
|
|
115
|
-
proxyUsername?: string
|
|
116
|
-
proxyPassword?: string
|
|
117
|
-
httpEnable?: boolean | number
|
|
118
|
-
httpPort?: number
|
|
119
|
-
httpProxy?: string
|
|
120
|
-
}
|
|
117
|
+
proxyUsername?: string;
|
|
118
|
+
proxyPassword?: string;
|
|
119
|
+
httpEnable?: boolean | number;
|
|
120
|
+
httpPort?: number;
|
|
121
|
+
httpProxy?: string;
|
|
122
|
+
};
|
|
121
123
|
|
|
122
124
|
type AndroidProxyConfiguration = {
|
|
123
|
-
port?: number
|
|
124
|
-
host?: string
|
|
125
|
-
authHeaderName?: string
|
|
126
|
-
authHeaderValue?: string
|
|
127
|
-
}
|
|
125
|
+
port?: number;
|
|
126
|
+
host?: string;
|
|
127
|
+
authHeaderName?: string;
|
|
128
|
+
authHeaderValue?: string;
|
|
129
|
+
};
|
|
128
130
|
|
|
129
131
|
interface IUserTraits {
|
|
130
|
-
[propName: string]: string | number | boolean
|
|
132
|
+
[propName: string]: string | number | boolean;
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
type TrackEventProperties = {
|
|
134
|
-
revenue?: number
|
|
135
|
-
[key: string]: string | number | boolean | string[] | number[] | boolean[] | undefined | null
|
|
136
|
+
revenue?: number;
|
|
137
|
+
[key: string]: string | number | boolean | string[] | number[] | boolean[] | undefined | null;
|
|
136
138
|
};
|
|
137
139
|
|
|
138
140
|
interface IExceptionOptions {
|
|
139
141
|
tags?: {
|
|
140
142
|
[key: string]: string | number | boolean;
|
|
141
|
-
}
|
|
143
|
+
};
|
|
142
144
|
extra?: {
|
|
143
145
|
[key: string]: string | number | boolean;
|
|
144
|
-
}
|
|
146
|
+
};
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
type State = { [key: string]: any };
|
|
@@ -149,9 +151,9 @@ type Action = { [key: string]: any };
|
|
|
149
151
|
|
|
150
152
|
interface IReduxMiddlewareOptions {
|
|
151
153
|
/** Sanitizer function to scrub redux state */
|
|
152
|
-
stateSanitizer?(state: State): State
|
|
154
|
+
stateSanitizer?(state: State): State;
|
|
153
155
|
/** Sanitizer function to scrub or ignore specific redux actions */
|
|
154
|
-
actionSanitizer?(action: Action): null | Action
|
|
156
|
+
actionSanitizer?(action: Action): null | Action;
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
interface ILogRocket {
|
|
@@ -185,18 +187,25 @@ interface ILogRocket {
|
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
export function LRAllowProps(allowTag: string = 'lr-show', useNativeID: bool = false);
|
|
188
|
-
export const LRAllow: ({
|
|
190
|
+
export const LRAllow: ({
|
|
191
|
+
children,
|
|
192
|
+
}: {
|
|
189
193
|
children: React.ReactNode;
|
|
190
194
|
}) => React.FunctionComponentElement<RedactionAttributes>;
|
|
191
|
-
export const LRNativeIDAllow: ({
|
|
195
|
+
export const LRNativeIDAllow: ({
|
|
196
|
+
children,
|
|
197
|
+
}: {
|
|
192
198
|
children: React.ReactNode;
|
|
193
199
|
}) => React.FunctionComponentElement<RedactionAttributes>;
|
|
194
200
|
|
|
195
|
-
|
|
196
201
|
export function LRRedactProps(redactionTag: string = 'lr-hide', useNativeID: bool = false);
|
|
197
|
-
export const LRRedact: ({
|
|
202
|
+
export const LRRedact: ({
|
|
203
|
+
children,
|
|
204
|
+
}: {
|
|
198
205
|
children: React.ReactNode;
|
|
199
206
|
}) => React.FunctionComponentElement<RedactionAttributes>;
|
|
200
|
-
export const LRNativeIDRedact: ({
|
|
207
|
+
export const LRNativeIDRedact: ({
|
|
208
|
+
children,
|
|
209
|
+
}: {
|
|
201
210
|
children: React.ReactNode;
|
|
202
211
|
}) => React.FunctionComponentElement<RedactionAttributes>;
|