@sentry/react-native 5.15.1 → 5.16.0-alpha.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/CHANGELOG.md +68 -0
- package/app.plugin.js +1 -0
- package/dist/js/NativeRNSentry.d.ts +1 -1
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/index.js +1 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +12 -10
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +9 -6
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/reactnativeinfo.d.ts +1 -1
- package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeinfo.js.map +1 -1
- package/dist/js/measurements.d.ts +0 -7
- package/dist/js/measurements.d.ts.map +1 -1
- package/dist/js/measurements.js +0 -56
- package/dist/js/measurements.js.map +1 -1
- package/dist/js/profiling/constants.d.ts +2 -0
- package/dist/js/profiling/constants.d.ts.map +1 -0
- package/dist/js/profiling/constants.js +2 -0
- package/dist/js/profiling/constants.js.map +1 -0
- package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
- package/dist/js/profiling/convertHermesProfile.js +1 -1
- package/dist/js/profiling/convertHermesProfile.js.map +1 -1
- package/dist/js/profiling/integration.d.ts +0 -1
- package/dist/js/profiling/integration.d.ts.map +1 -1
- package/dist/js/profiling/integration.js +1 -1
- package/dist/js/profiling/integration.js.map +1 -1
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +9 -8
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.d.ts +7 -0
- package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.js +27 -1
- package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
- package/dist/js/touchevents.js +5 -8
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/tracing/addTracingExtensions.d.ts +8 -0
- package/dist/js/tracing/addTracingExtensions.d.ts.map +1 -0
- package/dist/js/tracing/addTracingExtensions.js +58 -0
- package/dist/js/tracing/addTracingExtensions.js.map +1 -0
- package/dist/js/tracing/reactnativenavigation.d.ts +1 -1
- package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnativenavigation.js.map +1 -1
- package/dist/js/utils/environment.d.ts +1 -1
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js +5 -1
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/utils/rnlibraries.d.ts +3 -0
- package/dist/js/utils/rnlibraries.d.ts.map +1 -0
- package/dist/js/utils/rnlibraries.js +29 -0
- package/dist/js/utils/rnlibraries.js.map +1 -0
- package/dist/js/utils/rnlibraries.web.d.ts +3 -0
- package/dist/js/utils/rnlibraries.web.d.ts.map +1 -0
- package/dist/js/utils/rnlibraries.web.js +2 -0
- package/dist/js/utils/rnlibraries.web.js.map +1 -0
- package/dist/js/utils/rnlibrariesinterface.d.ts +19 -0
- package/dist/js/utils/rnlibrariesinterface.d.ts.map +1 -0
- package/dist/js/utils/rnlibrariesinterface.js +8 -0
- package/dist/js/utils/rnlibrariesinterface.js.map +1 -0
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/expo.d.ts +1 -0
- package/expo.js +1 -0
- package/package.json +20 -6
- package/plugin/build/index.d.ts +3 -0
- package/plugin/build/index.js +6 -0
- package/plugin/build/utils.d.ts +7 -0
- package/plugin/build/utils.js +39 -0
- package/plugin/build/withSentry.d.ts +10 -0
- package/plugin/build/withSentry.js +50 -0
- package/plugin/build/withSentryAndroid.d.ts +7 -0
- package/plugin/build/withSentryAndroid.js +68 -0
- package/plugin/build/withSentryIOS.d.ts +8 -0
- package/plugin/build/withSentryIOS.js +71 -0
- package/scripts/sentry-xcode-debug-files.sh +5 -1
- package/scripts/sentry-xcode.sh +7 -2
- package/src/js/NativeRNSentry.ts +2 -1
- package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -1
- package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +1 -1
- package/ts3.8/dist/js/measurements.d.ts +0 -7
- package/ts3.8/dist/js/profiling/constants.d.ts +2 -0
- package/ts3.8/dist/js/profiling/integration.d.ts +0 -1
- package/ts3.8/dist/js/tracing/addTracingExtensions.d.ts +8 -0
- package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +1 -1
- package/ts3.8/dist/js/utils/environment.d.ts +1 -1
- package/ts3.8/dist/js/utils/rnlibraries.d.ts +3 -0
- package/ts3.8/dist/js/utils/rnlibraries.web.d.ts +3 -0
- package/ts3.8/dist/js/utils/rnlibrariesinterface.d.ts +19 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.addSentryWithBundledScriptsToBundleShellScript = exports.modifyExistingXcodeBuildScript = exports.withSentryIOS = void 0;
|
|
27
|
+
const config_plugins_1 = require("expo/config-plugins");
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const utils_1 = require("./utils");
|
|
30
|
+
const SENTRY_REACT_NATIVE_XCODE_PATH = "`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('@sentry/react-native/package.json')) + '/scripts/sentry-xcode.sh'\"`";
|
|
31
|
+
const SENTRY_REACT_NATIVE_XCODE_DEBUG_FILES_PATH = "`${NODE_BINARY:-node} --print \"require('path').dirname(require.resolve('@sentry/react-native/package.json')) + '/scripts/sentry-xcode-debug-files.sh'\"`";
|
|
32
|
+
const withSentryIOS = (config, sentryProperties) => {
|
|
33
|
+
const cfg = (0, config_plugins_1.withXcodeProject)(config, config => {
|
|
34
|
+
const xcodeProject = config.modResults;
|
|
35
|
+
const sentryBuildPhase = xcodeProject.pbxItemByComment('Upload Debug Symbols to Sentry', 'PBXShellScriptBuildPhase');
|
|
36
|
+
if (!sentryBuildPhase) {
|
|
37
|
+
xcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Upload Debug Symbols to Sentry', null, {
|
|
38
|
+
shellPath: '/bin/sh',
|
|
39
|
+
shellScript: `/bin/sh ${SENTRY_REACT_NATIVE_XCODE_DEBUG_FILES_PATH}`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const bundleReactNativePhase = xcodeProject.pbxItemByComment('Bundle React Native code and images', 'PBXShellScriptBuildPhase');
|
|
43
|
+
modifyExistingXcodeBuildScript(bundleReactNativePhase);
|
|
44
|
+
return config;
|
|
45
|
+
});
|
|
46
|
+
return (0, config_plugins_1.withDangerousMod)(cfg, [
|
|
47
|
+
'ios',
|
|
48
|
+
config => {
|
|
49
|
+
(0, utils_1.writeSentryPropertiesTo)(path.resolve(config.modRequest.projectRoot, 'ios'), sentryProperties);
|
|
50
|
+
return config;
|
|
51
|
+
},
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
exports.withSentryIOS = withSentryIOS;
|
|
55
|
+
function modifyExistingXcodeBuildScript(script) {
|
|
56
|
+
if (!script.shellScript.match(/(packager|scripts)\/react-native-xcode\.sh\b/) ||
|
|
57
|
+
script.shellScript.includes('sentry-xcode.sh') ||
|
|
58
|
+
script.shellScript.includes('@sentry')) {
|
|
59
|
+
config_plugins_1.WarningAggregator.addWarningIOS(utils_1.SDK_PACKAGE_NAME, "Unable to modify build script 'Bundle React Native code and images'. Please open a bug report at https://github.com/expo/sentry-expo.");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const code = JSON.parse(script.shellScript);
|
|
63
|
+
script.shellScript = JSON.stringify(addSentryWithBundledScriptsToBundleShellScript(code));
|
|
64
|
+
}
|
|
65
|
+
exports.modifyExistingXcodeBuildScript = modifyExistingXcodeBuildScript;
|
|
66
|
+
function addSentryWithBundledScriptsToBundleShellScript(script) {
|
|
67
|
+
return script.replace(/^.*?(packager|scripts)\/react-native-xcode\.sh\s*(\\'\\\\")?/m,
|
|
68
|
+
// eslint-disable-next-line no-useless-escape
|
|
69
|
+
(match) => `/bin/sh ${SENTRY_REACT_NATIVE_XCODE_PATH} ${match}`);
|
|
70
|
+
}
|
|
71
|
+
exports.addSentryWithBundledScriptsToBundleShellScript = addSentryWithBundledScriptsToBundleShellScript;
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
# print commands before executing them and stop on first error
|
|
6
6
|
set -x -e
|
|
7
7
|
|
|
8
|
+
LOCAL_NODE_BINARY=${NODE_BINARY:-node}
|
|
9
|
+
|
|
8
10
|
# load envs if loader file exists (since rn 0.68)
|
|
9
11
|
WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
|
|
10
12
|
if [ -f "$WITH_ENVIRONMENT" ]; then
|
|
@@ -12,7 +14,9 @@ if [ -f "$WITH_ENVIRONMENT" ]; then
|
|
|
12
14
|
fi
|
|
13
15
|
|
|
14
16
|
[ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
|
|
15
|
-
|
|
17
|
+
|
|
18
|
+
[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/cli/package.json'))")
|
|
19
|
+
[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="${SENTRY_CLI_PACKAGE_PATH}/bin/sentry-cli"
|
|
16
20
|
|
|
17
21
|
[[ $SENTRY_INCLUDE_NATIVE_SOURCES == "true" ]] && INCLUDE_SOURCES_FLAG="--include-sources" || INCLUDE_SOURCES_FLAG=""
|
|
18
22
|
|
package/scripts/sentry-xcode.sh
CHANGED
|
@@ -7,9 +7,13 @@ set -x -e
|
|
|
7
7
|
|
|
8
8
|
# WITH_ENVIRONMENT is executed by React Native
|
|
9
9
|
|
|
10
|
+
LOCAL_NODE_BINARY=${NODE_BINARY:-node}
|
|
11
|
+
|
|
10
12
|
[ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
|
|
11
13
|
[ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"
|
|
12
|
-
|
|
14
|
+
|
|
15
|
+
[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/cli/package.json'))")
|
|
16
|
+
[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="${SENTRY_CLI_PACKAGE_PATH}/bin/sentry-cli"
|
|
13
17
|
|
|
14
18
|
REACT_NATIVE_XCODE=$1
|
|
15
19
|
|
|
@@ -25,7 +29,8 @@ else
|
|
|
25
29
|
/bin/sh -c "$REACT_NATIVE_XCODE"
|
|
26
30
|
fi
|
|
27
31
|
|
|
28
|
-
[ -z "$SENTRY_COLLECT_MODULES" ] &&
|
|
32
|
+
[ -z "$SENTRY_COLLECT_MODULES" ] && SENTRY_RN_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/react-native/package.json'))")
|
|
33
|
+
[ -z "$SENTRY_COLLECT_MODULES" ] && SENTRY_COLLECT_MODULES="${SENTRY_RN_PACKAGE_PATH}/scripts/collect-modules.sh"
|
|
29
34
|
|
|
30
35
|
if [ -f "$SENTRY_COLLECT_MODULES" ]; then
|
|
31
36
|
/bin/sh "$SENTRY_COLLECT_MODULES"
|
package/src/js/NativeRNSentry.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Package } from '@sentry/types';
|
|
2
2
|
import type { TurboModule } from 'react-native';
|
|
3
3
|
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import type { UnsafeObject } from './utils/rnlibrariesinterface';
|
|
5
6
|
|
|
6
7
|
// There has to be only one interface and it has to be named `Spec`
|
|
7
8
|
// Only extra allowed definitions are types (probably codegen bug)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Package } from '@sentry/types';
|
|
2
2
|
import type { TurboModule } from 'react-native';
|
|
3
|
-
import type { UnsafeObject } from '
|
|
3
|
+
import type { UnsafeObject } from './utils/rnlibrariesinterface';
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
5
|
addBreadcrumb(breadcrumb: UnsafeObject): void;
|
|
6
6
|
captureEnvelope(bytes: string, options: {
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import type { Hub, Transaction } from '@sentry/core';
|
|
2
|
-
import type { CustomSamplingContext, TransactionContext } from '@sentry/types';
|
|
3
1
|
export declare const APP_START_WARM = "app_start_warm";
|
|
4
2
|
export declare const APP_START_COLD = "app_start_cold";
|
|
5
3
|
export declare const STALL_COUNT = "stall_count";
|
|
6
4
|
export declare const STALL_TOTAL_TIME = "stall_total_time";
|
|
7
5
|
export declare const STALL_LONGEST_TIME = "stall_longest_time";
|
|
8
|
-
/**
|
|
9
|
-
* Adds React Native's extensions. Needs to be called before any transactions are created.
|
|
10
|
-
*/
|
|
11
|
-
export declare function _addTracingExtensions(): void;
|
|
12
|
-
export type StartTransactionFunction = (this: Hub, transactionContext: TransactionContext, customSamplingContext?: CustomSamplingContext) => Transaction;
|
|
13
6
|
//# sourceMappingURL=measurements.d.ts.map
|
|
@@ -2,7 +2,6 @@ import type { Hub } from '@sentry/core';
|
|
|
2
2
|
import type { EventProcessor, Integration, ThreadCpuProfile } from '@sentry/types';
|
|
3
3
|
import type { NativeProfileEvent } from './nativeTypes';
|
|
4
4
|
import type { CombinedProfileEvent, HermesProfileEvent } from './types';
|
|
5
|
-
export declare const MAX_PROFILE_DURATION_MS: number;
|
|
6
5
|
/**
|
|
7
6
|
* Profiling integration creates a profile for each transaction and adds it to the event envelope.
|
|
8
7
|
*
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Hub, Transaction } from '@sentry/core';
|
|
2
|
+
import type { CustomSamplingContext, TransactionContext } from '@sentry/types';
|
|
3
|
+
/**
|
|
4
|
+
* Adds React Native's extensions. Needs to be called before any transactions are created.
|
|
5
|
+
*/
|
|
6
|
+
export declare function _addTracingExtensions(): void;
|
|
7
|
+
export type StartTransactionFunction = (this: Hub, transactionContext: TransactionContext, customSamplingContext?: CustomSamplingContext) => Transaction;
|
|
8
|
+
//# sourceMappingURL=addTracingExtensions.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EmitterSubscription } from '
|
|
1
|
+
import type { EmitterSubscription } from '../utils/rnlibrariesinterface';
|
|
2
2
|
import type { OnConfirmRoute, TransactionCreator } from './routingInstrumentation';
|
|
3
3
|
import { InternalRoutingInstrumentation } from './routingInstrumentation';
|
|
4
4
|
import type { BeforeNavigate } from './types';
|
|
@@ -5,7 +5,7 @@ export declare function isTurboModuleEnabled(): boolean;
|
|
|
5
5
|
/** Checks if the React Native Fabric renderer is running */
|
|
6
6
|
export declare function isFabricEnabled(): boolean;
|
|
7
7
|
/** Returns React Native Version as semver string */
|
|
8
|
-
export declare function getReactNativeVersion(): string;
|
|
8
|
+
export declare function getReactNativeVersion(): string | undefined;
|
|
9
9
|
/** Checks if Expo is present in the runtime */
|
|
10
10
|
export declare function isExpo(): boolean;
|
|
11
11
|
/** Returns Hermes Version if hermes is present in the runtime */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';
|
|
2
|
+
import type * as ReactNative from '../vendor/react-native';
|
|
3
|
+
export type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
export type { EmitterSubscription } from 'react-native/Libraries/vendor/emitter/EventEmitter';
|
|
5
|
+
export interface ReactNativeLibrariesInterface {
|
|
6
|
+
Devtools?: {
|
|
7
|
+
parseErrorStack: (errorStack: string) => Array<ReactNative.StackFrame>;
|
|
8
|
+
symbolicateStackTrace: (stack: Array<ReactNative.StackFrame>, extraData?: Record<string, unknown>) => Promise<ReactNative.SymbolicatedStackTrace>;
|
|
9
|
+
getDevServer: () => ReactNative.DevServerInfo;
|
|
10
|
+
};
|
|
11
|
+
Utilities?: {
|
|
12
|
+
polyfillGlobal: <T>(name: string, getValue: () => T) => void;
|
|
13
|
+
};
|
|
14
|
+
Promise?: typeof Promise;
|
|
15
|
+
ReactNativeVersion?: {
|
|
16
|
+
version: typeof RNV;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=rnlibrariesinterface.d.ts.map
|
|
@@ -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.
|
|
3
|
+
export declare const SDK_VERSION = "5.16.0-alpha.2";
|
|
4
4
|
//# sourceMappingURL=version.d.ts.map
|