@sentry/react-native 5.23.1 → 5.24.1

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 (46) hide show
  1. package/CHANGELOG.md +42 -1
  2. package/RNSentry.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +7 -23
  5. package/dist/js/NativeRNSentry.d.ts +8 -3
  6. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  7. package/dist/js/NativeRNSentry.js.map +1 -1
  8. package/dist/js/client.d.ts +1 -1
  9. package/dist/js/client.d.ts.map +1 -1
  10. package/dist/js/client.js +2 -2
  11. package/dist/js/client.js.map +1 -1
  12. package/dist/js/tracing/nativeframes.d.ts +2 -2
  13. package/dist/js/tracing/nativeframes.d.ts.map +1 -1
  14. package/dist/js/tracing/nativeframes.js +36 -14
  15. package/dist/js/tracing/nativeframes.js.map +1 -1
  16. package/dist/js/tracing/reactnativeprofiler.d.ts +1 -0
  17. package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
  18. package/dist/js/tracing/reactnativeprofiler.js +7 -3
  19. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  20. package/dist/js/tracing/reactnativetracing.d.ts +18 -0
  21. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  22. package/dist/js/tracing/reactnativetracing.js +93 -10
  23. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  24. package/dist/js/tracing/utils.d.ts +6 -0
  25. package/dist/js/tracing/utils.d.ts.map +1 -1
  26. package/dist/js/tracing/utils.js +21 -1
  27. package/dist/js/tracing/utils.js.map +1 -1
  28. package/dist/js/utils/worldwide.d.ts +2 -0
  29. package/dist/js/utils/worldwide.d.ts.map +1 -1
  30. package/dist/js/utils/worldwide.js.map +1 -1
  31. package/dist/js/version.d.ts +1 -1
  32. package/dist/js/version.js +1 -1
  33. package/dist/js/version.js.map +1 -1
  34. package/ios/RNSentry.mm +10 -20
  35. package/package.json +11 -11
  36. package/scripts/sentry-xcode-debug-files.sh +10 -1
  37. package/scripts/sentry-xcode.sh +10 -1
  38. package/src/js/NativeRNSentry.ts +8 -3
  39. package/ts3.8/dist/js/NativeRNSentry.d.ts +8 -3
  40. package/ts3.8/dist/js/client.d.ts +1 -1
  41. package/ts3.8/dist/js/tracing/nativeframes.d.ts +2 -2
  42. package/ts3.8/dist/js/tracing/reactnativeprofiler.d.ts +1 -0
  43. package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +18 -0
  44. package/ts3.8/dist/js/tracing/utils.d.ts +6 -0
  45. package/ts3.8/dist/js/utils/worldwide.d.ts +2 -0
  46. package/ts3.8/dist/js/version.d.ts +1 -1
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": "5.23.1",
5
+ "version": "5.24.1",
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",
@@ -67,22 +67,22 @@
67
67
  "react-native": ">=0.65.0"
68
68
  },
69
69
  "dependencies": {
70
- "@sentry/browser": "7.113.0",
70
+ "@sentry/browser": "7.117.0",
71
71
  "@sentry/cli": "2.31.2",
72
- "@sentry/core": "7.113.0",
73
- "@sentry/hub": "7.113.0",
74
- "@sentry/integrations": "7.113.0",
75
- "@sentry/react": "7.113.0",
76
- "@sentry/types": "7.113.0",
77
- "@sentry/utils": "7.113.0"
72
+ "@sentry/core": "7.117.0",
73
+ "@sentry/hub": "7.117.0",
74
+ "@sentry/integrations": "7.117.0",
75
+ "@sentry/react": "7.117.0",
76
+ "@sentry/types": "7.117.0",
77
+ "@sentry/utils": "7.117.0"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@babel/core": "^7.23.5",
81
81
  "@expo/metro-config": "0.17.5",
82
82
  "@mswjs/interceptors": "^0.25.15",
83
- "@sentry-internal/eslint-config-sdk": "7.113.0",
84
- "@sentry-internal/eslint-plugin-sdk": "7.113.0",
85
- "@sentry-internal/typescript": "7.113.0",
83
+ "@sentry-internal/eslint-config-sdk": "7.117.0",
84
+ "@sentry-internal/eslint-plugin-sdk": "7.117.0",
85
+ "@sentry-internal/typescript": "7.117.0",
86
86
  "@sentry/wizard": "3.16.3",
87
87
  "@types/jest": "^29.5.3",
88
88
  "@types/node": "^20.9.3",
@@ -35,5 +35,14 @@ if [ "$SENTRY_DISABLE_AUTO_UPLOAD" == true ]; then
35
35
  elif echo "$XCODE_BUILD_CONFIGURATION" | grep -iq "debug"; then # case insensitive check for "debug"
36
36
  echo "Skipping debug files upload for *Debug* configuration"
37
37
  else
38
- /bin/sh -c "\"$LOCAL_NODE_BINARY\" $UPLOAD_DEBUG_FILES"
38
+ # 'warning:' triggers a warning in Xcode, 'error:' triggers an error
39
+ set +x +e # disable printing commands otherwise we might print `error:` by accident and allow continuing on error
40
+ SENTRY_UPLOAD_COMMAND_OUTPUT=$(/bin/sh -c "\"$LOCAL_NODE_BINARY\" $UPLOAD_DEBUG_FILES" 2>&1)
41
+ if [ $? -eq 0 ]; then
42
+ echo "$SENTRY_UPLOAD_COMMAND_OUTPUT" | awk '{print "output: sentry-cli - " $0}'
43
+ else
44
+ echo "error: sentry-cli - To disable native debug files auto upload, set SENTRY_DISABLE_AUTO_UPLOAD=true in your environment variables. Or to allow failing upload, set SENTRY_ALLOW_FAILURE=true"
45
+ echo "error: sentry-cli - $SENTRY_UPLOAD_COMMAND_OUTPUT"
46
+ fi
47
+ set -x -e # re-enable
39
48
  fi
@@ -23,7 +23,16 @@ ARGS="$NO_AUTO_RELEASE $SENTRY_CLI_EXTRA_ARGS $SENTRY_CLI_RN_XCODE_EXTRA_ARGS"
23
23
  REACT_NATIVE_XCODE_WITH_SENTRY="\"$SENTRY_CLI_EXECUTABLE\" react-native xcode $ARGS \"$REACT_NATIVE_XCODE\""
24
24
 
25
25
  if [ "$SENTRY_DISABLE_AUTO_UPLOAD" != true ]; then
26
- /bin/sh -c "\"$LOCAL_NODE_BINARY\" $REACT_NATIVE_XCODE_WITH_SENTRY"
26
+ # 'warning:' triggers a warning in Xcode, 'error:' triggers an error
27
+ set +x +e # disable printing commands otherwise we might print `error:` by accident and allow continuing on error
28
+ SENTRY_XCODE_COMMAND_OUTPUT=$(/bin/sh -c "\"$LOCAL_NODE_BINARY\" $REACT_NATIVE_XCODE_WITH_SENTRY" 2>&1)
29
+ if [ $? -eq 0 ]; then
30
+ echo "$SENTRY_XCODE_COMMAND_OUTPUT" | awk '{print "output: sentry-cli - " $0}'
31
+ else
32
+ echo "error: sentry-cli - To disable source maps auto upload, set SENTRY_DISABLE_AUTO_UPLOAD=true in your environment variables. Or to allow failing upload, set SENTRY_ALLOW_FAILURE=true"
33
+ echo "error: sentry-cli - $SENTRY_XCODE_COMMAND_OUTPUT"
34
+ fi
35
+ set -x -e # re-enable
27
36
  else
28
37
  echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping sourcemaps upload"
29
38
  /bin/sh -c "$REACT_NATIVE_XCODE"
@@ -90,9 +90,14 @@ export type NativeStackFrames = {
90
90
  };
91
91
 
92
92
  export type NativeAppStartResponse = {
93
- isColdStart: boolean;
94
- appStartTime: number;
95
- didFetchAppStart: boolean;
93
+ type: 'cold' | 'warm' | 'unknown';
94
+ has_fetched: boolean;
95
+ app_start_timestamp_ms?: number;
96
+ spans: {
97
+ description: string;
98
+ start_timestamp_ms: number;
99
+ end_timestamp_ms: number;
100
+ }[];
96
101
  };
97
102
 
98
103
  export type NativeFramesResponse = {
@@ -81,9 +81,14 @@ export type NativeStackFrames = {
81
81
  debugMetaImages?: NativeDebugImage[];
82
82
  };
83
83
  export type NativeAppStartResponse = {
84
- isColdStart: boolean;
85
- appStartTime: number;
86
- didFetchAppStart: boolean;
84
+ type: 'cold' | 'warm' | 'unknown';
85
+ has_fetched: boolean;
86
+ app_start_timestamp_ms?: number;
87
+ spans: {
88
+ description: string;
89
+ start_timestamp_ms: number;
90
+ end_timestamp_ms: number;
91
+ }[];
87
92
  };
88
93
  export type NativeFramesResponse = {
89
94
  totalFrames: number;
@@ -38,7 +38,7 @@ export declare class ReactNativeClient extends BaseClient<ReactNativeClientOptio
38
38
  /**
39
39
  * Sets up the integrations
40
40
  */
41
- setupIntegrations(): void;
41
+ protected _setupIntegrations(): void;
42
42
  /**
43
43
  * @inheritdoc
44
44
  */
@@ -46,11 +46,11 @@ export declare class NativeFramesInstrumentation {
46
46
  /**
47
47
  * Fetch finish frames for a transaction at the current time. Calls any awaiting listeners.
48
48
  */
49
- private _fetchFramesForTransaction;
49
+ private _fetchEndFramesForTransaction;
50
50
  /**
51
51
  * On a finish frames failure, we cancel the await.
52
52
  */
53
- private _cancelFinishFrames;
53
+ private _cancelEndFrames;
54
54
  /**
55
55
  * Adds frames measurements to an event. Called from a valid event processor.
56
56
  * Awaits for finish frames if needed.
@@ -4,6 +4,7 @@ import { Profiler } from '@sentry/react';
4
4
  */
5
5
  export declare class ReactNativeProfiler extends Profiler {
6
6
  readonly name: string;
7
+ constructor(props: ConstructorParameters<typeof Profiler>[0]);
7
8
  /**
8
9
  * Get the app root mount time.
9
10
  */
@@ -99,6 +99,7 @@ export declare class ReactNativeTracing implements Integration {
99
99
  private _hasSetTracePropagationTargets;
100
100
  private _hasSetTracingOrigins;
101
101
  private _currentViewName;
102
+ private _firstConstructorCallTimestampMs;
102
103
  constructor(options?: Partial<ReactNativeTracingOptions>);
103
104
  /**
104
105
  * Registers routing and request instrumentation.
@@ -116,6 +117,10 @@ export declare class ReactNativeTracing implements Integration {
116
117
  * Called by the ReactNativeProfiler component on first component mount.
117
118
  */
118
119
  onAppStartFinish(endTimestamp: number): void;
120
+ /**
121
+ * Sets the root component first constructor call timestamp.
122
+ */
123
+ setRootComponentFirstConstructorCallTimestampMs(timestamp: number): void;
119
124
  /**
120
125
  * Starts a new transaction for a user interaction.
121
126
  * @param userInteractionId Consists of `op` representation UI Event and `elementId` unique element identifier on current screen.
@@ -147,6 +152,19 @@ export declare class ReactNativeTracing implements Integration {
147
152
  * Adds app start measurements and starts a child span on a transaction.
148
153
  */
149
154
  private _addAppStartData;
155
+ /**
156
+ * Adds JS Execution before React Root. If `Sentry.wrap` is not used, create a span for the start of JS Bundle execution.
157
+ */
158
+ private _addJSExecutionBeforeRoot;
159
+ /**
160
+ * Adds native spans to the app start span.
161
+ */
162
+ private _addNativeSpansTo;
163
+ /**
164
+ * UIKit init is measured by the native layers till the native SDK start
165
+ * RN initializes the native SDK later, the end timestamp would be wrong
166
+ */
167
+ private _createUIKitSpan;
150
168
  /** To be called when the route changes, but BEFORE the components of the new route mount. */
151
169
  private _onRouteWillChange;
152
170
  /**
@@ -29,4 +29,10 @@ export declare function isNearToNow(timestamp: number): boolean;
29
29
  * Uses `setMeasurement` function from @sentry/core.
30
30
  */
31
31
  export declare function setSpanDurationAsMeasurement(name: string, span: Span): void;
32
+ /**
33
+ * Returns unix timestamp in ms of the bundle start time.
34
+ *
35
+ * If not available, returns undefined.
36
+ */
37
+ export declare function getBundleStartTimestampMs(): number | undefined;
32
38
  //# sourceMappingURL=utils.d.ts.map
@@ -20,6 +20,8 @@ export interface ReactNativeInternalGlobal extends InternalGlobal {
20
20
  ___SENTRY_METRO_DEV_SERVER___?: string;
21
21
  };
22
22
  };
23
+ __BUNDLE_START_TIME__?: number;
24
+ nativePerformanceNow?: () => number;
23
25
  }
24
26
  /** Get's the global object for the current JavaScript runtime */
25
27
  export declare const RN_GLOBAL_OBJ: ReactNativeInternalGlobal;
@@ -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 = "5.23.1";
3
+ export declare const SDK_VERSION = "5.24.1";
4
4
  //# sourceMappingURL=version.d.ts.map