@sentry/react-native 5.4.1 → 5.5.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 +29 -0
- package/RNSentry.podspec +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +6 -6
- package/dist/js/integrations/reactnativeinfo.d.ts +3 -0
- package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeinfo.js +7 -1
- package/dist/js/integrations/reactnativeinfo.js.map +1 -1
- package/dist/js/utils/environment.d.ts +6 -0
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js +15 -0
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/utils/worldwide.d.ts +4 -1
- package/dist/js/utils/worldwide.d.ts.map +1 -1
- package/dist/js/utils/worldwide.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/ios/RNSentry.h +2 -0
- package/ios/RNSentry.mm +8 -6
- package/package.json +11 -11
- package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +3 -0
- package/ts3.8/dist/js/utils/environment.d.ts +6 -0
- package/ts3.8/dist/js/utils/worldwide.d.ts +4 -1
- package/ts3.8/dist/js/version.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.5.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Add `expo`, `react_native_version` and `hermes_version` to React Native Context ([#3050](https://github.com/getsentry/sentry-react-native/pull/3050))
|
|
8
|
+
|
|
9
|
+
### Dependencies
|
|
10
|
+
|
|
11
|
+
- Bump JavaScript SDK from v7.51.1 to v7.52.0 ([#3054](https://github.com/getsentry/sentry-react-native/pull/3054), [#3068](https://github.com/getsentry/sentry-react-native/pull/3068))
|
|
12
|
+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7520)
|
|
13
|
+
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.51.1...7.52.0)
|
|
14
|
+
- Bump Cocoa SDK from v8.6.0 to v8.7.1 ([#3056](https://github.com/getsentry/sentry-react-native/pull/3056), [#3067](https://github.com/getsentry/sentry-react-native/pull/3067))
|
|
15
|
+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#871)
|
|
16
|
+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.6.0...8.7.1)
|
|
17
|
+
|
|
18
|
+
## 5.4.2
|
|
19
|
+
|
|
20
|
+
### Fixes
|
|
21
|
+
|
|
22
|
+
- Fix `event.origin` and `event.environment` on unhandled exception ([#3041](https://github.com/getsentry/sentry-react-native/pull/3041))
|
|
23
|
+
- Don't pass `enableTracing` from RN to `sentry-cocoa` options ([#3042](https://github.com/getsentry/sentry-react-native/pull/3042))
|
|
24
|
+
- Only store envelopes of fatal crashes on iOS ([#3051](https://github.com/getsentry/sentry-react-native/pull/3051))
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
- Bump JavaScript SDK from v7.50.0 to v7.51.1 ([#3043](https://github.com/getsentry/sentry-react-native/pull/3043), [#3053](https://github.com/getsentry/sentry-react-native/pull/3053))
|
|
29
|
+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7511)
|
|
30
|
+
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.50.0...7.51.1)
|
|
31
|
+
|
|
3
32
|
## 5.4.1
|
|
4
33
|
|
|
5
34
|
### Fixes
|
package/RNSentry.podspec
CHANGED
|
@@ -10,7 +10,6 @@ import android.content.res.AssetManager;
|
|
|
10
10
|
import android.util.SparseIntArray;
|
|
11
11
|
|
|
12
12
|
import androidx.annotation.Nullable;
|
|
13
|
-
import androidx.annotation.NonNull;
|
|
14
13
|
import androidx.core.app.FrameMetricsAggregator;
|
|
15
14
|
|
|
16
15
|
import com.facebook.react.bridge.Arguments;
|
|
@@ -69,6 +68,8 @@ public class RNSentryModuleImpl {
|
|
|
69
68
|
|
|
70
69
|
public static final String NAME = "RNSentry";
|
|
71
70
|
|
|
71
|
+
private static final String NATIVE_SDK_NAME = "sentry.native.android";
|
|
72
|
+
private static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
|
|
72
73
|
private static final ILogger logger = new AndroidLogger(NAME);
|
|
73
74
|
private static final BuildInfoProvider buildInfo = new BuildInfoProvider(logger);
|
|
74
75
|
private static final String modulesPath = "modules.json";
|
|
@@ -104,12 +105,11 @@ public class RNSentryModuleImpl {
|
|
|
104
105
|
|
|
105
106
|
public void initNativeSdk(final ReadableMap rnOptions, Promise promise) {
|
|
106
107
|
SentryAndroid.init(this.getReactApplicationContext(), options -> {
|
|
107
|
-
@NonNull final String sdkName = "sentry.java.android.react-native";
|
|
108
108
|
@Nullable SdkVersion sdkVersion = options.getSdkVersion();
|
|
109
109
|
if (sdkVersion == null) {
|
|
110
|
-
sdkVersion = new SdkVersion(
|
|
110
|
+
sdkVersion = new SdkVersion(ANDROID_SDK_NAME, BuildConfig.VERSION_NAME);
|
|
111
111
|
} else {
|
|
112
|
-
sdkVersion.setName(
|
|
112
|
+
sdkVersion.setName(ANDROID_SDK_NAME);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
options.setSentryClientName(sdkVersion.getName() + "/" + sdkVersion.getVersion());
|
|
@@ -621,10 +621,10 @@ public class RNSentryModuleImpl {
|
|
|
621
621
|
switch (sdk.getName()) {
|
|
622
622
|
// If the event is from capacitor js, it gets set there and we do not handle it
|
|
623
623
|
// here.
|
|
624
|
-
case
|
|
624
|
+
case NATIVE_SDK_NAME:
|
|
625
625
|
setEventEnvironmentTag(event, "native");
|
|
626
626
|
break;
|
|
627
|
-
case
|
|
627
|
+
case ANDROID_SDK_NAME:
|
|
628
628
|
setEventEnvironmentTag(event, "java");
|
|
629
629
|
break;
|
|
630
630
|
default:
|
|
@@ -3,6 +3,9 @@ export interface ReactNativeContext extends Context {
|
|
|
3
3
|
js_engine?: string;
|
|
4
4
|
turbo_module: boolean;
|
|
5
5
|
fabric: boolean;
|
|
6
|
+
expo: boolean;
|
|
7
|
+
hermes_version?: string;
|
|
8
|
+
react_native_version: string;
|
|
6
9
|
component_stack?: string;
|
|
7
10
|
}
|
|
8
11
|
/** Loads React Native context at runtime */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAoB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"reactnativeinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAoB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5F,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,4CAA4C;AAC5C,qBAAa,eAAgB,YAAW,WAAW;IACjD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAqB;IAE7C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAsB;IAEzC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAwCpF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { isFabricEnabled, isHermesEnabled, isTurboModuleEnabled } from '../utils/environment';
|
|
2
|
+
import { getHermesVersion, getReactNativeVersion, isExpo, isFabricEnabled, isHermesEnabled, isTurboModuleEnabled, } from '../utils/environment';
|
|
3
3
|
/** Loads React Native context at runtime */
|
|
4
4
|
export class ReactNativeInfo {
|
|
5
5
|
constructor() {
|
|
@@ -17,9 +17,15 @@ export class ReactNativeInfo {
|
|
|
17
17
|
const reactNativeContext = {
|
|
18
18
|
turbo_module: isTurboModuleEnabled(),
|
|
19
19
|
fabric: isFabricEnabled(),
|
|
20
|
+
react_native_version: getReactNativeVersion(),
|
|
21
|
+
expo: isExpo(),
|
|
20
22
|
};
|
|
21
23
|
if (isHermesEnabled()) {
|
|
22
24
|
reactNativeContext.js_engine = 'hermes';
|
|
25
|
+
const hermesVersion = getHermesVersion();
|
|
26
|
+
if (hermesVersion) {
|
|
27
|
+
reactNativeContext.hermes_version = getHermesVersion();
|
|
28
|
+
}
|
|
23
29
|
}
|
|
24
30
|
else if (reactNativeError === null || reactNativeError === void 0 ? void 0 : reactNativeError.jsEngine) {
|
|
25
31
|
reactNativeContext.js_engine = reactNativeError.jsEngine;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":";AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,MAAM,EACN,eAAe,EACf,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAa9B,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAA5B;QAME;;WAEG;QACI,SAAI,GAAW,eAAe,CAAC,EAAE,CAAC;IA6C3C,CAAC;IA3CC;;OAEG;IACI,SAAS,CAAC,uBAA2D;QAC1E,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAgB,EAAE,EAAE;YAC/D,MAAM,gBAAgB,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,EAAC,CAAC,CAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAsC,CAAC,CAAC,CAAC,SAAS,CAAC;YAE7G,MAAM,kBAAkB,GAAuB;gBAC7C,YAAY,EAAE,oBAAoB,EAAE;gBACpC,MAAM,EAAE,eAAe,EAAE;gBACzB,oBAAoB,EAAE,qBAAqB,EAAE;gBAC7C,IAAI,EAAE,MAAM,EAAE;aACf,CAAC;YAEF,IAAI,eAAe,EAAE,EAAE;gBACrB,kBAAkB,CAAC,SAAS,GAAG,QAAQ,CAAC;gBACxC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;gBACzC,IAAI,aAAa,EAAE;oBACjB,kBAAkB,CAAC,cAAc,GAAG,gBAAgB,EAAE,CAAC;iBACxD;aACF;iBAAM,IAAI,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,QAAQ,EAAE;gBACrC,kBAAkB,CAAC,SAAS,GAAG,gBAAgB,CAAC,QAAQ,CAAC;aAC1D;YAED,IAAI,kBAAkB,CAAC,SAAS,KAAK,QAAQ,EAAE;gBAC7C,KAAK,CAAC,IAAI,mBACR,MAAM,EAAE,MAAM,IACX,KAAK,CAAC,IAAI,CACd,CAAC;aACH;YAED,IAAI,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,cAAc,EAAE;gBACpC,kBAAkB,CAAC,eAAe,GAAG,gBAAgB,CAAC,cAAc,CAAC;aACtE;YAED,KAAK,CAAC,QAAQ,mBACZ,oBAAoB,EAAE,kBAAkB,IACrC,KAAK,CAAC,QAAQ,CAClB,CAAC;YAEF,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AApDD;;GAEG;AACW,kBAAE,GAAW,iBAAiB,CAAC","sourcesContent":["import type { Context, Event, EventHint, EventProcessor, Integration } from '@sentry/types';\n\nimport {\n getHermesVersion,\n getReactNativeVersion,\n isExpo,\n isFabricEnabled,\n isHermesEnabled,\n isTurboModuleEnabled,\n} from '../utils/environment';\nimport type { ReactNativeError } from './debugsymbolicator';\n\nexport interface ReactNativeContext extends Context {\n js_engine?: string;\n turbo_module: boolean;\n fabric: boolean;\n expo: boolean;\n hermes_version?: string;\n react_native_version: string;\n component_stack?: string;\n}\n\n/** Loads React Native context at runtime */\nexport class ReactNativeInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeInfo.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event: Event, hint?: EventHint) => {\n const reactNativeError = hint?.originalException ? (hint?.originalException as ReactNativeError) : undefined;\n\n const reactNativeContext: ReactNativeContext = {\n turbo_module: isTurboModuleEnabled(),\n fabric: isFabricEnabled(),\n react_native_version: getReactNativeVersion(),\n expo: isExpo(),\n };\n\n if (isHermesEnabled()) {\n reactNativeContext.js_engine = 'hermes';\n const hermesVersion = getHermesVersion();\n if (hermesVersion) {\n reactNativeContext.hermes_version = getHermesVersion();\n }\n } else if (reactNativeError?.jsEngine) {\n reactNativeContext.js_engine = reactNativeError.jsEngine;\n }\n\n if (reactNativeContext.js_engine === 'hermes') {\n event.tags = {\n hermes: 'true',\n ...event.tags,\n };\n }\n\n if (reactNativeError?.componentStack) {\n reactNativeContext.component_stack = reactNativeError.componentStack;\n }\n\n event.contexts = {\n react_native_context: reactNativeContext,\n ...event.contexts,\n };\n\n return event;\n });\n }\n}\n"]}
|
|
@@ -4,4 +4,10 @@ export declare function isHermesEnabled(): boolean;
|
|
|
4
4
|
export declare function isTurboModuleEnabled(): boolean;
|
|
5
5
|
/** Checks if the React Native Fabric renderer is running */
|
|
6
6
|
export declare function isFabricEnabled(): boolean;
|
|
7
|
+
/** Returns React Native Version as semver string */
|
|
8
|
+
export declare function getReactNativeVersion(): string;
|
|
9
|
+
/** Checks if Expo is present in the runtime */
|
|
10
|
+
export declare function isExpo(): boolean;
|
|
11
|
+
/** Returns Hermes Version if hermes is present in the runtime */
|
|
12
|
+
export declare function getHermesVersion(): string | undefined;
|
|
7
13
|
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAIA,0DAA0D;AAC1D,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED,0DAA0D;AAC1D,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,4DAA4D;AAC5D,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED,oDAAoD;AACpD,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,+CAA+C;AAC/C,wBAAgB,MAAM,IAAI,OAAO,CAEhC;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAMrD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';
|
|
1
2
|
import { RN_GLOBAL_OBJ } from '../utils/worldwide';
|
|
2
3
|
/** Checks if the React Native Hermes engine is running */
|
|
3
4
|
export function isHermesEnabled() {
|
|
@@ -11,4 +12,18 @@ export function isTurboModuleEnabled() {
|
|
|
11
12
|
export function isFabricEnabled() {
|
|
12
13
|
return RN_GLOBAL_OBJ.nativeFabricUIManager != null;
|
|
13
14
|
}
|
|
15
|
+
/** Returns React Native Version as semver string */
|
|
16
|
+
export function getReactNativeVersion() {
|
|
17
|
+
return `${RNV.major}.${RNV.minor}.${RNV.patch}${RNV.prerelease != null ? `-${RNV.prerelease}` : ''}`;
|
|
18
|
+
}
|
|
19
|
+
/** Checks if Expo is present in the runtime */
|
|
20
|
+
export function isExpo() {
|
|
21
|
+
return RN_GLOBAL_OBJ.expo != null;
|
|
22
|
+
}
|
|
23
|
+
/** Returns Hermes Version if hermes is present in the runtime */
|
|
24
|
+
export function getHermesVersion() {
|
|
25
|
+
return (RN_GLOBAL_OBJ.HermesInternal &&
|
|
26
|
+
RN_GLOBAL_OBJ.HermesInternal.getRuntimeProperties &&
|
|
27
|
+
RN_GLOBAL_OBJ.HermesInternal.getRuntimeProperties()['OSS Release Version']);
|
|
28
|
+
}
|
|
14
29
|
//# sourceMappingURL=environment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,0DAA0D;AAC1D,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC;AACxC,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,oBAAoB;IAClC,OAAO,aAAa,CAAC,kBAAkB,IAAI,IAAI,CAAC;AAClD,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,CAAC,qBAAqB,IAAI,IAAI,CAAC;AACrD,CAAC","sourcesContent":["import { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/** Checks if the React Native Hermes engine is running */\nexport function isHermesEnabled(): boolean {\n return !!RN_GLOBAL_OBJ.HermesInternal;\n}\n\n/** Checks if the React Native TurboModules are enabled */\nexport function isTurboModuleEnabled(): boolean {\n return RN_GLOBAL_OBJ.__turboModuleProxy != null;\n}\n\n/** Checks if the React Native Fabric renderer is running */\nexport function isFabricEnabled(): boolean {\n return RN_GLOBAL_OBJ.nativeFabricUIManager != null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,gDAAgD,CAAC;AAEhF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,0DAA0D;AAC1D,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC;AACxC,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,oBAAoB;IAClC,OAAO,aAAa,CAAC,kBAAkB,IAAI,IAAI,CAAC;AAClD,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,CAAC,qBAAqB,IAAI,IAAI,CAAC;AACrD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,qBAAqB;IACnC,OAAO,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACvG,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,MAAM;IACpB,OAAO,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC;AACpC,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CACL,aAAa,CAAC,cAAc;QAC5B,aAAa,CAAC,cAAc,CAAC,oBAAoB;QACjD,aAAa,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC,qBAAqB,CAAC,CAC3E,CAAC;AACJ,CAAC","sourcesContent":["import { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';\n\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/** Checks if the React Native Hermes engine is running */\nexport function isHermesEnabled(): boolean {\n return !!RN_GLOBAL_OBJ.HermesInternal;\n}\n\n/** Checks if the React Native TurboModules are enabled */\nexport function isTurboModuleEnabled(): boolean {\n return RN_GLOBAL_OBJ.__turboModuleProxy != null;\n}\n\n/** Checks if the React Native Fabric renderer is running */\nexport function isFabricEnabled(): boolean {\n return RN_GLOBAL_OBJ.nativeFabricUIManager != null;\n}\n\n/** Returns React Native Version as semver string */\nexport function getReactNativeVersion(): string {\n return `${RNV.major}.${RNV.minor}.${RNV.patch}${RNV.prerelease != null ? `-${RNV.prerelease}` : ''}`;\n}\n\n/** Checks if Expo is present in the runtime */\nexport function isExpo(): boolean {\n return RN_GLOBAL_OBJ.expo != null;\n}\n\n/** Returns Hermes Version if hermes is present in the runtime */\nexport function getHermesVersion(): string | undefined {\n return (\n RN_GLOBAL_OBJ.HermesInternal &&\n RN_GLOBAL_OBJ.HermesInternal.getRuntimeProperties &&\n RN_GLOBAL_OBJ.HermesInternal.getRuntimeProperties()['OSS Release Version']\n );\n}\n"]}
|
|
@@ -4,11 +4,14 @@ import type { ErrorUtils } from 'react-native/types';
|
|
|
4
4
|
export interface ReactNativeInternalGlobal extends InternalGlobal {
|
|
5
5
|
__sentry_rn_v4_registered?: boolean;
|
|
6
6
|
__sentry_rn_v5_registered?: boolean;
|
|
7
|
-
HermesInternal
|
|
7
|
+
HermesInternal?: {
|
|
8
|
+
getRuntimeProperties?: () => Record<string, string | undefined>;
|
|
9
|
+
};
|
|
8
10
|
Promise: unknown;
|
|
9
11
|
__turboModuleProxy: unknown;
|
|
10
12
|
nativeFabricUIManager: unknown;
|
|
11
13
|
ErrorUtils?: ErrorUtils;
|
|
14
|
+
expo: unknown;
|
|
12
15
|
}
|
|
13
16
|
/** Get's the global object for the current JavaScript runtime */
|
|
14
17
|
export declare const RN_GLOBAL_OBJ: ReactNativeInternalGlobal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worldwide.d.ts","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,kFAAkF;AAClF,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"worldwide.d.ts","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,kFAAkF;AAClF,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,cAAc,CAAC,EAAE;QACf,oBAAoB,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KACjE,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,iEAAiE;AACjE,eAAO,MAAM,aAAa,2BAA0C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worldwide.js","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"worldwide.js","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAiB3C,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,UAAuC,CAAC","sourcesContent":["import type { InternalGlobal } from '@sentry/utils';\nimport { GLOBAL_OBJ } from '@sentry/utils';\nimport type { ErrorUtils } from 'react-native/types';\n\n/** Internal Global object interface with common and Sentry specific properties */\nexport interface ReactNativeInternalGlobal extends InternalGlobal {\n __sentry_rn_v4_registered?: boolean;\n __sentry_rn_v5_registered?: boolean;\n HermesInternal?: {\n getRuntimeProperties?: () => Record<string, string | undefined>;\n };\n Promise: unknown;\n __turboModuleProxy: unknown;\n nativeFabricUIManager: unknown;\n ErrorUtils?: ErrorUtils;\n expo: unknown;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nexport const RN_GLOBAL_OBJ = GLOBAL_OBJ as ReactNativeInternalGlobal;\n"]}
|
package/dist/js/version.d.ts
CHANGED
package/dist/js/version.js
CHANGED
package/dist/js/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.5.0';\n"]}
|
package/ios/RNSentry.h
CHANGED
package/ios/RNSentry.mm
CHANGED
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
|
|
31
31
|
static bool didFetchAppStart;
|
|
32
32
|
|
|
33
|
+
static NSString* const nativeSdkName = @"sentry.cocoa.react-native";
|
|
34
|
+
|
|
33
35
|
@implementation RNSentry {
|
|
34
36
|
bool sentHybridSdkDidBecomeActive;
|
|
35
37
|
}
|
|
@@ -56,9 +58,8 @@ RCT_EXPORT_METHOD(initNativeSdk:(NSDictionary *_Nonnull)options
|
|
|
56
58
|
return;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
NSString *sdkName = @"sentry.cocoa.react-native";
|
|
60
61
|
NSString *sdkVersion = [PrivateSentrySDKOnly getSdkVersionString];
|
|
61
|
-
[PrivateSentrySDKOnly setSdkName:
|
|
62
|
+
[PrivateSentrySDKOnly setSdkName: nativeSdkName andVersionString: sdkVersion];
|
|
62
63
|
|
|
63
64
|
[SentrySDK startWithOptions:sentryOptions];
|
|
64
65
|
|
|
@@ -105,6 +106,7 @@ RCT_EXPORT_METHOD(initNativeSdk:(NSDictionary *_Nonnull)options
|
|
|
105
106
|
// The user could tho initialize the SDK manually and set themselves.
|
|
106
107
|
[mutableOptions removeObjectForKey:@"tracesSampleRate"];
|
|
107
108
|
[mutableOptions removeObjectForKey:@"tracesSampler"];
|
|
109
|
+
[mutableOptions removeObjectForKey:@"enableTracing"];
|
|
108
110
|
|
|
109
111
|
SentryOptions *sentryOptions = [[SentryOptions alloc] initWithDict:mutableOptions didFailWithError:errorPointer];
|
|
110
112
|
if (*errorPointer != nil) {
|
|
@@ -137,9 +139,9 @@ RCT_EXPORT_METHOD(initNativeSdk:(NSDictionary *_Nonnull)options
|
|
|
137
139
|
if (event.sdk != nil) {
|
|
138
140
|
NSString *sdkName = event.sdk[@"name"];
|
|
139
141
|
|
|
140
|
-
// If the event is from react native, it gets set
|
|
141
|
-
// it here.
|
|
142
|
-
if ([sdkName
|
|
142
|
+
// If the event is from react native, it gets set
|
|
143
|
+
// there and we do not handle it here.
|
|
144
|
+
if ([sdkName isEqual:nativeSdkName]) {
|
|
143
145
|
[self setEventEnvironmentTag:event origin:@"ios" environment:@"native"];
|
|
144
146
|
}
|
|
145
147
|
}
|
|
@@ -317,7 +319,7 @@ RCT_EXPORT_METHOD(captureEnvelope:(NSArray * _Nonnull)bytes
|
|
|
317
319
|
#if DEBUG
|
|
318
320
|
[PrivateSentrySDKOnly captureEnvelope:envelope];
|
|
319
321
|
#else
|
|
320
|
-
if (options
|
|
322
|
+
if ([[options objectForKey:@"store"] boolValue]) {
|
|
321
323
|
// Storing to disk happens asynchronously with captureEnvelope
|
|
322
324
|
[PrivateSentrySDKOnly storeEnvelope:envelope];
|
|
323
325
|
} else {
|
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.
|
|
5
|
+
"version": "5.5.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",
|
|
@@ -55,18 +55,18 @@
|
|
|
55
55
|
"react-native": ">=0.65.0"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@sentry/browser": "7.
|
|
58
|
+
"@sentry/browser": "7.52.0",
|
|
59
59
|
"@sentry/cli": "2.17.5",
|
|
60
|
-
"@sentry/core": "7.
|
|
61
|
-
"@sentry/hub": "7.
|
|
62
|
-
"@sentry/integrations": "7.
|
|
63
|
-
"@sentry/react": "7.
|
|
64
|
-
"@sentry/types": "7.
|
|
65
|
-
"@sentry/utils": "7.
|
|
60
|
+
"@sentry/core": "7.52.0",
|
|
61
|
+
"@sentry/hub": "7.52.0",
|
|
62
|
+
"@sentry/integrations": "7.52.0",
|
|
63
|
+
"@sentry/react": "7.52.0",
|
|
64
|
+
"@sentry/types": "7.52.0",
|
|
65
|
+
"@sentry/utils": "7.52.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@sentry-internal/eslint-config-sdk": "7.
|
|
69
|
-
"@sentry-internal/eslint-plugin-sdk": "7.
|
|
68
|
+
"@sentry-internal/eslint-config-sdk": "7.52.0",
|
|
69
|
+
"@sentry-internal/eslint-plugin-sdk": "7.52.0",
|
|
70
70
|
"@sentry/typescript": "^5.20.1",
|
|
71
71
|
"@sentry/wizard": "3.0.0",
|
|
72
72
|
"@types/jest": "^29.2.5",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"jest-environment-jsdom": "^29.4.1",
|
|
81
81
|
"prettier": "^2.0.5",
|
|
82
82
|
"react": "18.2.0",
|
|
83
|
-
"react-native": "0.71.
|
|
83
|
+
"react-native": "0.71.7",
|
|
84
84
|
"replace-in-file": "^6.0.0",
|
|
85
85
|
"rimraf": "^4.1.1",
|
|
86
86
|
"ts-jest": "^29.0.5",
|
|
@@ -3,6 +3,9 @@ export interface ReactNativeContext extends Context {
|
|
|
3
3
|
js_engine?: string;
|
|
4
4
|
turbo_module: boolean;
|
|
5
5
|
fabric: boolean;
|
|
6
|
+
expo: boolean;
|
|
7
|
+
hermes_version?: string;
|
|
8
|
+
react_native_version: string;
|
|
6
9
|
component_stack?: string;
|
|
7
10
|
}
|
|
8
11
|
/** Loads React Native context at runtime */
|
|
@@ -4,4 +4,10 @@ export declare function isHermesEnabled(): boolean;
|
|
|
4
4
|
export declare function isTurboModuleEnabled(): boolean;
|
|
5
5
|
/** Checks if the React Native Fabric renderer is running */
|
|
6
6
|
export declare function isFabricEnabled(): boolean;
|
|
7
|
+
/** Returns React Native Version as semver string */
|
|
8
|
+
export declare function getReactNativeVersion(): string;
|
|
9
|
+
/** Checks if Expo is present in the runtime */
|
|
10
|
+
export declare function isExpo(): boolean;
|
|
11
|
+
/** Returns Hermes Version if hermes is present in the runtime */
|
|
12
|
+
export declare function getHermesVersion(): string | undefined;
|
|
7
13
|
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -4,11 +4,14 @@ import type { ErrorUtils } from 'react-native/types';
|
|
|
4
4
|
export interface ReactNativeInternalGlobal extends InternalGlobal {
|
|
5
5
|
__sentry_rn_v4_registered?: boolean;
|
|
6
6
|
__sentry_rn_v5_registered?: boolean;
|
|
7
|
-
HermesInternal
|
|
7
|
+
HermesInternal?: {
|
|
8
|
+
getRuntimeProperties?: () => Record<string, string | undefined>;
|
|
9
|
+
};
|
|
8
10
|
Promise: unknown;
|
|
9
11
|
__turboModuleProxy: unknown;
|
|
10
12
|
nativeFabricUIManager: unknown;
|
|
11
13
|
ErrorUtils?: ErrorUtils;
|
|
14
|
+
expo: unknown;
|
|
12
15
|
}
|
|
13
16
|
/** Get's the global object for the current JavaScript runtime */
|
|
14
17
|
export declare const RN_GLOBAL_OBJ: ReactNativeInternalGlobal;
|