@sentry/react-native 5.3.0 → 5.3.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.
- package/CHANGELOG.md +23 -0
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +13 -0
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/breadcrumb.d.ts.map +1 -1
- package/dist/js/breadcrumb.js.map +1 -1
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +4 -5
- package/dist/js/client.js.map +1 -1
- package/dist/js/index.d.ts +1 -2
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +1 -5
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +1 -3
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/devicecontext.d.ts.map +1 -1
- package/dist/js/integrations/devicecontext.js +2 -4
- package/dist/js/integrations/devicecontext.js.map +1 -1
- package/dist/js/integrations/eventorigin.js +1 -1
- package/dist/js/integrations/eventorigin.js.map +1 -1
- package/dist/js/integrations/factory.d.ts.map +1 -1
- package/dist/js/integrations/factory.js +3 -1
- package/dist/js/integrations/factory.js.map +1 -1
- package/dist/js/integrations/modulesloader.d.ts.map +1 -1
- package/dist/js/integrations/modulesloader.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +2 -2
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeinfo.js +1 -2
- package/dist/js/integrations/reactnativeinfo.js.map +1 -1
- package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
- package/dist/js/integrations/rewriteframes.js +2 -5
- package/dist/js/integrations/rewriteframes.js.map +1 -1
- package/dist/js/integrations/screenshot.d.ts.map +1 -1
- package/dist/js/integrations/screenshot.js +2 -6
- package/dist/js/integrations/screenshot.js.map +1 -1
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/integrations/viewhierarchy.js.map +1 -1
- package/dist/js/measurements.d.ts +2 -3
- package/dist/js/measurements.d.ts.map +1 -1
- package/dist/js/measurements.js +5 -8
- package/dist/js/measurements.js.map +1 -1
- package/dist/js/misc.d.ts.map +1 -1
- package/dist/js/misc.js +1 -3
- package/dist/js/misc.js.map +1 -1
- package/dist/js/options.d.ts +6 -6
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/scope.d.ts +2 -2
- package/dist/js/scope.d.ts.map +1 -1
- package/dist/js/scope.js +4 -4
- package/dist/js/scope.js.map +1 -1
- package/dist/js/tools/ModulesCollector.d.ts.map +1 -1
- package/dist/js/tools/ModulesCollector.js +3 -7
- package/dist/js/tools/ModulesCollector.js.map +1 -1
- package/dist/js/tools/collectModules.js +1 -3
- package/dist/js/tools/collectModules.js.map +1 -1
- package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
- package/dist/js/tracing/gesturetracing.js +4 -2
- package/dist/js/tracing/gesturetracing.js.map +1 -1
- package/dist/js/tracing/index.d.ts +3 -3
- package/dist/js/tracing/index.d.ts.map +1 -1
- package/dist/js/tracing/index.js +2 -2
- package/dist/js/tracing/index.js.map +1 -1
- package/dist/js/tracing/nativeframes.d.ts +4 -4
- package/dist/js/tracing/nativeframes.d.ts.map +1 -1
- package/dist/js/tracing/nativeframes.js +15 -15
- package/dist/js/tracing/nativeframes.js.map +1 -1
- package/dist/js/tracing/ops.d.ts.map +1 -1
- package/dist/js/tracing/ops.js.map +1 -1
- package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnativenavigation.js +4 -11
- package/dist/js/tracing/reactnativenavigation.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts +2 -2
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +20 -16
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigationv4.js +1 -2
- package/dist/js/tracing/reactnavigationv4.js.map +1 -1
- package/dist/js/tracing/routingInstrumentation.d.ts.map +1 -1
- package/dist/js/tracing/routingInstrumentation.js.map +1 -1
- package/dist/js/tracing/stalltracking.d.ts +1 -1
- package/dist/js/tracing/stalltracking.d.ts.map +1 -1
- package/dist/js/tracing/stalltracking.js +9 -17
- package/dist/js/tracing/stalltracking.js.map +1 -1
- package/dist/js/tracing/transaction.d.ts.map +1 -1
- package/dist/js/tracing/transaction.js +2 -1
- package/dist/js/tracing/transaction.js.map +1 -1
- package/dist/js/tracing/types.d.ts.map +1 -1
- package/dist/js/tracing/types.js.map +1 -1
- package/dist/js/tracing/utils.d.ts +1 -1
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/transports/TextEncoder.d.ts.map +1 -1
- package/dist/js/transports/TextEncoder.js.map +1 -1
- package/dist/js/transports/native.d.ts +1 -1
- package/dist/js/transports/native.d.ts.map +1 -1
- package/dist/js/transports/native.js +1 -1
- package/dist/js/transports/native.js.map +1 -1
- package/dist/js/user.d.ts.map +1 -1
- package/dist/js/user.js.map +1 -1
- package/dist/js/utils/envelope.d.ts.map +1 -1
- package/dist/js/utils/envelope.js +5 -2
- package/dist/js/utils/envelope.js.map +1 -1
- package/dist/js/utils/outcome.js +1 -1
- package/dist/js/utils/outcome.js.map +1 -1
- package/dist/js/utils/safe.d.ts.map +1 -1
- package/dist/js/utils/safe.js +1 -3
- package/dist/js/utils/safe.js.map +1 -1
- package/dist/js/vendor/buffer/index.d.ts +1 -1
- package/dist/js/vendor/buffer/index.d.ts.map +1 -1
- package/dist/js/vendor/buffer/index.js +1 -1
- package/dist/js/vendor/buffer/index.js.map +1 -1
- package/dist/js/vendor/buffer/utf8ToBytes.d.ts +0 -5
- package/dist/js/vendor/buffer/utf8ToBytes.d.ts.map +1 -1
- package/dist/js/vendor/buffer/utf8ToBytes.js +29 -16
- package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -1
- package/dist/js/vendor/index.d.ts +1 -1
- package/dist/js/vendor/index.d.ts.map +1 -1
- package/dist/js/vendor/index.js +1 -1
- package/dist/js/vendor/index.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/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +7 -17
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.mm +6 -3
- package/package.json +18 -13
- package/sentry.gradle +12 -7
- package/src/js/NativeRNSentry.ts +4 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAU9F,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAA5B;QAME;;WAEG;QACI,SAAI,GAAW,eAAe,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAU9F,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAA5B;QAME;;WAEG;QACI,SAAI,GAAW,eAAe,CAAC,EAAE,CAAC;IAuC3C,CAAC;IArCC;;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;aAC1B,CAAC;YAEF,IAAI,eAAe,EAAE,EAAE;gBACrB,kBAAkB,CAAC,SAAS,GAAG,QAAQ,CAAC;aACzC;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;;AA9CD;;GAEG;AACW,kBAAE,GAAW,iBAAiB,CAAC","sourcesContent":["import type { Context, Event, EventHint, EventProcessor, Integration } from '@sentry/types';\n\nimport { isFabricEnabled, isHermesEnabled, isTurboModuleEnabled } 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 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 };\n\n if (isHermesEnabled()) {\n reactNativeContext.js_engine = 'hermes';\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewriteframes.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,aAAa,
|
|
1
|
+
{"version":3,"file":"rewriteframes.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,aAAa,CAoB9D"}
|
|
@@ -12,14 +12,11 @@ export function createReactNativeRewriteFrames() {
|
|
|
12
12
|
.replace(/^file:\/\//, '')
|
|
13
13
|
.replace(/^address at /, '')
|
|
14
14
|
.replace(/^.*\/[^.]+(\.app|CodePush|.*(?=\/))/, '');
|
|
15
|
-
if (frame.filename !== '[native code]' &&
|
|
16
|
-
frame.filename !== 'native') {
|
|
15
|
+
if (frame.filename !== '[native code]' && frame.filename !== 'native') {
|
|
17
16
|
const appPrefix = 'app://';
|
|
18
17
|
// We always want to have a triple slash
|
|
19
18
|
frame.filename =
|
|
20
|
-
frame.filename.indexOf('/') === 0
|
|
21
|
-
? `${appPrefix}${frame.filename}`
|
|
22
|
-
: `${appPrefix}/${frame.filename}`;
|
|
19
|
+
frame.filename.indexOf('/') === 0 ? `${appPrefix}${frame.filename}` : `${appPrefix}/${frame.filename}`;
|
|
23
20
|
}
|
|
24
21
|
delete frame.abs_path;
|
|
25
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewriteframes.js","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,IAAI,aAAa,CAAC;QACvB,QAAQ,EAAE,CAAC,KAAiB,EAAE,EAAE;YAC9B,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ;qBAC5B,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;qBACzB,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;qBAC3B,OAAO,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAC;gBAEtD,
|
|
1
|
+
{"version":3,"file":"rewriteframes.js","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,IAAI,aAAa,CAAC;QACvB,QAAQ,EAAE,CAAC,KAAiB,EAAE,EAAE;YAC9B,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ;qBAC5B,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;qBACzB,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;qBAC3B,OAAO,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAC;gBAEtD,IAAI,KAAK,CAAC,QAAQ,KAAK,eAAe,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE;oBACrE,MAAM,SAAS,GAAG,QAAQ,CAAC;oBAC3B,wCAAwC;oBACxC,KAAK,CAAC,QAAQ;wBACZ,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;iBAC1G;gBACD,OAAO,KAAK,CAAC,QAAQ,CAAC;aACvB;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { RewriteFrames } from '@sentry/integrations';\nimport type { StackFrame } from '@sentry/types';\n\n/**\n * Creates React Native default rewrite frames integration\n * which appends app:// to the beginning of the filename\n * and removes file://, 'address at' prefixes and CodePush postfix.\n */\nexport function createReactNativeRewriteFrames(): RewriteFrames {\n return new RewriteFrames({\n iteratee: (frame: StackFrame) => {\n if (frame.filename) {\n frame.filename = frame.filename\n .replace(/^file:\\/\\//, '')\n .replace(/^address at /, '')\n .replace(/^.*\\/[^.]+(\\.app|CodePush|.*(?=\\/))/, '');\n\n if (frame.filename !== '[native code]' && frame.filename !== 'native') {\n const appPrefix = 'app://';\n // We always want to have a triple slash\n frame.filename =\n frame.filename.indexOf('/') === 0 ? `${appPrefix}${frame.filename}` : `${appPrefix}/${frame.filename}`;\n }\n delete frame.abs_path;\n }\n return frame;\n },\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5D,uCAAuC;AACvC,qBAAa,UAAW,YAAW,WAAW;IAC5C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAgB;IAExC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAiB;IAEpC;;OAEG;WACW,2BAA2B,CACvC,IAAI,EAAE,SAAS,EACf,EAAE,gBAAgB,EAAE,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,GACnD,WAAW,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5D,uCAAuC;AACvC,qBAAa,UAAW,YAAW,WAAW;IAC5C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAgB;IAExC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAiB;IAEpC;;OAEG;WACW,2BAA2B,CACvC,IAAI,EAAE,SAAS,EACf,EAAE,gBAAgB,EAAE,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,GACnD,WAAW,CAAC,SAAS,CAAC;IAazB;;OAEG;IAEI,SAAS,IAAI,IAAI;CACzB"}
|
|
@@ -15,13 +15,9 @@ export class Screenshot {
|
|
|
15
15
|
if (!attachScreenshot) {
|
|
16
16
|
return resolvedSyncPromise(hint);
|
|
17
17
|
}
|
|
18
|
-
return NATIVE.captureScreenshot()
|
|
19
|
-
.then((screenshots) => {
|
|
18
|
+
return NATIVE.captureScreenshot().then(screenshots => {
|
|
20
19
|
if (screenshots !== null && screenshots.length > 0) {
|
|
21
|
-
hint.attachments = [
|
|
22
|
-
...screenshots,
|
|
23
|
-
...((hint === null || hint === void 0 ? void 0 : hint.attachments) || []),
|
|
24
|
-
];
|
|
20
|
+
hint.attachments = [...screenshots, ...((hint === null || hint === void 0 ? void 0 : hint.attachments) || [])];
|
|
25
21
|
}
|
|
26
22
|
return hint;
|
|
27
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,uCAAuC;AACvC,MAAM,OAAO,UAAU;IAAvB;QAME;;WAEG;QACI,SAAI,GAAW,UAAU,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,uCAAuC;AACvC,MAAM,OAAO,UAAU;IAAvB;QAME;;WAEG;QACI,SAAI,GAAW,UAAU,CAAC,EAAE,CAAC;IA0BtC,CAAC;IAxBC;;OAEG;IACI,MAAM,CAAC,2BAA2B,CACvC,IAAe,EACf,EAAE,gBAAgB,EAAkC;QAEpD,IAAI,CAAC,gBAAgB,EAAE;YACrB,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;SAClC;QAED,OAAO,MAAM,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;YACnD,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;gBAClD,IAAI,CAAC,WAAW,GAAG,CAAC,GAAG,WAAW,EAAE,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC,CAAC,CAAC;aACnE;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,gEAAgE;IACzD,SAAS,KAAU,CAAC;;AAjC3B;;GAEG;AACW,aAAE,GAAW,YAAY,CAAC","sourcesContent":["import type { EventHint, Integration } from '@sentry/types';\nimport { resolvedSyncPromise } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\n/** Adds screenshots to error events */\nexport class Screenshot implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Screenshot';\n\n /**\n * @inheritDoc\n */\n public name: string = Screenshot.id;\n\n /**\n * If enabled attaches a screenshot to the event hint.\n */\n public static attachScreenshotToEventHint(\n hint: EventHint,\n { attachScreenshot }: { attachScreenshot?: boolean },\n ): PromiseLike<EventHint> {\n if (!attachScreenshot) {\n return resolvedSyncPromise(hint);\n }\n\n return NATIVE.captureScreenshot().then(screenshots => {\n if (screenshots !== null && screenshots.length > 0) {\n hint.attachments = [...screenshots, ...(hint?.attachments || [])];\n }\n return hint;\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public setupOnce(): void {}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAA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iBAC1D,GACF,CAAC;YAEF,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AA3CD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC","sourcesContent":["import type { EventProcessor, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport class SdkInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'SdkInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = SdkInfo.id;\n\n private _nativeSdkInfo: Package | null = null;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async event => {\n // The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.\n // this._nativeSdkInfo should be defined a following time so this call won't always be awaited.\n if (NATIVE.platform === 'ios' && this._nativeSdkInfo === null) {\n try {\n this._nativeSdkInfo = await NATIVE.fetchNativeSdkInfo();\n } catch (e) {\n // If this fails, go ahead as usual as we would rather have the event be sent with a package missing.\n logger.warn(\n '[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:',\n );\n logger.warn(e);\n }\n }\n\n event.platform = event.platform || 'javascript';\n event.sdk = {\n ...(event.sdk ?? {}),\n ...defaultSdkInfo,\n packages: [\n ...((event.sdk && event.sdk.packages) || []),\n ...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),\n ],\n };\n\n return event;\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,yCAAyC;AACzC,MAAM,OAAO,aAAa;IAA1B;QAUE;;WAEG;QACI,SAAI,GAAW,aAAa,CAAC,EAAE,CAAC;IAkCzC,CAAC;IAhCC;;OAEG;IACI,SAAS,CAAC,uBAAoD;QACnE,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAe,EAAE,EAAE;YAC9D,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;YACpG,IAAI,CAAC,YAAY,EAAE;gBACjB,OAAO,KAAK,CAAC;aACd;YAED,IAAI,aAAa,GAAsB,IAAI,CAAC;YAC5C,IAAI;gBACF,aAAa,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,yCAAyC;AACzC,MAAM,OAAO,aAAa;IAA1B;QAUE;;WAEG;QACI,SAAI,GAAW,aAAa,CAAC,EAAE,CAAC;IAkCzC,CAAC;IAhCC;;OAEG;IACI,SAAS,CAAC,uBAAoD;QACnE,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAe,EAAE,EAAE;YAC9D,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;YACpG,IAAI,CAAC,YAAY,EAAE;gBACjB,OAAO,KAAK,CAAC;aACd;YAED,IAAI,aAAa,GAAsB,IAAI,CAAC;YAC5C,IAAI;gBACF,aAAa,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;aACnD;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,CAAC,CAAC,CAAC;aAC9D;YAED,IAAI,aAAa,EAAE;gBACjB,IAAI,CAAC,WAAW,GAAG;oBACjB;wBACE,QAAQ,EAAE,aAAa,CAAC,SAAS;wBACjC,WAAW,EAAE,aAAa,CAAC,YAAY;wBACvC,cAAc,EAAE,aAAa,CAAC,eAAe;wBAC7C,IAAI,EAAE,aAAa;qBACpB;oBACD,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC;iBAC7B,CAAC;aACH;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AA7CD;;GAEG;AACW,gBAAE,GAAW,eAAe,CAAC;AAE5B,uBAAS,GAAW,qBAAqB,CAAC;AAC1C,0BAAY,GAAW,kBAAkB,CAAC;AAC1C,6BAAe,GAAW,sBAAsB,CAAC","sourcesContent":["import type { Event, EventHint, EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\n/** Adds ViewHierarchy to error events */\nexport class ViewHierarchy implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ViewHierarchy';\n\n private static _fileName: string = 'view-hierarchy.json';\n private static _contentType: string = 'application/json';\n private static _attachmentType: string = 'event.view_hierarchy';\n\n /**\n * @inheritDoc\n */\n public name: string = ViewHierarchy.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event: Event, hint: EventHint) => {\n const hasException = event.exception && event.exception.values && event.exception.values.length > 0;\n if (!hasException) {\n return event;\n }\n\n let viewHierarchy: Uint8Array | null = null;\n try {\n viewHierarchy = await NATIVE.fetchViewHierarchy();\n } catch (e) {\n logger.error('Failed to get view hierarchy from native.', e);\n }\n\n if (viewHierarchy) {\n hint.attachments = [\n {\n filename: ViewHierarchy._fileName,\n contentType: ViewHierarchy._contentType,\n attachmentType: ViewHierarchy._attachmentType,\n data: viewHierarchy,\n },\n ...(hint?.attachments || []),\n ];\n }\n\n return event;\n });\n }\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Hub } from '@sentry/core';
|
|
2
|
-
import type { Transaction } from '@sentry/tracing';
|
|
1
|
+
import type { Hub, Transaction } from '@sentry/core';
|
|
3
2
|
import type { CustomSamplingContext, TransactionContext } from '@sentry/types';
|
|
4
3
|
export declare const APP_START_WARM = "app_start_warm";
|
|
5
4
|
export declare const APP_START_COLD = "app_start_cold";
|
|
@@ -7,7 +6,7 @@ export declare const STALL_COUNT = "stall_count";
|
|
|
7
6
|
export declare const STALL_TOTAL_TIME = "stall_total_time";
|
|
8
7
|
export declare const STALL_LONGEST_TIME = "stall_longest_time";
|
|
9
8
|
/**
|
|
10
|
-
* Adds React Native's extensions. Needs to be called
|
|
9
|
+
* Adds React Native's extensions. Needs to be called before any transactions are created.
|
|
11
10
|
*/
|
|
12
11
|
export declare function _addTracingExtensions(): void;
|
|
13
12
|
export declare type StartTransactionFunction = (this: Hub, transactionContext: TransactionContext, customSamplingContext?: CustomSamplingContext) => Transaction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measurements.d.ts","sourceRoot":"","sources":["../../src/js/measurements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"measurements.d.ts","sourceRoot":"","sources":["../../src/js/measurements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAqB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAIlG,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAiB5C;AAED,oBAAY,wBAAwB,GAAG,CACrC,IAAI,EAAE,GAAG,EACT,kBAAkB,EAAE,kBAAkB,EACtC,qBAAqB,CAAC,EAAE,qBAAqB,KAC1C,WAAW,CAAC"}
|
package/dist/js/measurements.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurrentHub, getMainCarrier } from '@sentry/core';
|
|
1
|
+
import { addTracingExtensions, getCurrentHub, getMainCarrier } from '@sentry/core';
|
|
2
2
|
import { DEFAULT, ReactNativeTracing } from './tracing';
|
|
3
3
|
export const APP_START_WARM = 'app_start_warm';
|
|
4
4
|
export const APP_START_COLD = 'app_start_cold';
|
|
@@ -6,15 +6,15 @@ export const STALL_COUNT = 'stall_count';
|
|
|
6
6
|
export const STALL_TOTAL_TIME = 'stall_total_time';
|
|
7
7
|
export const STALL_LONGEST_TIME = 'stall_longest_time';
|
|
8
8
|
/**
|
|
9
|
-
* Adds React Native's extensions. Needs to be called
|
|
9
|
+
* Adds React Native's extensions. Needs to be called before any transactions are created.
|
|
10
10
|
*/
|
|
11
11
|
export function _addTracingExtensions() {
|
|
12
|
+
addTracingExtensions();
|
|
12
13
|
const carrier = getMainCarrier();
|
|
13
14
|
if (carrier.__SENTRY__) {
|
|
14
15
|
carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
|
|
15
16
|
if (carrier.__SENTRY__.extensions.startTransaction) {
|
|
16
|
-
const originalStartTransaction = carrier.__SENTRY__.extensions
|
|
17
|
-
.startTransaction;
|
|
17
|
+
const originalStartTransaction = carrier.__SENTRY__.extensions.startTransaction;
|
|
18
18
|
/*
|
|
19
19
|
Overwrites the transaction start and finish to start and finish stall tracking.
|
|
20
20
|
Preferably instead of overwriting add a callback method for this in the Transaction itself.
|
|
@@ -36,10 +36,7 @@ const _patchStartTransaction = (originalStartTransaction) => {
|
|
|
36
36
|
if (!transactionContext.op) {
|
|
37
37
|
transactionContext.op = DEFAULT;
|
|
38
38
|
}
|
|
39
|
-
const transaction = originalStartTransaction.apply(this, [
|
|
40
|
-
transactionContext,
|
|
41
|
-
customSamplingContext,
|
|
42
|
-
]);
|
|
39
|
+
const transaction = originalStartTransaction.apply(this, [transactionContext, customSamplingContext]);
|
|
43
40
|
const originalStartChild = transaction.startChild.bind(transaction);
|
|
44
41
|
transaction.startChild = (spanContext) => {
|
|
45
42
|
return originalStartChild(Object.assign(Object.assign({}, spanContext), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measurements.js","sourceRoot":"","sources":["../../src/js/measurements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"measurements.js","sourceRoot":"","sources":["../../src/js/measurements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnF,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAC/C,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEvD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Ac,CAAC,kBAAkB,CAAC,CAAC;QAE9E,IAAI,kBAAkB,EAAE;YACtB,kBAAkB,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YAEnD,6DAA6D;YAC7D,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC;YAE1C,WAAW,CAAC,MAAM,GAAG,CAAC,YAAgC,EAAE,EAAE;gBACxD,IAAI,kBAAkB,EAAE;oBACtB,kBAAkB,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;iBACrD;gBAED,OAAO,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;YAC3D,CAAC,CAAC;SACH;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import type { Hub, Transaction } from '@sentry/core';\nimport { addTracingExtensions, getCurrentHub, getMainCarrier } from '@sentry/core';\nimport type { CustomSamplingContext, Span, SpanContext, TransactionContext } from '@sentry/types';\n\nimport { DEFAULT, ReactNativeTracing } from './tracing';\n\nexport const APP_START_WARM = 'app_start_warm';\nexport const APP_START_COLD = 'app_start_cold';\n\nexport const STALL_COUNT = 'stall_count';\nexport const STALL_TOTAL_TIME = 'stall_total_time';\nexport const STALL_LONGEST_TIME = 'stall_longest_time';\n\n/**\n * Adds React Native's extensions. Needs to be called before any transactions are created.\n */\nexport function _addTracingExtensions(): void {\n addTracingExtensions();\n const carrier = getMainCarrier();\n if (carrier.__SENTRY__) {\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (carrier.__SENTRY__.extensions.startTransaction) {\n const originalStartTransaction = carrier.__SENTRY__.extensions.startTransaction as StartTransactionFunction;\n\n /*\n Overwrites the transaction start and finish to start and finish stall tracking.\n Preferably instead of overwriting add a callback method for this in the Transaction itself.\n */\n const _startTransaction = _patchStartTransaction(originalStartTransaction);\n\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n }\n}\n\nexport type StartTransactionFunction = (\n this: Hub,\n transactionContext: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n) => Transaction;\n\n/**\n * Overwrite the startTransaction extension method to start and end stall tracking.\n */\nconst _patchStartTransaction = (originalStartTransaction: StartTransactionFunction): StartTransactionFunction => {\n /**\n * Method to overwrite with\n */\n function _startTransaction(\n this: Hub,\n transactionContext: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n ): Transaction {\n // Native SDKs require op to be set - for JS Relay sets `default`\n if (!transactionContext.op) {\n transactionContext.op = DEFAULT;\n }\n\n const transaction: Transaction = originalStartTransaction.apply(this, [transactionContext, customSamplingContext]);\n const originalStartChild: Transaction['startChild'] = transaction.startChild.bind(transaction);\n transaction.startChild = (\n spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>,\n ): Span => {\n return originalStartChild({\n ...spanContext,\n // Native SDKs require op to be set\n op: spanContext?.op || DEFAULT,\n });\n };\n\n const reactNativeTracing = getCurrentHub().getIntegration(ReactNativeTracing);\n\n if (reactNativeTracing) {\n reactNativeTracing.onTransactionStart(transaction);\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalFinish = transaction.finish;\n\n transaction.finish = (endTimestamp: number | undefined) => {\n if (reactNativeTracing) {\n reactNativeTracing.onTransactionFinish(transaction);\n }\n\n return originalFinish.apply(transaction, [endTimestamp]);\n };\n }\n\n return transaction;\n }\n\n return _startTransaction;\n};\n"]}
|
package/dist/js/misc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,eAAe,CAAC;AAE7D,aAAK,mBAAmB,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CASjE"}
|
package/dist/js/misc.js
CHANGED
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export function isHardCrash(payload) {
|
|
6
6
|
var _a, _b;
|
|
7
|
-
const values = typeof payload !== 'string' && 'exception' in payload && ((_a = payload.exception) === null || _a === void 0 ? void 0 : _a.values)
|
|
8
|
-
? payload.exception.values
|
|
9
|
-
: [];
|
|
7
|
+
const values = typeof payload !== 'string' && 'exception' in payload && ((_a = payload.exception) === null || _a === void 0 ? void 0 : _a.values) ? payload.exception.values : [];
|
|
10
8
|
for (const exception of values) {
|
|
11
9
|
if (!(((_b = exception.mechanism) === null || _b === void 0 ? void 0 : _b.handled) !== false)) {
|
|
12
10
|
return true;
|
package/dist/js/misc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;;IACtD,MAAM,MAAM,GACV,OAAO,OAAO,KAAK,QAAQ,IAAI,WAAW,IAAI,OAAO,WAAI,OAAO,CAAC,SAAS,0CAAE,MAAM,CAAA,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACrH,KAAK,MAAM,SAAS,IAAI,MAAM,EAAE;QAC9B,IAAI,CAAC,CAAC,OAAA,SAAS,CAAC,SAAS,0CAAE,OAAO,MAAK,KAAK,CAAC,EAAE;YAC7C,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { EnvelopeItem, Exception } from '@sentry/types';\n\ntype EnvelopeItemPayload = EnvelopeItem[1];\n\n/**\n * Extracts the hard crash information from the event exceptions.\n * No exceptions or undefined handled are not hard crashes.\n */\nexport function isHardCrash(payload: EnvelopeItemPayload): boolean {\n const values: Exception[] =\n typeof payload !== 'string' && 'exception' in payload && payload.exception?.values ? payload.exception.values : [];\n for (const exception of values) {\n if (!(exception.mechanism?.handled !== false)) {\n return true;\n }\n }\n return false;\n}\n"]}
|
package/dist/js/options.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ import type { CaptureContext } from '@sentry/types/types/scope';
|
|
|
5
5
|
import type { TouchEventBoundaryProps } from './touchevents';
|
|
6
6
|
export interface BaseReactNativeOptions {
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
* Enables native transport + device info + offline caching.
|
|
9
|
+
* Be careful, disabling this also breaks automatic release setting.
|
|
10
|
+
* This means you have to manage setting the release yourself.
|
|
11
|
+
* Defaults to `true`.
|
|
12
|
+
*/
|
|
13
13
|
enableNative?: boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Enables native crashHandling. This only works if `enableNative` is `true`.
|
|
@@ -132,7 +132,7 @@ export interface BaseReactNativeOptions {
|
|
|
132
132
|
export interface ReactNativeTransportOptions extends BrowserTransportOptions {
|
|
133
133
|
/**
|
|
134
134
|
* @deprecated use `maxQueueSize` in the root of the SDK options.
|
|
135
|
-
|
|
135
|
+
*/
|
|
136
136
|
bufferSize?: number;
|
|
137
137
|
}
|
|
138
138
|
/**
|
package/dist/js/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE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AAC,EAAE,OAAO,CAAC;IAEvC;;;;;;;;OAQG;IACH,iCAAiC,CAAC,EAAE,OAAO,CAAC;IAE5C;;;OAGG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;IAE9B;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;OASG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,2BAA4B,SAAQ,uBAAuB;IAC1E;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AAEH,MAAM,WAAW,kBAAmB,SAAQ,OAAO,CAAC,2BAA2B,CAAC,EAAE,sBAAsB;CAAG;AAE3G,MAAM,WAAW,wBAAyB,SAAQ,aAAa,CAAC,2BAA2B,CAAC,EAAE,sBAAsB;CAAG;AAEvH,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B,8CAA8C;IAC9C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD"}
|
package/dist/js/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"","sourcesContent":["import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport type { ProfilerProps } from '@sentry/react/types/profiler';\nimport type { ClientOptions, Options } from '@sentry/types';\nimport type { CaptureContext } from '@sentry/types/types/scope';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\n\nexport interface BaseReactNativeOptions {\n /**\n
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"","sourcesContent":["import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport type { ProfilerProps } from '@sentry/react/types/profiler';\nimport type { ClientOptions, Options } from '@sentry/types';\nimport type { CaptureContext } from '@sentry/types/types/scope';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable scope sync from Java to NDK on Android */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions extends Options<ReactNativeTransportOptions>, BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions extends ClientOptions<ReactNativeTransportOptions>, BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: ProfilerProps;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n"]}
|
package/dist/js/scope.d.ts
CHANGED
package/dist/js/scope.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAKlE;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI;IAKvC;;OAEG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAK/C;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAQrD;;OAEG;IAEI,SAAS,CAAC,MAAM,EAAE;QAAE,C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,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAS3E;;OAEG;IACI,gBAAgB,IAAI,IAAI;IAK/B;;OAEG;IAEI,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,GAAG,IAAI;IAK5E;;OAEG;IACI,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAIlD;;OAEG;IACI,gBAAgB,IAAI,IAAI;CAGhC"}
|
package/dist/js/scope.js
CHANGED
|
@@ -24,7 +24,7 @@ export class ReactNativeScope extends Scope {
|
|
|
24
24
|
*/
|
|
25
25
|
setTags(tags) {
|
|
26
26
|
// As native only has setTag, we just loop through each tag key.
|
|
27
|
-
Object.keys(tags).forEach(
|
|
27
|
+
Object.keys(tags).forEach(key => {
|
|
28
28
|
NATIVE.setTag(key, tags[key]);
|
|
29
29
|
});
|
|
30
30
|
return super.setTags(tags);
|
|
@@ -34,7 +34,7 @@ export class ReactNativeScope extends Scope {
|
|
|
34
34
|
*/
|
|
35
35
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
36
|
setExtras(extras) {
|
|
37
|
-
Object.keys(extras).forEach(
|
|
37
|
+
Object.keys(extras).forEach(key => {
|
|
38
38
|
NATIVE.setExtra(key, extras[key]);
|
|
39
39
|
});
|
|
40
40
|
return super.setExtras(extras);
|
|
@@ -77,8 +77,8 @@ export class ReactNativeScope extends Scope {
|
|
|
77
77
|
return super.addAttachment(attachment);
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
* @inheritDoc
|
|
81
|
+
*/
|
|
82
82
|
clearAttachments() {
|
|
83
83
|
return super.clearAttachments();
|
|
84
84
|
}
|
package/dist/js/scope.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACI,OAAO,CAAC,IAAiB;QAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,GAAW,EAAE,KAAa;QACtC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,IAA+B;QAC5C,gEAAgE;QAChE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACI,OAAO,CAAC,IAAiB;QAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,GAAW,EAAE,KAAa;QACtC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;Q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,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,8DAA8D;IACvD,UAAU,CAAC,GAAW,EAAE,OAAsC;QACnE,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAsB;QACzC,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;CACF","sourcesContent":["import { Scope } from '@sentry/core';\nimport type { Attachment, Breadcrumb, User } from '@sentry/types';\n\nimport { DEFAULT_BREADCRUMB_LEVEL } from './breadcrumb';\nimport { NATIVE } from './wrapper';\n\n/**\n * Extends the scope methods to set scope on the Native SDKs\n */\nexport class ReactNativeScope extends Scope {\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n NATIVE.setUser(user);\n return super.setUser(user);\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: string): this {\n NATIVE.setTag(key, value);\n return super.setTag(key, value);\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: string }): this {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach(key => {\n NATIVE.setTag(key, tags[key]);\n });\n return super.setTags(tags);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setExtras(extras: { [key: string]: any }): this {\n Object.keys(extras).forEach(key => {\n NATIVE.setExtra(key, extras[key]);\n });\n return super.setExtras(extras);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types,@typescript-eslint/no-explicit-any\n public setExtra(key: string, extra: any): this {\n NATIVE.setExtra(key, extra);\n return super.setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n const mergedBreadcrumb = {\n ...breadcrumb,\n level: breadcrumb.level || DEFAULT_BREADCRUMB_LEVEL,\n };\n NATIVE.addBreadcrumb(mergedBreadcrumb);\n return super.addBreadcrumb(mergedBreadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n NATIVE.clearBreadcrumbs();\n return super.clearBreadcrumbs();\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setContext(key: string, context: { [key: string]: any } | null): this {\n NATIVE.setContext(key, context);\n return super.setContext(key, context);\n }\n\n /**\n * @inheritDoc\n */\n public addAttachment(attachment: Attachment): this {\n return super.addAttachment(attachment);\n }\n\n /**\n * @inheritDoc\n */\n public clearAttachments(): this {\n return super.clearAttachments();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModulesCollector.d.ts","sourceRoot":"","sources":["../../../src/js/tools/ModulesCollector.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;
|
|
1
|
+
{"version":3,"file":"ModulesCollector.d.ts","sourceRoot":"","sources":["../../../src/js/tools/ModulesCollector.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,qBAAqB;WACP,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA0DzF;;OAEG;WACW,GAAG,CAAC,EAChB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,OAAO,GACR,EAAE,OAAO,CAAC;QACT,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACjF,CAAC,GAAG,IAAI;CA6CV"}
|
|
@@ -11,7 +11,7 @@ const { dirname, join, resolve, sep: posixSep } = path_1.posix;
|
|
|
11
11
|
class ModulesCollector {
|
|
12
12
|
/** Collect method */
|
|
13
13
|
static collect(sources, modulesPaths) {
|
|
14
|
-
const normalizedModulesPaths = modulesPaths.map(
|
|
14
|
+
const normalizedModulesPaths = modulesPaths.map(modulesPath => resolve(modulesPath.split(path_1.sep).join(posixSep)));
|
|
15
15
|
const infos = {};
|
|
16
16
|
const seen = {};
|
|
17
17
|
sources.forEach((path) => {
|
|
@@ -33,9 +33,7 @@ class ModulesCollector {
|
|
|
33
33
|
}
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
if (!dir ||
|
|
37
|
-
parentDir === dir ||
|
|
38
|
-
seen[dir]) {
|
|
36
|
+
if (!dir || parentDir === dir || seen[dir]) {
|
|
39
37
|
return;
|
|
40
38
|
}
|
|
41
39
|
seen[dir] = true;
|
|
@@ -95,9 +93,7 @@ class ModulesCollector {
|
|
|
95
93
|
return;
|
|
96
94
|
}
|
|
97
95
|
const sources = map.sources;
|
|
98
|
-
const modules = collect
|
|
99
|
-
? collect(sources, modulesPaths)
|
|
100
|
-
: ModulesCollector.collect(sources, modulesPaths);
|
|
96
|
+
const modules = collect ? collect(sources, modulesPaths) : ModulesCollector.collect(sources, modulesPaths);
|
|
101
97
|
const outputModulesDirPath = dirname(outputModulesPath);
|
|
102
98
|
if (!fs_1.existsSync(outputModulesDirPath)) {
|
|
103
99
|
fs_1.mkdirSync(outputModulesDirPath, { recursive: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModulesCollector.js","sourceRoot":"","sources":["../../../src/js/tools/ModulesCollector.ts"],"names":[],"mappings":";AAAA,yCAAuC;A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AAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAE3G,MAAM,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACxD,IAAI,CAAC,eAAU,CAAC,oBAAoB,CAAC,EAAE;YACrC,cAAS,CAAC,oBAAoB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;SACtD;QACD,kBAAa,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,cAAM,CAAC,IAAI,CAAC,mCAAmC,iBAAiB,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AAtHD,mCAsHC","sourcesContent":["import { logger } from '@sentry/utils';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';\nimport { posix, sep } from 'path';\n\nlogger.enable();\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { dirname, join, resolve, sep: posixSep } = posix;\n\ninterface Package {\n name?: string;\n version?: string;\n}\n\n/**\n * Collects JS modules from source paths.\n */\nexport default class ModulesCollector {\n /** Collect method */\n public static collect(sources: unknown[], modulesPaths: string[]): Record<string, string> {\n const normalizedModulesPaths = modulesPaths.map(modulesPath => resolve(modulesPath.split(sep).join(posixSep)));\n\n const infos: Record<string, string> = {};\n const seen: Record<string, true> = {};\n\n sources.forEach((path: unknown) => {\n if (typeof path !== 'string') {\n return;\n }\n\n let dir = path; // included source file path\n let candidate: Package | null = null;\n\n /** Traverse directories upward in the search of all package.json files */\n const upDirSearch = (): void => {\n const parentDir = dir;\n dir = dirname(parentDir);\n\n if (normalizedModulesPaths.includes(resolve(dir))) {\n if (candidate?.name && candidate?.version) {\n infos[candidate.name] = candidate.version;\n } else if (candidate?.name) {\n infos[candidate.name] = 'unknown';\n }\n return;\n }\n\n if (!dir || parentDir === dir || seen[dir]) {\n return;\n }\n seen[dir] = true;\n\n const pkgPath = join(dir, 'package.json');\n if (!existsSync(pkgPath)) {\n // fast-forward if the package.json doesn't exist\n return upDirSearch();\n }\n\n try {\n const info: Package = JSON.parse(readFileSync(pkgPath, 'utf8'));\n candidate = {\n name: info.name,\n version: info.version,\n };\n } catch (error) {\n logger.error(`Failed to read ${pkgPath}`);\n }\n\n return upDirSearch(); // processed package.json file, continue up search\n };\n\n upDirSearch();\n });\n\n return infos;\n }\n\n /**\n * Runs collection of modules.\n */\n public static run({\n sourceMapPath,\n outputModulesPath,\n modulesPaths,\n collect,\n }: Partial<{\n sourceMapPath: string;\n outputModulesPath: string;\n modulesPaths: string[];\n collect: (sources: unknown[], modulesPaths: string[]) => Record<string, string>;\n }>): void {\n if (!sourceMapPath) {\n logger.error('First argument `source-map-path` is missing!');\n return;\n }\n if (!outputModulesPath) {\n logger.error('Second argument `modules-output-path` is missing!');\n return;\n }\n if (!modulesPaths || modulesPaths.length === 0) {\n logger.error('Third argument `modules-paths` is missing!');\n return;\n }\n\n logger.info('Reading source map from', sourceMapPath);\n logger.info('Saving modules to', outputModulesPath);\n logger.info('Resolving modules from paths', outputModulesPath);\n\n if (!existsSync(sourceMapPath)) {\n logger.error(`Source map file does not exist at ${sourceMapPath}`);\n return;\n }\n for (const modulesPath of modulesPaths) {\n if (!existsSync(modulesPath)) {\n logger.error(`Modules path does not exist at ${modulesPath}`);\n return;\n }\n }\n\n const map: { sources?: unknown } = JSON.parse(readFileSync(sourceMapPath, 'utf8'));\n if (!map.sources || !Array.isArray(map.sources)) {\n logger.error(`Modules not collected. No sources found in the source map (${sourceMapPath})!`);\n return;\n }\n\n const sources: unknown[] = map.sources;\n const modules = collect ? collect(sources, modulesPaths) : ModulesCollector.collect(sources, modulesPaths);\n\n const outputModulesDirPath = dirname(outputModulesPath);\n if (!existsSync(outputModulesDirPath)) {\n mkdirSync(outputModulesDirPath, { recursive: true });\n }\n writeFileSync(outputModulesPath, JSON.stringify(modules, null, 2));\n logger.info(`Modules collected and saved to: ${outputModulesPath}`);\n }\n}\n"]}
|
|
@@ -4,8 +4,6 @@ const process_1 = require("process");
|
|
|
4
4
|
const ModulesCollector_1 = require("./ModulesCollector");
|
|
5
5
|
const sourceMapPath = process_1.argv[2];
|
|
6
6
|
const outputModulesPath = process_1.argv[3];
|
|
7
|
-
const modulesPaths = process_1.argv[4]
|
|
8
|
-
? process_1.argv[4].split(',')
|
|
9
|
-
: [];
|
|
7
|
+
const modulesPaths = process_1.argv[4] ? process_1.argv[4].split(',') : [];
|
|
10
8
|
ModulesCollector_1.default.run({ sourceMapPath, outputModulesPath, modulesPaths });
|
|
11
9
|
//# sourceMappingURL=collectModules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectModules.js","sourceRoot":"","sources":["../../../src/js/tools/collectModules.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,qCAA+B;AAE/B,yDAAkD;AAElD,MAAM,aAAa,GAAuB,cAAI,CAAC,CAAC,CAAC,CAAC;AAClD,MAAM,iBAAiB,GAAuB,cAAI,CAAC,CAAC,CAAC,CAAC;AACtD,MAAM,YAAY,GAAa,cAAI,CAAC,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"collectModules.js","sourceRoot":"","sources":["../../../src/js/tools/collectModules.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,qCAA+B;AAE/B,yDAAkD;AAElD,MAAM,aAAa,GAAuB,cAAI,CAAC,CAAC,CAAC,CAAC;AAClD,MAAM,iBAAiB,GAAuB,cAAI,CAAC,CAAC,CAAC,CAAC;AACtD,MAAM,YAAY,GAAa,cAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAEjE,0BAAgB,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { argv } from 'process';\n\nimport ModulesCollector from './ModulesCollector';\n\nconst sourceMapPath: string | undefined = argv[2];\nconst outputModulesPath: string | undefined = argv[3];\nconst modulesPaths: string[] = argv[4] ? argv[4].split(',') : [];\n\nModulesCollector.run({ sourceMapPath, outputModulesPath, modulesPaths });\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gesturetracing.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/gesturetracing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,GAAG,EAAE,MAAM,eAAe,CAAC;AAMrD,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,uBAAuB,SAAS,CAAC;AAE9C,eAAO,MAAM,sBAAsB,QAA0B,CAAC;AAC9D,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAwBjD,UAAU,qBAAqB;IAC7B,aAAa,EAAE,MAAM,GAAG,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ;AACzC;;;GAGG;AACH,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAC3C,QAAQ,
|
|
1
|
+
{"version":3,"file":"gesturetracing.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/gesturetracing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,GAAG,EAAE,MAAM,eAAe,CAAC;AAMrD,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,uBAAuB,SAAS,CAAC;AAE9C,eAAO,MAAM,sBAAsB,QAA0B,CAAC;AAC9D,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAwBjD,UAAU,qBAAqB;IAC7B,aAAa,EAAE,MAAM,GAAG,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ;AACzC;;;GAGG;AACH,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAC3C,QAAQ,CAiDV"}
|
|
@@ -33,12 +33,14 @@ label, gesture, options = {}) {
|
|
|
33
33
|
const hub = ((_a = options.getCurrentHub) === null || _a === void 0 ? void 0 : _a.call(options)) || getCurrentHub();
|
|
34
34
|
const name = gestureCandidate.handlerName.length > GESTURE_POSTFIX_LENGTH
|
|
35
35
|
? gestureCandidate.handlerName
|
|
36
|
-
.substring(0, gestureCandidate.handlerName.length - GESTURE_POSTFIX_LENGTH)
|
|
36
|
+
.substring(0, gestureCandidate.handlerName.length - GESTURE_POSTFIX_LENGTH)
|
|
37
|
+
.toLowerCase()
|
|
37
38
|
: ACTION_GESTURE_FALLBACK;
|
|
38
39
|
const originalOnBegin = gestureCandidate.handlers.onBegin;
|
|
39
40
|
gesture.handlers.onBegin = (event) => {
|
|
40
41
|
var _a, _b;
|
|
41
|
-
(_b = (_a = hub
|
|
42
|
+
(_b = (_a = hub
|
|
43
|
+
.getClient()) === null || _a === void 0 ? void 0 : _a.getIntegration(ReactNativeTracing)) === null || _b === void 0 ? void 0 : _b.startUserInteractionTransaction({ elementId: label, op: `${UI_ACTION}.${name}` });
|
|
42
44
|
addGestureBreadcrumb(`Gesture ${label} begin.`, { event, hub, name });
|
|
43
45
|
if (originalOnBegin) {
|
|
44
46
|
originalOnBegin(event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gesturetracing.js","sourceRoot":"","sources":["../../../src/js/tracing/gesturetracing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE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YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,WAAW;IACvB,UAAU,EAAE,WAAW;CACf,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { Breadcrumb, Hub } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { UI_ACTION } from './ops';\nimport { ReactNativeTracing } from './reactnativetracing';\n\nexport const DEFAULT_BREADCRUMB_CATEGORY = 'gesture';\nexport const DEFAULT_BREADCRUMB_TYPE = 'user';\n\nexport const GESTURE_POSTFIX_LENGTH = 'GestureHandler'.length;\nexport const ACTION_GESTURE_FALLBACK = 'gesture';\n\n/**\n * Internal interface following RNGH 2 Gesture Event API.\n * We need to use this to avoid importing RNGH 2 types and depending on it.\n * https://github.com/software-mansion/react-native-gesture-handler/blob/f0868f7ccf678c947ef65519ebf97ae149a10289/src/handlers/gestures/gesture.ts#L55\n * @hidden\n */\ntype GestureEvent = Record<string, unknown>;\n\n/**\n * Internal interface for RNGH 2 Gesture API.\n * We need to use this to avoid importing RNGH 2 types and depending on it.\n * https://github.com/software-mansion/react-native-gesture-handler/blob/2.9.0/src/handlers/gestures/gesture.ts#L120\n * @hidden\n */\ninterface BaseGesture {\n handlers?: {\n onBegin?: (event: GestureEvent) => void;\n onEnd?: (event: GestureEvent) => void;\n };\n handlerName: string;\n}\n\ninterface GestureTracingOptions {\n getCurrentHub: () => Hub;\n}\n\n/**\n * Patches React Native Gesture Handler v2 Gesture to start a transaction on gesture begin with the appropriate label.\n * Example: ShoppingCartScreen.dismissGesture\n */\nexport function sentryTraceGesture<GestureT>(\n /**\n * Label of the gesture to be used in transaction name.\n * Example: dismissGesture\n */\n label: string,\n gesture: GestureT,\n options: Partial<GestureTracingOptions> = {},\n): GestureT {\n const gestureCandidate = gesture as unknown as BaseGesture | undefined | null;\n if (!gestureCandidate) {\n logger.warn('[GestureTracing] Gesture can not be undefined');\n return gesture;\n }\n if (!gestureCandidate.handlers) {\n logger.warn(\n '[GestureTracing] Can not wrap gesture without handlers. If you want to wrap a gesture composition wrap individual gestures.',\n );\n return gesture;\n }\n if (!label) {\n logger.warn('[GestureTracing] Can not wrap gesture without name.');\n return gesture;\n }\n const hub = options.getCurrentHub?.() || getCurrentHub();\n\n const name =\n gestureCandidate.handlerName.length > GESTURE_POSTFIX_LENGTH\n ? gestureCandidate.handlerName\n .substring(0, gestureCandidate.handlerName.length - GESTURE_POSTFIX_LENGTH)\n .toLowerCase()\n : ACTION_GESTURE_FALLBACK;\n\n const originalOnBegin = gestureCandidate.handlers.onBegin;\n (gesture as unknown as Required<BaseGesture>).handlers.onBegin = (event: GestureEvent) => {\n hub\n .getClient()\n ?.getIntegration(ReactNativeTracing)\n ?.startUserInteractionTransaction({ elementId: label, op: `${UI_ACTION}.${name}` });\n\n addGestureBreadcrumb(`Gesture ${label} begin.`, { event, hub, name });\n\n if (originalOnBegin) {\n originalOnBegin(event);\n }\n };\n\n const originalOnEnd = gestureCandidate.handlers.onEnd;\n (gesture as unknown as Required<BaseGesture>).handlers.onEnd = (event: GestureEvent) => {\n addGestureBreadcrumb(`Gesture ${label} end.`, { event, hub, name });\n\n if (originalOnEnd) {\n originalOnEnd(event);\n }\n };\n\n return gesture;\n}\n\nfunction addGestureBreadcrumb(\n message: string,\n options: {\n event: Record<string, unknown> | undefined | null;\n hub: Hub;\n name: string;\n },\n): void {\n const { event, hub, name } = options;\n const crumb: Breadcrumb = {\n message,\n level: 'info',\n type: DEFAULT_BREADCRUMB_TYPE,\n category: DEFAULT_BREADCRUMB_CATEGORY,\n };\n\n if (event) {\n const data: Record<string, unknown> = {\n gesture: name,\n };\n for (const key of Object.keys(GestureEventKeys)) {\n const eventKey = GestureEventKeys[key as keyof typeof GestureEventKeys];\n if (eventKey in event) {\n data[eventKey] = event[eventKey];\n }\n }\n crumb.data = data;\n }\n\n hub.addBreadcrumb(crumb);\n\n logger.log(`[GestureTracing] ${crumb.message}`);\n}\n\n/**\n * Selected keys from RNGH 2 Gesture Event API.\n * We only want to send relevant data to save on payload size.\n * @hidden\n */\nconst GestureEventKeys = {\n NUMBER_OF_POINTERS: 'numberOfPointers',\n NUMBER_OF_TOUCHES: 'numberOfTouches',\n FORCE: 'force',\n FORCE_CHANGE: 'forceChange',\n ROTATION: 'rotation',\n ROTATION_CHANGE: 'rotationChange',\n SCALE: 'scale',\n SCALE_CHANGE: 'scaleChange',\n DURATION: 'duration',\n VELOCITY: 'velocity',\n VELOCITY_X: 'velocityX',\n VELOCITY_Y: 'velocityY',\n} as const;\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { ReactNativeTracing } from './reactnativetracing';
|
|
2
|
-
export { RoutingInstrumentation, RoutingInstrumentationInstance
|
|
2
|
+
export { RoutingInstrumentation, RoutingInstrumentationInstance } from './routingInstrumentation';
|
|
3
3
|
export { ReactNavigationInstrumentation, ReactNavigationV5Instrumentation, } from './reactnavigation';
|
|
4
4
|
export { ReactNavigationV4Instrumentation } from './reactnavigationv4';
|
|
5
5
|
export { ReactNativeNavigationInstrumentation } from './reactnativenavigation';
|
|
6
|
-
export { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext
|
|
6
|
+
export { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';
|
|
7
7
|
export { ReactNativeProfiler } from './reactnativeprofiler';
|
|
8
|
-
export { sentryTraceGesture
|
|
8
|
+
export { sentryTraceGesture } from './gesturetracing';
|
|
9
9
|
export * from './ops';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAElG,OAAO,EACL,8BAA8B,EAE9B,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAE/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,cAAc,OAAO,CAAC"}
|