@sentry/react-native 6.0.0 → 6.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.
Files changed (78) hide show
  1. package/README.md +5 -9
  2. package/RNSentry.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java +7 -3
  5. package/android/src/main/java/io/sentry/react/RNSentryMapConverter.java +5 -1
  6. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +151 -145
  7. package/android/src/main/java/io/sentry/react/RNSentryReactFragmentLifecycleTracer.java +1 -1
  8. package/android/src/main/java/io/sentry/react/RNSentryReplayBreadcrumbConverter.java +10 -14
  9. package/android/src/main/java/io/sentry/react/RNSentryTimeToDisplay.java +42 -0
  10. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +5 -0
  11. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +5 -0
  12. package/dist/js/NativeRNSentry.d.ts +1 -0
  13. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  14. package/dist/js/NativeRNSentry.js.map +1 -1
  15. package/dist/js/client.d.ts.map +1 -1
  16. package/dist/js/client.js +5 -2
  17. package/dist/js/client.js.map +1 -1
  18. package/dist/js/index.d.ts +2 -2
  19. package/dist/js/index.d.ts.map +1 -1
  20. package/dist/js/index.js +1 -1
  21. package/dist/js/index.js.map +1 -1
  22. package/dist/js/integrations/spotlight.d.ts +4 -0
  23. package/dist/js/integrations/spotlight.d.ts.map +1 -1
  24. package/dist/js/integrations/spotlight.js +4 -1
  25. package/dist/js/integrations/spotlight.js.map +1 -1
  26. package/dist/js/tracing/reactnavigation.js +7 -7
  27. package/dist/js/tracing/reactnavigation.js.map +1 -1
  28. package/dist/js/utils/ignorerequirecyclelogs.d.ts +6 -1
  29. package/dist/js/utils/ignorerequirecyclelogs.d.ts.map +1 -1
  30. package/dist/js/utils/ignorerequirecyclelogs.js +6 -2
  31. package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -1
  32. package/dist/js/utils/sentryeventemitterfallback.d.ts +19 -0
  33. package/dist/js/utils/sentryeventemitterfallback.d.ts.map +1 -0
  34. package/dist/js/utils/sentryeventemitterfallback.js +78 -0
  35. package/dist/js/utils/sentryeventemitterfallback.js.map +1 -0
  36. package/dist/js/vendor/react-native/index.d.ts +1 -1
  37. package/dist/js/vendor/react-native/index.js.map +1 -1
  38. package/dist/js/version.d.ts +1 -1
  39. package/dist/js/version.js +1 -1
  40. package/dist/js/version.js.map +1 -1
  41. package/dist/js/wrapper.d.ts +3 -0
  42. package/dist/js/wrapper.d.ts.map +1 -1
  43. package/dist/js/wrapper.js +6 -0
  44. package/dist/js/wrapper.js.map +1 -1
  45. package/ios/RNSentry.h +8 -12
  46. package/ios/RNSentry.mm +382 -303
  47. package/ios/RNSentryBreadcrumb.h +2 -2
  48. package/ios/RNSentryBreadcrumb.m +7 -6
  49. package/ios/RNSentryDependencyContainer.h +2 -2
  50. package/ios/RNSentryDependencyContainer.m +7 -6
  51. package/ios/RNSentryFramesTrackerListener.h +6 -6
  52. package/ios/RNSentryFramesTrackerListener.m +10 -8
  53. package/ios/RNSentryId.m +2 -1
  54. package/ios/RNSentryOnDrawReporter.h +5 -5
  55. package/ios/RNSentryOnDrawReporter.m +26 -24
  56. package/ios/RNSentryRNSScreen.h +1 -1
  57. package/ios/RNSentryRNSScreen.m +18 -18
  58. package/ios/RNSentryReplay.m +42 -53
  59. package/ios/RNSentryReplayBreadcrumbConverter.h +3 -4
  60. package/ios/RNSentryReplayBreadcrumbConverter.m +139 -132
  61. package/ios/RNSentryTimeToDisplay.h +7 -0
  62. package/ios/RNSentryTimeToDisplay.m +44 -0
  63. package/package.json +16 -15
  64. package/plugin/build/utils.js +6 -6
  65. package/plugin/build/withSentry.js +2 -2
  66. package/plugin/build/withSentryAndroid.js +2 -2
  67. package/plugin/build/withSentryIOS.js +3 -3
  68. package/scripts/sentry-xcode-debug-files.sh +2 -0
  69. package/sentry.gradle +10 -2
  70. package/src/js/NativeRNSentry.ts +1 -0
  71. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -0
  72. package/ts3.8/dist/js/index.d.ts +2 -2
  73. package/ts3.8/dist/js/integrations/spotlight.d.ts +4 -0
  74. package/ts3.8/dist/js/utils/ignorerequirecyclelogs.d.ts +6 -1
  75. package/ts3.8/dist/js/utils/sentryeventemitterfallback.d.ts +19 -0
  76. package/ts3.8/dist/js/vendor/react-native/index.d.ts +1 -1
  77. package/ts3.8/dist/js/version.d.ts +1 -1
  78. package/ts3.8/dist/js/wrapper.d.ts +3 -0
@@ -5,162 +5,169 @@
5
5
  #if SENTRY_TARGET_REPLAY_SUPPORTED
6
6
 
7
7
  @implementation RNSentryReplayBreadcrumbConverter {
8
- SentrySRDefaultBreadcrumbConverter *defaultConverter;
8
+ SentrySRDefaultBreadcrumbConverter *defaultConverter;
9
9
  }
10
10
 
11
- - (instancetype _Nonnull)init {
12
- if (self = [super init]) {
13
- self->defaultConverter =
14
- [SentrySessionReplayIntegration createDefaultBreadcrumbConverter];
15
- }
16
- return self;
11
+ - (instancetype _Nonnull)init
12
+ {
13
+ if (self = [super init]) {
14
+ self->defaultConverter = [SentrySessionReplayIntegration createDefaultBreadcrumbConverter];
15
+ }
16
+ return self;
17
17
  }
18
18
 
19
- - (id<SentryRRWebEvent> _Nullable)convertFrom:
20
- (SentryBreadcrumb *_Nonnull)breadcrumb {
21
- assert(breadcrumb.timestamp != nil);
19
+ - (id<SentryRRWebEvent> _Nullable)convertFrom:(SentryBreadcrumb *_Nonnull)breadcrumb
20
+ {
21
+ assert(breadcrumb.timestamp != nil);
22
22
 
23
- if ([breadcrumb.category isEqualToString:@"sentry.event"] ||
24
- [breadcrumb.category isEqualToString:@"sentry.transaction"]) {
25
- // Do not add Sentry Event breadcrumbs to replay
26
- return nil;
27
- }
23
+ if ([breadcrumb.category isEqualToString:@"sentry.event"] ||
24
+ [breadcrumb.category isEqualToString:@"sentry.transaction"]) {
25
+ // Do not add Sentry Event breadcrumbs to replay
26
+ return nil;
27
+ }
28
28
 
29
- if ([breadcrumb.category isEqualToString:@"http"]) {
30
- // Drop native network breadcrumbs to avoid duplicates
31
- return nil;
32
- }
29
+ if ([breadcrumb.category isEqualToString:@"http"]) {
30
+ // Drop native network breadcrumbs to avoid duplicates
31
+ return nil;
32
+ }
33
33
 
34
- if ([breadcrumb.category isEqualToString:@"touch"]) {
35
- return [self convertTouch:breadcrumb];
36
- }
34
+ if ([breadcrumb.category isEqualToString:@"touch"]) {
35
+ return [self convertTouch:breadcrumb];
36
+ }
37
37
 
38
- if ([breadcrumb.category isEqualToString:@"navigation"]) {
39
- return [SentrySessionReplayIntegration
40
- createBreadcrumbwithTimestamp:breadcrumb.timestamp
41
- category:breadcrumb.category
42
- message:nil
43
- level:breadcrumb.level
44
- data:breadcrumb.data];
45
- }
46
-
47
- if ([breadcrumb.category isEqualToString:@"xhr"]) {
48
- return [self convertNavigation:breadcrumb];
49
- }
50
-
51
- SentryRRWebEvent *nativeBreadcrumb =
52
- [self->defaultConverter convertFrom:breadcrumb];
53
-
54
- // ignore native navigation breadcrumbs
55
- if (nativeBreadcrumb && nativeBreadcrumb.data &&
56
- nativeBreadcrumb.data[@"payload"] &&
57
- nativeBreadcrumb.data[@"payload"][@"category"] &&
58
- [nativeBreadcrumb.data[@"payload"][@"category"]
59
- isEqualToString:@"navigation"]) {
60
- return nil;
61
- }
62
-
63
- return nativeBreadcrumb;
64
- }
38
+ if ([breadcrumb.category isEqualToString:@"navigation"]) {
39
+ return [SentrySessionReplayIntegration createBreadcrumbwithTimestamp:breadcrumb.timestamp
40
+ category:breadcrumb.category
41
+ message:nil
42
+ level:breadcrumb.level
43
+ data:breadcrumb.data];
44
+ }
65
45
 
66
- - (id<SentryRRWebEvent> _Nullable) convertTouch:(SentryBreadcrumb *_Nonnull)breadcrumb {
67
- if (breadcrumb.data == nil) {
68
- return nil;
69
- }
46
+ if ([breadcrumb.category isEqualToString:@"xhr"]) {
47
+ return [self convertNavigation:breadcrumb];
48
+ }
70
49
 
71
- NSMutableArray *path = [breadcrumb.data valueForKey:@"path"];
72
- NSString* message = [RNSentryReplayBreadcrumbConverter getTouchPathMessageFrom:path];
50
+ SentryRRWebEvent *nativeBreadcrumb = [self->defaultConverter convertFrom:breadcrumb];
73
51
 
74
- return [SentrySessionReplayIntegration
75
- createBreadcrumbwithTimestamp:breadcrumb.timestamp
76
- category:@"ui.tap"
77
- message:message
78
- level:breadcrumb.level
79
- data:breadcrumb.data];
52
+ // ignore native navigation breadcrumbs
53
+ if (nativeBreadcrumb && nativeBreadcrumb.data && nativeBreadcrumb.data[@"payload"]
54
+ && nativeBreadcrumb.data[@"payload"][@"category"] &&
55
+ [nativeBreadcrumb.data[@"payload"][@"category"] isEqualToString:@"navigation"]) {
56
+ return nil;
57
+ }
58
+
59
+ return nativeBreadcrumb;
80
60
  }
81
61
 
82
- + (NSString* _Nullable) getTouchPathMessageFrom:(NSArray* _Nullable) path {
83
- if (path == nil) {
84
- return nil;
85
- }
62
+ - (id<SentryRRWebEvent> _Nullable)convertTouch:(SentryBreadcrumb *_Nonnull)breadcrumb
63
+ {
64
+ if (breadcrumb.data == nil) {
65
+ return nil;
66
+ }
67
+
68
+ NSMutableArray *path = [breadcrumb.data valueForKey:@"path"];
69
+ NSString *message = [RNSentryReplayBreadcrumbConverter getTouchPathMessageFrom:path];
86
70
 
87
- NSInteger pathCount = [path count];
88
- if (pathCount <= 0) {
89
- return nil;
90
- }
71
+ return [SentrySessionReplayIntegration createBreadcrumbwithTimestamp:breadcrumb.timestamp
72
+ category:@"ui.tap"
73
+ message:message
74
+ level:breadcrumb.level
75
+ data:breadcrumb.data];
76
+ }
91
77
 
92
- NSMutableString *message = [[NSMutableString alloc] init];
93
- for (NSInteger i = MIN(3, pathCount - 1); i >= 0; i--) {
94
- NSDictionary *item = [path objectAtIndex:i];
95
- if (item == nil) {
96
- return nil; // There should be no nil (undefined) from JS, but to be safe we check it here
78
+ + (NSString *_Nullable)getTouchPathMessageFrom:(NSArray *_Nullable)path
79
+ {
80
+ if (path == nil) {
81
+ return nil;
97
82
  }
98
83
 
99
- id name = [item objectForKey:@"name"];
100
- id label = [item objectForKey:@"label"];
101
- BOOL hasName = [name isKindOfClass:[NSString class]];
102
- BOOL hasLabel = [label isKindOfClass:[NSString class]];
103
- if (!hasName && !hasLabel) {
104
- return nil; // This again should never be allowed in JS, but to be safe we check it here
105
- }
106
- if (hasLabel) {
107
- [message appendString:(NSString *)label];
108
- } else if (hasName) {
109
- [message appendString:(NSString *)name];
84
+ NSInteger pathCount = [path count];
85
+ if (pathCount <= 0) {
86
+ return nil;
110
87
  }
111
88
 
112
- id element = [item objectForKey:@"element"];
113
- id file = [item objectForKey:@"file"];
114
- BOOL hasElement = [element isKindOfClass:[NSString class]];
115
- BOOL hasFile = [file isKindOfClass:[NSString class]];
116
- if (hasElement && hasFile) {
117
- [message appendFormat:@"(%@, %@)", (NSString *)element, (NSString *)file];
118
- } else if (hasElement) {
119
- [message appendFormat:@"(%@)", (NSString *)element];
120
- } else if (hasFile) {
121
- [message appendFormat:@"(%@)", (NSString *)file];
89
+ NSMutableString *message = [[NSMutableString alloc] init];
90
+ for (NSInteger i = MIN(3, pathCount - 1); i >= 0; i--) {
91
+ NSDictionary *item = [path objectAtIndex:i];
92
+ if (item == nil) {
93
+ return nil; // There should be no nil (undefined) from JS, but to be safe we check it
94
+ // here
95
+ }
96
+
97
+ id name = [item objectForKey:@"name"];
98
+ id label = [item objectForKey:@"label"];
99
+ BOOL hasName = [name isKindOfClass:[NSString class]];
100
+ BOOL hasLabel = [label isKindOfClass:[NSString class]];
101
+ if (!hasName && !hasLabel) {
102
+ return nil; // This again should never be allowed in JS, but to be safe we check it here
103
+ }
104
+ if (hasLabel) {
105
+ [message appendString:(NSString *)label];
106
+ } else if (hasName) {
107
+ [message appendString:(NSString *)name];
108
+ }
109
+
110
+ id element = [item objectForKey:@"element"];
111
+ id file = [item objectForKey:@"file"];
112
+ BOOL hasElement = [element isKindOfClass:[NSString class]];
113
+ BOOL hasFile = [file isKindOfClass:[NSString class]];
114
+ if (hasElement && hasFile) {
115
+ [message appendFormat:@"(%@, %@)", (NSString *)element, (NSString *)file];
116
+ } else if (hasElement) {
117
+ [message appendFormat:@"(%@)", (NSString *)element];
118
+ } else if (hasFile) {
119
+ [message appendFormat:@"(%@)", (NSString *)file];
120
+ }
121
+
122
+ if (i > 0) {
123
+ [message appendString:@" > "];
124
+ }
122
125
  }
123
126
 
124
- if (i > 0) {
125
- [message appendString:@" > "];
127
+ return message;
128
+ }
129
+
130
+ - (id<SentryRRWebEvent> _Nullable)convertNavigation:(SentryBreadcrumb *_Nonnull)breadcrumb
131
+ {
132
+ NSNumber *startTimestamp = [breadcrumb.data[@"start_timestamp"] isKindOfClass:[NSNumber class]]
133
+ ? breadcrumb.data[@"start_timestamp"]
134
+ : nil;
135
+ NSNumber *endTimestamp = [breadcrumb.data[@"end_timestamp"] isKindOfClass:[NSNumber class]]
136
+ ? breadcrumb.data[@"end_timestamp"]
137
+ : nil;
138
+ NSString *url =
139
+ [breadcrumb.data[@"url"] isKindOfClass:[NSString class]] ? breadcrumb.data[@"url"] : nil;
140
+
141
+ if (startTimestamp == nil || endTimestamp == nil || url == nil) {
142
+ return nil;
126
143
  }
127
- }
128
144
 
129
- return message;
130
- }
145
+ NSMutableDictionary *data = [[NSMutableDictionary alloc] init];
146
+ if ([breadcrumb.data[@"method"] isKindOfClass:[NSString class]]) {
147
+ data[@"method"] = breadcrumb.data[@"method"];
148
+ }
149
+ if ([breadcrumb.data[@"status_code"] isKindOfClass:[NSNumber class]]) {
150
+ data[@"statusCode"] = breadcrumb.data[@"status_code"];
151
+ }
152
+ if ([breadcrumb.data[@"request_body_size"] isKindOfClass:[NSNumber class]]) {
153
+ data[@"requestBodySize"] = breadcrumb.data[@"request_body_size"];
154
+ }
155
+ if ([breadcrumb.data[@"response_body_size"] isKindOfClass:[NSNumber class]]) {
156
+ data[@"responseBodySize"] = breadcrumb.data[@"response_body_size"];
157
+ }
131
158
 
132
- - (id<SentryRRWebEvent> _Nullable)convertNavigation: (SentryBreadcrumb *_Nonnull)breadcrumb {
133
- NSNumber* startTimestamp = [breadcrumb.data[@"start_timestamp"] isKindOfClass:[NSNumber class]]
134
- ? breadcrumb.data[@"start_timestamp"] : nil;
135
- NSNumber* endTimestamp = [breadcrumb.data[@"end_timestamp"] isKindOfClass:[NSNumber class]]
136
- ? breadcrumb.data[@"end_timestamp"] : nil;
137
- NSString* url = [breadcrumb.data[@"url"] isKindOfClass:[NSString class]]
138
- ? breadcrumb.data[@"url"] : nil;
139
-
140
- if (startTimestamp == nil || endTimestamp == nil || url == nil) {
141
- return nil;
142
- }
143
-
144
- NSMutableDictionary* data = [[NSMutableDictionary alloc] init];
145
- if ([breadcrumb.data[@"method"] isKindOfClass:[NSString class]]) {
146
- data[@"method"] = breadcrumb.data[@"method"];
147
- }
148
- if ([breadcrumb.data[@"status_code"] isKindOfClass:[NSNumber class]]) {
149
- data[@"statusCode"] = breadcrumb.data[@"status_code"];
150
- }
151
- if ([breadcrumb.data[@"request_body_size"] isKindOfClass:[NSNumber class]]) {
152
- data[@"requestBodySize"] = breadcrumb.data[@"request_body_size"];
153
- }
154
- if ([breadcrumb.data[@"response_body_size"] isKindOfClass:[NSNumber class]]) {
155
- data[@"responseBodySize"] = breadcrumb.data[@"response_body_size"];
156
- }
157
-
158
- return [SentrySessionReplayIntegration
159
- createNetworkBreadcrumbWithTimestamp:[NSDate dateWithTimeIntervalSince1970:(startTimestamp.doubleValue / 1000)]
160
- endTimestamp:[NSDate dateWithTimeIntervalSince1970:(endTimestamp.doubleValue / 1000)]
161
- operation:@"resource.http"
162
- description:url
163
- data:data];
159
+ return [SentrySessionReplayIntegration
160
+ createNetworkBreadcrumbWithTimestamp:[NSDate
161
+ dateWithTimeIntervalSince1970:(startTimestamp
162
+ .doubleValue
163
+ / 1000)]
164
+ endTimestamp:[NSDate
165
+ dateWithTimeIntervalSince1970:(endTimestamp
166
+ .doubleValue
167
+ / 1000)]
168
+ operation:@"resource.http"
169
+ description:url
170
+ data:data];
164
171
  }
165
172
 
166
173
  @end
@@ -0,0 +1,7 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RNSentryTimeToDisplay : NSObject
4
+
5
+ - (void)getTimeToDisplay:(RCTResponseSenderBlock)callback;
6
+
7
+ @end
@@ -0,0 +1,44 @@
1
+ #import "RNSentryTimeToDisplay.h"
2
+ #import <QuartzCore/QuartzCore.h>
3
+ #import <React/RCTLog.h>
4
+
5
+ @implementation RNSentryTimeToDisplay {
6
+ CADisplayLink *displayLink;
7
+ RCTResponseSenderBlock resolveBlock;
8
+ }
9
+
10
+ // Rename requestAnimationFrame to getTimeToDisplay
11
+ - (void)getTimeToDisplay:(RCTResponseSenderBlock)callback
12
+ {
13
+ // Store the resolve block to use in the callback.
14
+ resolveBlock = callback;
15
+
16
+ #if TARGET_OS_IOS
17
+ // Create and add a display link to get the callback after the screen is rendered.
18
+ displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(handleDisplayLink:)];
19
+ [displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
20
+ #else
21
+ resolveBlock(@[]); // Return nothing if not iOS.
22
+ #endif
23
+ }
24
+
25
+ #if TARGET_OS_IOS
26
+ - (void)handleDisplayLink:(CADisplayLink *)link
27
+ {
28
+ // Get the current time
29
+ NSTimeInterval currentTime =
30
+ [[NSDate date] timeIntervalSince1970] * 1000.0; // Convert to milliseconds
31
+
32
+ // Ensure the callback is valid and pass the current time back
33
+ if (resolveBlock) {
34
+ resolveBlock(@[ @(currentTime) ]); // Call the callback with the current time
35
+ resolveBlock = nil; // Clear the block after it's called
36
+ }
37
+
38
+ // Invalidate the display link to stop future callbacks
39
+ [displayLink invalidate];
40
+ displayLink = nil;
41
+ }
42
+ #endif
43
+
44
+ @end
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sentry/react-native",
3
3
  "homepage": "https://github.com/getsentry/sentry-react-native",
4
4
  "repository": "https://github.com/getsentry/sentry-react-native",
5
- "version": "6.0.0",
5
+ "version": "6.2.0",
6
6
  "description": "Official Sentry SDK for react-native",
7
7
  "typings": "dist/js/index.d.ts",
8
8
  "types": "dist/js/index.d.ts",
@@ -66,22 +66,23 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@sentry/babel-plugin-component-annotate": "2.20.1",
69
- "@sentry/browser": "8.33.1",
70
- "@sentry/cli": "2.37.0",
71
- "@sentry/core": "8.33.1",
72
- "@sentry/react": "8.33.1",
73
- "@sentry/types": "8.33.1",
74
- "@sentry/utils": "8.33.1"
69
+ "@sentry/browser": "8.37.1",
70
+ "@sentry/cli": "2.38.2",
71
+ "@sentry/core": "8.37.1",
72
+ "@sentry/react": "8.37.1",
73
+ "@sentry/types": "8.37.1",
74
+ "@sentry/utils": "8.37.1"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@babel/core": "^7.23.5",
78
78
  "@expo/metro-config": "0.17.5",
79
79
  "@mswjs/interceptors": "^0.25.15",
80
- "@sentry-internal/eslint-config-sdk": "8.33.1",
81
- "@sentry-internal/eslint-plugin-sdk": "8.33.1",
82
- "@sentry-internal/typescript": "8.33.1",
83
- "@sentry/wizard": "3.16.3",
84
- "@testing-library/react-native": "^12.6.1",
80
+ "@react-native/babel-preset": "0.75.4",
81
+ "@sentry-internal/eslint-config-sdk": "8.37.1",
82
+ "@sentry-internal/eslint-plugin-sdk": "8.37.1",
83
+ "@sentry-internal/typescript": "8.37.1",
84
+ "@sentry/wizard": "3.34.4",
85
+ "@testing-library/react-native": "^12.7.2",
85
86
  "@types/jest": "^29.5.3",
86
87
  "@types/node": "^20.9.3",
87
88
  "@types/react": "^18.2.64",
@@ -105,9 +106,9 @@
105
106
  "madge": "^6.1.0",
106
107
  "metro": "0.80.10",
107
108
  "prettier": "^2.0.5",
108
- "react": "18.2.0",
109
- "react-native": "0.73.9",
110
- "react-test-renderer": "^18.2.0",
109
+ "react": "18.3.1",
110
+ "react-native": "0.75.4",
111
+ "react-test-renderer": "^18.3.1",
111
112
  "rimraf": "^4.1.1",
112
113
  "ts-jest": "^29.1.1",
113
114
  "typescript": "4.9.5",
@@ -23,12 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.SDK_PACKAGE_NAME = exports.sdkPackage = void 0;
27
- exports.writeSentryPropertiesTo = writeSentryPropertiesTo;
28
- exports.warnOnce = warnOnce;
29
- exports.logPrefix = logPrefix;
30
- exports.yellow = yellow;
31
- exports.bold = bold;
26
+ exports.SDK_PACKAGE_NAME = exports.sdkPackage = exports.bold = exports.yellow = exports.logPrefix = exports.warnOnce = exports.writeSentryPropertiesTo = void 0;
32
27
  const fs = __importStar(require("fs"));
33
28
  const path = __importStar(require("path"));
34
29
  function writeSentryPropertiesTo(filepath, sentryProperties) {
@@ -37,6 +32,7 @@ function writeSentryPropertiesTo(filepath, sentryProperties) {
37
32
  }
38
33
  fs.writeFileSync(path.resolve(filepath, 'sentry.properties'), sentryProperties);
39
34
  }
35
+ exports.writeSentryPropertiesTo = writeSentryPropertiesTo;
40
36
  const sdkPackage = require('../../package.json');
41
37
  exports.sdkPackage = sdkPackage;
42
38
  const SDK_PACKAGE_NAME = `${sdkPackage.name}/expo`;
@@ -49,9 +45,11 @@ function warnOnce(message) {
49
45
  console.warn(yellow(`${logPrefix()} ${message}`));
50
46
  }
51
47
  }
48
+ exports.warnOnce = warnOnce;
52
49
  function logPrefix() {
53
50
  return `› ${bold('[@sentry/react-native/expo]')}`;
54
51
  }
52
+ exports.logPrefix = logPrefix;
55
53
  /**
56
54
  * The same as `chalk.yellow`
57
55
  * This code is part of the SDK, we don't want to introduce a dependency on `chalk` just for this.
@@ -59,6 +57,7 @@ function logPrefix() {
59
57
  function yellow(message) {
60
58
  return `\x1b[33m${message}\x1b[0m`;
61
59
  }
60
+ exports.yellow = yellow;
62
61
  /**
63
62
  * The same as `chalk.bold`
64
63
  * This code is part of the SDK, we don't want to introduce a dependency on `chalk` just for this.
@@ -66,3 +65,4 @@ function yellow(message) {
66
65
  function bold(message) {
67
66
  return `\x1b[1m${message}\x1b[22m`;
68
67
  }
68
+ exports.bold = bold;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withSentry = void 0;
4
- exports.getSentryProperties = getSentryProperties;
3
+ exports.withSentry = exports.getSentryProperties = void 0;
5
4
  const config_plugins_1 = require("expo/config-plugins");
6
5
  const utils_1 = require("./utils");
7
6
  const withSentryAndroid_1 = require("./withSentryAndroid");
@@ -50,6 +49,7 @@ ${organization ? `defaults.org=${organization}` : missingOrgMessage}
50
49
  ${project ? `defaults.project=${project}` : missingProjectMessage}
51
50
  ${authToken ? `${existingAuthTokenMessage}\nauth.token=${authToken}` : missingAuthTokenMessage}`;
52
51
  }
52
+ exports.getSentryProperties = getSentryProperties;
53
53
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
54
54
  const withSentry = (0, config_plugins_1.createRunOncePlugin)(withSentryPlugin, utils_1.sdkPackage.name, utils_1.sdkPackage.version);
55
55
  exports.withSentry = withSentry;
@@ -23,8 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.withSentryAndroid = void 0;
27
- exports.modifyAppBuildGradle = modifyAppBuildGradle;
26
+ exports.modifyAppBuildGradle = exports.withSentryAndroid = void 0;
28
27
  const config_plugins_1 = require("expo/config-plugins");
29
28
  const path = __importStar(require("path"));
30
29
  const utils_1 = require("./utils");
@@ -66,3 +65,4 @@ function modifyAppBuildGradle(buildGradle) {
66
65
  const applyFrom = `apply from: new File(${resolveSentryReactNativePackageJsonPath}, "sentry.gradle")`;
67
66
  return buildGradle.replace(pattern, match => `${applyFrom}\n\n${match}`);
68
67
  }
68
+ exports.modifyAppBuildGradle = modifyAppBuildGradle;
@@ -23,9 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.withSentryIOS = void 0;
27
- exports.modifyExistingXcodeBuildScript = modifyExistingXcodeBuildScript;
28
- exports.addSentryWithBundledScriptsToBundleShellScript = addSentryWithBundledScriptsToBundleShellScript;
26
+ exports.addSentryWithBundledScriptsToBundleShellScript = exports.modifyExistingXcodeBuildScript = exports.withSentryIOS = void 0;
29
27
  const config_plugins_1 = require("expo/config-plugins");
30
28
  const path = __importStar(require("path"));
31
29
  const utils_1 = require("./utils");
@@ -73,8 +71,10 @@ Run npx expo prebuild --clean`);
73
71
  const code = JSON.parse(script.shellScript);
74
72
  script.shellScript = JSON.stringify(addSentryWithBundledScriptsToBundleShellScript(code));
75
73
  }
74
+ exports.modifyExistingXcodeBuildScript = modifyExistingXcodeBuildScript;
76
75
  function addSentryWithBundledScriptsToBundleShellScript(script) {
77
76
  return script.replace(/^.*?(packager|scripts)\/react-native-xcode\.sh\s*(\\'\\\\")?/m,
78
77
  // eslint-disable-next-line no-useless-escape
79
78
  (match) => `/bin/sh ${SENTRY_REACT_NATIVE_XCODE_PATH} ${match}`);
80
79
  }
80
+ exports.addSentryWithBundledScriptsToBundleShellScript = addSentryWithBundledScriptsToBundleShellScript;
@@ -35,6 +35,8 @@ XCODE_BUILD_CONFIGURATION="${CONFIGURATION}"
35
35
 
36
36
  if [ "$SENTRY_DISABLE_AUTO_UPLOAD" == true ]; then
37
37
  echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping debug files upload"
38
+ elif [ "$SENTRY_DISABLE_XCODE_DEBUG_UPLOAD" == true ]; then
39
+ echo "SENTRY_DISABLE_XCODE_DEBUG_UPLOAD=true, skipping native debug files upload"
38
40
  elif echo "$XCODE_BUILD_CONFIGURATION" | grep -iq "debug"; then # case insensitive check for "debug"
39
41
  echo "Skipping debug files upload for *Debug* configuration"
40
42
  else
package/sentry.gradle CHANGED
@@ -3,10 +3,18 @@ import org.apache.tools.ant.taskdefs.condition.Os
3
3
  import java.util.regex.Matcher
4
4
  import java.util.regex.Pattern
5
5
 
6
- project.ext.shouldSentryAutoUpload = { ->
6
+ project.ext.shouldSentryAutoUploadNative = { ->
7
+ return System.getenv('SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD') != 'true'
8
+ }
9
+
10
+ project.ext.shouldSentryAutoUploadGeneral = { ->
7
11
  return System.getenv('SENTRY_DISABLE_AUTO_UPLOAD') != 'true'
8
12
  }
9
13
 
14
+ project.ext.shouldSentryAutoUpload = { ->
15
+ return shouldSentryAutoUploadGeneral() && shouldSentryAutoUploadNative()
16
+ }
17
+
10
18
  def config = project.hasProperty("sentryCli") ? project.sentryCli : [];
11
19
 
12
20
  gradle.projectsEvaluated {
@@ -98,7 +106,7 @@ gradle.projectsEvaluated {
98
106
 
99
107
  /** Upload source map file to the sentry server via CLI call. */
100
108
  def cliTask = tasks.create(nameCliTask) {
101
- onlyIf { shouldSentryAutoUpload() }
109
+ onlyIf { shouldSentryAutoUploadGeneral() }
102
110
  description = "upload debug symbols to sentry"
103
111
  group = 'sentry.io'
104
112
 
@@ -9,6 +9,7 @@ import type { UnsafeObject } from './utils/rnlibrariesinterface';
9
9
  export interface Spec extends TurboModule {
10
10
  addListener: (eventType: string) => void;
11
11
  removeListeners: (id: number) => void;
12
+ getNewScreenTimeToDisplay(): Promise<number | undefined | null>;
12
13
  addBreadcrumb(breadcrumb: UnsafeObject): void;
13
14
  captureEnvelope(
14
15
  bytes: string,
@@ -4,6 +4,7 @@ import type { UnsafeObject } from './utils/rnlibrariesinterface';
4
4
  export interface Spec extends TurboModule {
5
5
  addListener: (eventType: string) => void;
6
6
  removeListeners: (id: number) => void;
7
+ getNewScreenTimeToDisplay(): Promise<number | undefined | null>;
7
8
  addBreadcrumb(breadcrumb: UnsafeObject): void;
8
9
  captureEnvelope(bytes: string, options: {
9
10
  hardCrashed: boolean;
@@ -1,5 +1,5 @@
1
- export type { Breadcrumb, Request, SdkInfo, Event, Exception, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/types';
2
- export { addBreadcrumb, captureException, captureEvent, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metricsDefault as metrics, } from '@sentry/core';
1
+ export type { Breadcrumb, Request, SdkInfo, Event, Exception, SeverityLevel, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/types';
2
+ export { addBreadcrumb, captureException, captureEvent, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metricsDefault as metrics, } from '@sentry/core';
3
3
  export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
4
4
  export * from './integrations/exports';
5
5
  export { SDK_NAME, SDK_VERSION } from './version';
@@ -14,5 +14,9 @@ type SpotlightReactNativeIntegrationOptions = {
14
14
  * Learn more about spotlight at https://spotlightjs.com
15
15
  */
16
16
  export declare function spotlightIntegration({ sidecarUrl, }?: SpotlightReactNativeIntegrationOptions): Integration;
17
+ /**
18
+ * Gets the default Spotlight sidecar URL.
19
+ */
20
+ export declare function getDefaultSidecarUrl(): string;
17
21
  export {};
18
22
  //# sourceMappingURL=spotlight.d.ts.map
@@ -1,5 +1,10 @@
1
+ interface ReactNativeVersion {
2
+ major: number;
3
+ minor: number;
4
+ }
1
5
  /**
2
6
  * This is a workaround for using fetch on RN, this is a known issue in react-native and only generates a warning.
3
7
  */
4
- export declare function ignoreRequireCycleLogs(): void;
8
+ export declare function ignoreRequireCycleLogs(version?: ReactNativeVersion): void;
9
+ export {};
5
10
  //# sourceMappingURL=ignorerequirecyclelogs.d.ts.map
@@ -0,0 +1,19 @@
1
+ import type { SentryEventEmitter } from './sentryeventemitter';
2
+ export declare const FALLBACK_TIMEOUT_MS = 10000;
3
+ export type FallBackNewFrameEvent = {
4
+ newFrameTimestampInSeconds: number;
5
+ isFallback?: boolean;
6
+ };
7
+ export interface SentryEventEmitterFallback {
8
+ /**
9
+ * Initializes the fallback event emitter
10
+ * This method is synchronous in JS but the event emitter starts asynchronously.
11
+ */
12
+ initAsync: () => void;
13
+ onceNewFrame: (listener: (event: FallBackNewFrameEvent) => void) => void;
14
+ }
15
+ /**
16
+ * Creates emitter that allows to listen to UI Frame events when ready.
17
+ */
18
+ export declare function createSentryFallbackEventEmitter(emitter?: SentryEventEmitter, fallbackTimeoutMs?: number): SentryEventEmitterFallback;
19
+ //# sourceMappingURL=sentryeventemitterfallback.d.ts.map
@@ -39,7 +39,7 @@ export type ReactNativeVersion = {
39
39
  major: number;
40
40
  minor: number;
41
41
  patch: number;
42
- prerelease?: number | null | undefined;
42
+ prerelease?: string | null | undefined;
43
43
  };
44
44
  };
45
45
  export {};
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "6.0.0";
3
+ export declare const SDK_VERSION = "6.2.0";
4
4
  //# sourceMappingURL=version.d.ts.map