@sentry/react-native 6.3.0-beta.2 → 6.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/RNSentry.podspec +2 -1
  2. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +5 -0
  3. package/android/src/main/java/io/sentry/react/RNSentryPackage.java +47 -4
  4. package/android/src/main/java/io/sentry/react/replay/RNSentryReplayMask.java +10 -0
  5. package/android/src/main/java/io/sentry/react/replay/RNSentryReplayMaskManagerImpl.java +16 -0
  6. package/android/src/main/java/io/sentry/react/replay/RNSentryReplayUnmask.java +10 -0
  7. package/android/src/main/java/io/sentry/react/replay/RNSentryReplayUnmaskManagerImpl.java +16 -0
  8. package/android/src/newarch/java/io/sentry/react/replay/RNSentryReplayMaskManager.java +33 -0
  9. package/android/src/newarch/java/io/sentry/react/replay/RNSentryReplayUnmaskManager.java +34 -0
  10. package/android/src/oldarch/java/io/sentry/react/replay/RNSentryReplayMaskManager.java +21 -0
  11. package/android/src/oldarch/java/io/sentry/react/replay/RNSentryReplayUnmaskManager.java +21 -0
  12. package/dist/js/RNSentryReplayMaskNativeComponent.d.ts +6 -0
  13. package/dist/js/RNSentryReplayMaskNativeComponent.d.ts.map +1 -0
  14. package/dist/js/RNSentryReplayMaskNativeComponent.js +5 -0
  15. package/dist/js/RNSentryReplayMaskNativeComponent.js.map +1 -0
  16. package/dist/js/RNSentryReplayUnmaskNativeComponent.d.ts +6 -0
  17. package/dist/js/RNSentryReplayUnmaskNativeComponent.d.ts.map +1 -0
  18. package/dist/js/RNSentryReplayUnmaskNativeComponent.js +5 -0
  19. package/dist/js/RNSentryReplayUnmaskNativeComponent.js.map +1 -0
  20. package/dist/js/index.d.ts +1 -0
  21. package/dist/js/index.d.ts.map +1 -1
  22. package/dist/js/index.js +1 -0
  23. package/dist/js/index.js.map +1 -1
  24. package/dist/js/integrations/exports.d.ts +2 -1
  25. package/dist/js/integrations/exports.d.ts.map +1 -1
  26. package/dist/js/integrations/exports.js +2 -1
  27. package/dist/js/integrations/exports.js.map +1 -1
  28. package/dist/js/replay/CustomMask.d.ts +8 -0
  29. package/dist/js/replay/CustomMask.d.ts.map +1 -0
  30. package/dist/js/replay/CustomMask.js +48 -0
  31. package/dist/js/replay/CustomMask.js.map +1 -0
  32. package/dist/js/replay/CustomMask.web.d.ts +6 -0
  33. package/dist/js/replay/CustomMask.web.d.ts.map +1 -0
  34. package/dist/js/replay/CustomMask.web.js +22 -0
  35. package/dist/js/replay/CustomMask.web.js.map +1 -0
  36. package/dist/js/replay/browserReplay.d.ts +4 -0
  37. package/dist/js/replay/browserReplay.d.ts.map +1 -0
  38. package/dist/js/replay/browserReplay.js +6 -0
  39. package/dist/js/replay/browserReplay.js.map +1 -0
  40. package/dist/js/tools/metroconfig.d.ts.map +1 -1
  41. package/dist/js/tools/metroconfig.js +1 -4
  42. package/dist/js/tools/metroconfig.js.map +1 -1
  43. package/dist/js/tools/sentryBabelTransformerUtils.d.ts +5 -8
  44. package/dist/js/tools/sentryBabelTransformerUtils.d.ts.map +1 -1
  45. package/dist/js/tools/sentryBabelTransformerUtils.js +13 -46
  46. package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
  47. package/dist/js/version.d.ts +1 -1
  48. package/dist/js/version.js +1 -1
  49. package/dist/js/version.js.map +1 -1
  50. package/ios/RNSentryReplay.h +4 -0
  51. package/ios/{RNSentryReplay.m → RNSentryReplay.mm} +20 -4
  52. package/ios/RNSentryReplayBreadcrumbConverterHelper.h +7 -0
  53. package/ios/RNSentryReplayBreadcrumbConverterHelper.m +17 -0
  54. package/ios/Replay/RNSentryReplayMask.h +24 -0
  55. package/ios/Replay/RNSentryReplayMask.mm +51 -0
  56. package/ios/Replay/RNSentryReplayUnmask.h +24 -0
  57. package/ios/Replay/RNSentryReplayUnmask.mm +51 -0
  58. package/package.json +10 -10
  59. package/src/js/RNSentryReplayMaskNativeComponent.ts +10 -0
  60. package/src/js/RNSentryReplayUnmaskNativeComponent.ts +10 -0
  61. package/ts3.8/dist/js/RNSentryReplayMaskNativeComponent.d.ts +6 -0
  62. package/ts3.8/dist/js/RNSentryReplayUnmaskNativeComponent.d.ts +6 -0
  63. package/ts3.8/dist/js/index.d.ts +1 -0
  64. package/ts3.8/dist/js/integrations/exports.d.ts +2 -1
  65. package/ts3.8/dist/js/replay/CustomMask.d.ts +8 -0
  66. package/ts3.8/dist/js/replay/CustomMask.web.d.ts +6 -0
  67. package/ts3.8/dist/js/replay/browserReplay.d.ts +4 -0
  68. package/ts3.8/dist/js/version.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"metroconfig.js","sourceRoot":"","sources":["../../../src/js/tools/metroconfig.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAGvC,mCAAmC;AACnC,qCAA8B;AAE9B,iDAA8C;AAC9C,+EAAkH;AAClH,mEAA+G;AAE/G,kEAAwC;AACxC,uDAAyD;AAEzD,IAAA,2BAAY,GAAE,CAAC;AA4Bf;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC9B,MAAmB,EACnB,EACE,uBAAuB,GAAG,KAAK,EAC/B,gBAAgB,GAAG,IAAI,EACvB,gCAAgC,GAAG,IAAI,MACX,EAAE;IAEhC,8BAA8B,EAAE,CAAC;IAEjC,IAAI,SAAS,GAAG,MAAM,CAAC;IAEvB,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACzC,SAAS,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,uBAAuB,EAAE;QAC3B,SAAS,GAAG,0BAA0B,CAAC,SAAS,CAAC,CAAC;KACnD;IACD,IAAI,gBAAgB,KAAK,KAAK,EAAE;QAC9B,SAAS,GAAG,kBAAkB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;KAC7D;IACD,IAAI,gCAAgC,EAAE;QACpC,SAAS,GAAG,IAAA,sCAAoB,EAAC,SAAS,CAAC,CAAC;KAC7C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E,CAAC,iCACrB,qBAAqB,KACxB,QAAQ,EAAE,CAAC,qBAAqB,IAAI,qBAAqB,CAAC,QAAQ,CAAC,IAAI,4BAA4B,CAAC,KAAK,CAAC,IAC1G,CAAC;QAEH,MAAM,yBAAyB,GAAG,CAAC,sBAAsB,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC;QAEzG,IAAI,yBAAyB,KAAK,SAAS,IAAI,MAAM,IAAI,yBAAyB,EAAE;YAClF,OAAO,yBAAyB,CAAC,IAAI,CAAsB,qBAAqB,CAAC,EAAE,CACjF,8BAA8B,CAAC,qBAAqB,CAAC,CACtD,CAAC;SACH;QAED,OAAO,8BAA8B,CAAC,yBAAyB,CAAC,CAAC;IACnE,CAAC,CAAC;IAEF,uCACK,MAAM,KACT,YAAY,kCACP,MAAM,CAAC,YAAY,KACtB,cAAc,OAEhB;AACJ,CAAC;AAjCD,8DAiCC;AAED;;;;GAIG;AACH,SAAS,8BAA8B;IACrC,aAAG,CAAC,6BAA6B,GAAG,MAAM,CAAC;AAC7C,CAAC","sourcesContent":["import { logger } from '@sentry/utils';\nimport type { MetroConfig, MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport type { CustomResolutionContext, CustomResolver, Resolution } from 'metro-resolver';\nimport * as process from 'process';\nimport { env } from 'process';\n\nimport { enableLogger } from './enableLogger';\nimport { cleanDefaultBabelTransformerPath, saveDefaultBabelTransformerPath } from './sentryBabelTransformerUtils';\nimport { createSentryMetroSerializer, unstable_beforeAssetSerializationPlugin } from './sentryMetroSerializer';\nimport type { DefaultConfigOptions } from './vendor/expo/expoconfig';\nexport * from './sentryMetroSerializer';\nimport { withSentryMiddleware } from './metroMiddleware';\n\nenableLogger();\n\nexport interface SentryMetroConfigOptions {\n /**\n * Annotates React components with Sentry data.\n * @default false\n */\n annotateReactComponents?: boolean;\n /**\n * Adds the Sentry replay package for web.\n * @default true\n */\n includeWebReplay?: boolean;\n /**\n * Add Sentry Metro Server Middleware which\n * enables the app to fetch stack frames source context.\n * @default true\n */\n enableSourceContextInDevelopment?: boolean;\n}\n\nexport interface SentryExpoConfigOptions {\n /**\n * Pass a custom `getDefaultConfig` function to override the default Expo configuration getter.\n */\n getDefaultConfig?: typeof getSentryExpoConfig;\n}\n\n/**\n * Adds Sentry to the Metro config.\n *\n * Adds Debug ID to the output bundle and source maps.\n * Collapses Sentry frames from the stack trace view in LogBox.\n */\nexport function withSentryConfig(\n config: MetroConfig,\n {\n annotateReactComponents = false,\n includeWebReplay = true,\n enableSourceContextInDevelopment = true,\n }: SentryMetroConfigOptions = {},\n): MetroConfig {\n setSentryMetroDevServerEnvFlag();\n\n let newConfig = config;\n\n newConfig = withSentryDebugId(newConfig);\n newConfig = withSentryFramesCollapsed(newConfig);\n if (annotateReactComponents) {\n newConfig = withSentryBabelTransformer(newConfig);\n }\n if (includeWebReplay === false) {\n newConfig = withSentryResolver(newConfig, includeWebReplay);\n }\n if (enableSourceContextInDevelopment) {\n newConfig = withSentryMiddleware(newConfig);\n }\n\n return newConfig;\n}\n\n/**\n * This function returns Default Expo configuration with Sentry plugins.\n */\nexport function getSentryExpoConfig(\n projectRoot: string,\n options: DefaultConfigOptions & SentryExpoConfigOptions & SentryMetroConfigOptions = {},\n): MetroConfig {\n setSentryMetroDevServerEnvFlag();\n\n const getDefaultConfig = options.getDefaultConfig || loadExpoMetroConfigModule().getDefaultConfig;\n const config = getDefaultConfig(projectRoot, {\n ...options,\n unstable_beforeAssetSerializationPlugins: [\n ...(options.unstable_beforeAssetSerializationPlugins || []),\n unstable_beforeAssetSerializationPlugin,\n ],\n });\n\n let newConfig = withSentryFramesCollapsed(config);\n if (options.annotateReactComponents) {\n newConfig = withSentryBabelTransformer(newConfig);\n }\n\n if (options.includeWebReplay === false) {\n newConfig = withSentryResolver(newConfig, options.includeWebReplay);\n }\n\n if (options.enableSourceContextInDevelopment ?? true) {\n newConfig = withSentryMiddleware(newConfig);\n }\n\n return newConfig;\n}\n\nfunction loadExpoMetroConfigModule(): {\n getDefaultConfig: (\n projectRoot: string,\n options: {\n unstable_beforeAssetSerializationPlugins?: ((serializationInput: {\n graph: ReadOnlyGraph<MixedOutput>;\n premodules: Module[];\n debugId?: string;\n }) => Module[])[];\n },\n ) => MetroConfig;\n} {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require('expo/metro-config');\n } catch (e) {\n throw new Error('Unable to load `expo/metro-config`. Make sure you have Expo installed.');\n }\n}\n\n/**\n * Adds Sentry Babel transformer to the Metro config.\n */\nexport function withSentryBabelTransformer(config: MetroConfig): MetroConfig {\n const defaultBabelTransformerPath = config.transformer && config.transformer.babelTransformerPath;\n logger.debug('Default Babel transformer path from `config.transformer`:', defaultBabelTransformerPath);\n\n if (!defaultBabelTransformerPath) {\n // This has to be console.warn because the options is enabled but won't be used\n // eslint-disable-next-line no-console\n console.warn('`transformer.babelTransformerPath` is undefined.');\n // eslint-disable-next-line no-console\n console.warn('Sentry Babel transformer cannot be used. Not adding it...');\n return config;\n }\n\n if (defaultBabelTransformerPath) {\n saveDefaultBabelTransformerPath(defaultBabelTransformerPath);\n process.on('exit', () => {\n cleanDefaultBabelTransformerPath();\n });\n }\n\n return {\n ...config,\n transformer: {\n ...config.transformer,\n babelTransformerPath: require.resolve('./sentryBabelTransformer'),\n },\n };\n}\n\ntype MetroCustomSerializer = Required<Required<MetroConfig>['serializer']>['customSerializer'] | undefined;\n\nfunction withSentryDebugId(config: MetroConfig): MetroConfig {\n const customSerializer = createSentryMetroSerializer(\n config.serializer?.customSerializer || undefined,\n ) as MetroCustomSerializer;\n // MetroConfig types customSerializers as async only, but sync returns are also supported\n // The default serializer is sync\n\n return {\n ...config,\n serializer: {\n ...config.serializer,\n customSerializer,\n },\n };\n}\n\n// Based on: https://github.com/facebook/metro/blob/c21daba415ea26511e157f794689caab9abe8236/packages/metro-resolver/src/resolve.js#L86-L91\ntype CustomResolverBeforeMetro068 = (\n context: CustomResolutionContext,\n realModuleName: string,\n platform: string | null,\n moduleName?: string,\n) => Resolution;\n\n/**\n * Includes `@sentry/replay` packages based on the `includeWebReplay` flag and current bundle `platform`.\n */\nexport function withSentryResolver(config: MetroConfig, includeWebReplay: boolean | undefined): MetroConfig {\n const originalResolver = config.resolver?.resolveRequest as CustomResolver | CustomResolverBeforeMetro068 | undefined;\n\n const sentryResolverRequest: CustomResolver = (\n context: CustomResolutionContext,\n moduleName: string,\n platform: string | null,\n oldMetroModuleName?: string,\n ) => {\n if (\n (includeWebReplay === false ||\n (includeWebReplay === undefined && (platform === 'android' || platform === 'ios'))) &&\n (oldMetroModuleName ?? moduleName).includes('@sentry/replay')\n ) {\n return { type: 'empty' } as Resolution;\n }\n if (originalResolver) {\n return oldMetroModuleName\n ? originalResolver(context, moduleName, platform, oldMetroModuleName)\n : originalResolver(context, moduleName, platform);\n }\n\n // Prior 0.68, resolve context.resolveRequest is sentryResolver itself, where on later version it is the default resolver.\n if (context.resolveRequest === sentryResolverRequest) {\n // eslint-disable-next-line no-console\n console.error(\n `Error: [@sentry/react-native/metro] Can not resolve the defaultResolver on Metro older than 0.68.\nPlease follow one of the following options:\n- Include your resolverRequest on your metroconfig.\n- Update your Metro version to 0.68 or higher.\n- Set includeWebReplay as true on your metro config.\n- If you are still facing issues, report the issue at http://www.github.com/getsentry/sentry-react-native/issues`,\n );\n // Return required for test.\n return process.exit(-1);\n }\n\n return context.resolveRequest(context, moduleName, platform);\n };\n\n return {\n ...config,\n resolver: {\n ...config.resolver,\n resolveRequest: sentryResolverRequest,\n },\n };\n}\n\ntype MetroFrame = Parameters<Required<Required<MetroConfig>['symbolicator']>['customizeFrame']>[0];\ntype MetroCustomizeFrame = { readonly collapse?: boolean };\ntype MetroCustomizeFrameReturnValue =\n | ReturnType<Required<Required<MetroConfig>['symbolicator']>['customizeFrame']>\n | undefined;\n\n/**\n * Collapses Sentry internal frames from the stack trace view in LogBox.\n */\nexport function withSentryFramesCollapsed(config: MetroConfig): MetroConfig {\n const originalCustomizeFrame = config.symbolicator?.customizeFrame;\n const collapseSentryInternalFrames = (frame: MetroFrame): boolean =>\n typeof frame.file === 'string' &&\n (frame.file.includes('node_modules/@sentry/utils/cjs/instrument.js') ||\n frame.file.includes('node_modules/@sentry/utils/cjs/logger.js'));\n\n const customizeFrame = (frame: MetroFrame): MetroCustomizeFrameReturnValue => {\n const originalOrSentryCustomizeFrame = (\n originalCustomization: MetroCustomizeFrame | undefined,\n ): MetroCustomizeFrame => ({\n ...originalCustomization,\n collapse: (originalCustomization && originalCustomization.collapse) || collapseSentryInternalFrames(frame),\n });\n\n const maybePromiseCustomization = (originalCustomizeFrame && originalCustomizeFrame(frame)) || undefined;\n\n if (maybePromiseCustomization !== undefined && 'then' in maybePromiseCustomization) {\n return maybePromiseCustomization.then<MetroCustomizeFrame>(originalCustomization =>\n originalOrSentryCustomizeFrame(originalCustomization),\n );\n }\n\n return originalOrSentryCustomizeFrame(maybePromiseCustomization);\n };\n\n return {\n ...config,\n symbolicator: {\n ...config.symbolicator,\n customizeFrame,\n },\n };\n}\n\n/**\n * Sets the `___SENTRY_METRO_DEV_SERVER___` environment flag.\n * This is used to determine if the SDK is running in Node in Metro Dev Server.\n * For example during static routes generation in `expo-router`.\n */\nfunction setSentryMetroDevServerEnvFlag(): void {\n env.___SENTRY_METRO_DEV_SERVER___ = 'true';\n}\n"]}
1
+ {"version":3,"file":"metroconfig.js","sourceRoot":"","sources":["../../../src/js/tools/metroconfig.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAGvC,mCAAmC;AACnC,qCAA8B;AAE9B,iDAA8C;AAC9C,+EAAwF;AACxF,mEAA+G;AAE/G,kEAAwC;AACxC,uDAAyD;AAEzD,IAAA,2BAAY,GAAE,CAAC;AA4Bf;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC9B,MAAmB,EACnB,EACE,uBAAuB,GAAG,KAAK,EAC/B,gBAAgB,GAAG,IAAI,EACvB,gCAAgC,GAAG,IAAI,MACX,EAAE;IAEhC,8BAA8B,EAAE,CAAC;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AAG,CAAC,KAAiB,EAAW,EAAE,CAClE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,8CAA8C,CAAC;YAClE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC,CAAC;IAErE,MAAM,cAAc,GAAG,CAAC,KAAiB,EAAkC,EAAE;QAC3E,MAAM,8BAA8B,GAAG,CACrC,qBAAsD,EACjC,EAAE,CAAC,iCACrB,qBAAqB,KACxB,QAAQ,EAAE,CAAC,qBAAqB,IAAI,qBAAqB,CAAC,QAAQ,CAAC,IAAI,4BAA4B,CAAC,KAAK,CAAC,IAC1G,CAAC;QAEH,MAAM,yBAAyB,GAAG,CAAC,sBAAsB,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC;QAEzG,IAAI,yBAAyB,KAAK,SAAS,IAAI,MAAM,IAAI,yBAAyB,EAAE;YAClF,OAAO,yBAAyB,CAAC,IAAI,CAAsB,qBAAqB,CAAC,EAAE,CACjF,8BAA8B,CAAC,qBAAqB,CAAC,CACtD,CAAC;SACH;QAED,OAAO,8BAA8B,CAAC,yBAAyB,CAAC,CAAC;IACnE,CAAC,CAAC;IAEF,uCACK,MAAM,KACT,YAAY,kCACP,MAAM,CAAC,YAAY,KACtB,cAAc,OAEhB;AACJ,CAAC;AAjCD,8DAiCC;AAED;;;;GAIG;AACH,SAAS,8BAA8B;IACrC,aAAG,CAAC,6BAA6B,GAAG,MAAM,CAAC;AAC7C,CAAC","sourcesContent":["import { logger } from '@sentry/utils';\nimport type { MetroConfig, MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport type { CustomResolutionContext, CustomResolver, Resolution } from 'metro-resolver';\nimport * as process from 'process';\nimport { env } from 'process';\n\nimport { enableLogger } from './enableLogger';\nimport { setSentryDefaultBabelTransformerPathEnv } from './sentryBabelTransformerUtils';\nimport { createSentryMetroSerializer, unstable_beforeAssetSerializationPlugin } from './sentryMetroSerializer';\nimport type { DefaultConfigOptions } from './vendor/expo/expoconfig';\nexport * from './sentryMetroSerializer';\nimport { withSentryMiddleware } from './metroMiddleware';\n\nenableLogger();\n\nexport interface SentryMetroConfigOptions {\n /**\n * Annotates React components with Sentry data.\n * @default false\n */\n annotateReactComponents?: boolean;\n /**\n * Adds the Sentry replay package for web.\n * @default true\n */\n includeWebReplay?: boolean;\n /**\n * Add Sentry Metro Server Middleware which\n * enables the app to fetch stack frames source context.\n * @default true\n */\n enableSourceContextInDevelopment?: boolean;\n}\n\nexport interface SentryExpoConfigOptions {\n /**\n * Pass a custom `getDefaultConfig` function to override the default Expo configuration getter.\n */\n getDefaultConfig?: typeof getSentryExpoConfig;\n}\n\n/**\n * Adds Sentry to the Metro config.\n *\n * Adds Debug ID to the output bundle and source maps.\n * Collapses Sentry frames from the stack trace view in LogBox.\n */\nexport function withSentryConfig(\n config: MetroConfig,\n {\n annotateReactComponents = false,\n includeWebReplay = true,\n enableSourceContextInDevelopment = true,\n }: SentryMetroConfigOptions = {},\n): MetroConfig {\n setSentryMetroDevServerEnvFlag();\n\n let newConfig = config;\n\n newConfig = withSentryDebugId(newConfig);\n newConfig = withSentryFramesCollapsed(newConfig);\n if (annotateReactComponents) {\n newConfig = withSentryBabelTransformer(newConfig);\n }\n if (includeWebReplay === false) {\n newConfig = withSentryResolver(newConfig, includeWebReplay);\n }\n if (enableSourceContextInDevelopment) {\n newConfig = withSentryMiddleware(newConfig);\n }\n\n return newConfig;\n}\n\n/**\n * This function returns Default Expo configuration with Sentry plugins.\n */\nexport function getSentryExpoConfig(\n projectRoot: string,\n options: DefaultConfigOptions & SentryExpoConfigOptions & SentryMetroConfigOptions = {},\n): MetroConfig {\n setSentryMetroDevServerEnvFlag();\n\n const getDefaultConfig = options.getDefaultConfig || loadExpoMetroConfigModule().getDefaultConfig;\n const config = getDefaultConfig(projectRoot, {\n ...options,\n unstable_beforeAssetSerializationPlugins: [\n ...(options.unstable_beforeAssetSerializationPlugins || []),\n unstable_beforeAssetSerializationPlugin,\n ],\n });\n\n let newConfig = withSentryFramesCollapsed(config);\n if (options.annotateReactComponents) {\n newConfig = withSentryBabelTransformer(newConfig);\n }\n\n if (options.includeWebReplay === false) {\n newConfig = withSentryResolver(newConfig, options.includeWebReplay);\n }\n\n if (options.enableSourceContextInDevelopment ?? true) {\n newConfig = withSentryMiddleware(newConfig);\n }\n\n return newConfig;\n}\n\nfunction loadExpoMetroConfigModule(): {\n getDefaultConfig: (\n projectRoot: string,\n options: {\n unstable_beforeAssetSerializationPlugins?: ((serializationInput: {\n graph: ReadOnlyGraph<MixedOutput>;\n premodules: Module[];\n debugId?: string;\n }) => Module[])[];\n },\n ) => MetroConfig;\n} {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require('expo/metro-config');\n } catch (e) {\n throw new Error('Unable to load `expo/metro-config`. Make sure you have Expo installed.');\n }\n}\n\n/**\n * Adds Sentry Babel transformer to the Metro config.\n */\nexport function withSentryBabelTransformer(config: MetroConfig): MetroConfig {\n const defaultBabelTransformerPath = config.transformer && config.transformer.babelTransformerPath;\n logger.debug('Default Babel transformer path from `config.transformer`:', defaultBabelTransformerPath);\n\n if (!defaultBabelTransformerPath) {\n // This has to be console.warn because the options is enabled but won't be used\n // eslint-disable-next-line no-console\n console.warn('`transformer.babelTransformerPath` is undefined.');\n // eslint-disable-next-line no-console\n console.warn('Sentry Babel transformer cannot be used. Not adding it...');\n return config;\n }\n\n if (defaultBabelTransformerPath) {\n setSentryDefaultBabelTransformerPathEnv(defaultBabelTransformerPath);\n }\n\n return {\n ...config,\n transformer: {\n ...config.transformer,\n babelTransformerPath: require.resolve('./sentryBabelTransformer'),\n },\n };\n}\n\ntype MetroCustomSerializer = Required<Required<MetroConfig>['serializer']>['customSerializer'] | undefined;\n\nfunction withSentryDebugId(config: MetroConfig): MetroConfig {\n const customSerializer = createSentryMetroSerializer(\n config.serializer?.customSerializer || undefined,\n ) as MetroCustomSerializer;\n // MetroConfig types customSerializers as async only, but sync returns are also supported\n // The default serializer is sync\n\n return {\n ...config,\n serializer: {\n ...config.serializer,\n customSerializer,\n },\n };\n}\n\n// Based on: https://github.com/facebook/metro/blob/c21daba415ea26511e157f794689caab9abe8236/packages/metro-resolver/src/resolve.js#L86-L91\ntype CustomResolverBeforeMetro068 = (\n context: CustomResolutionContext,\n realModuleName: string,\n platform: string | null,\n moduleName?: string,\n) => Resolution;\n\n/**\n * Includes `@sentry/replay` packages based on the `includeWebReplay` flag and current bundle `platform`.\n */\nexport function withSentryResolver(config: MetroConfig, includeWebReplay: boolean | undefined): MetroConfig {\n const originalResolver = config.resolver?.resolveRequest as CustomResolver | CustomResolverBeforeMetro068 | undefined;\n\n const sentryResolverRequest: CustomResolver = (\n context: CustomResolutionContext,\n moduleName: string,\n platform: string | null,\n oldMetroModuleName?: string,\n ) => {\n if (\n (includeWebReplay === false ||\n (includeWebReplay === undefined && (platform === 'android' || platform === 'ios'))) &&\n (oldMetroModuleName ?? moduleName).includes('@sentry/replay')\n ) {\n return { type: 'empty' } as Resolution;\n }\n if (originalResolver) {\n return oldMetroModuleName\n ? originalResolver(context, moduleName, platform, oldMetroModuleName)\n : originalResolver(context, moduleName, platform);\n }\n\n // Prior 0.68, resolve context.resolveRequest is sentryResolver itself, where on later version it is the default resolver.\n if (context.resolveRequest === sentryResolverRequest) {\n // eslint-disable-next-line no-console\n console.error(\n `Error: [@sentry/react-native/metro] Can not resolve the defaultResolver on Metro older than 0.68.\nPlease follow one of the following options:\n- Include your resolverRequest on your metroconfig.\n- Update your Metro version to 0.68 or higher.\n- Set includeWebReplay as true on your metro config.\n- If you are still facing issues, report the issue at http://www.github.com/getsentry/sentry-react-native/issues`,\n );\n // Return required for test.\n return process.exit(-1);\n }\n\n return context.resolveRequest(context, moduleName, platform);\n };\n\n return {\n ...config,\n resolver: {\n ...config.resolver,\n resolveRequest: sentryResolverRequest,\n },\n };\n}\n\ntype MetroFrame = Parameters<Required<Required<MetroConfig>['symbolicator']>['customizeFrame']>[0];\ntype MetroCustomizeFrame = { readonly collapse?: boolean };\ntype MetroCustomizeFrameReturnValue =\n | ReturnType<Required<Required<MetroConfig>['symbolicator']>['customizeFrame']>\n | undefined;\n\n/**\n * Collapses Sentry internal frames from the stack trace view in LogBox.\n */\nexport function withSentryFramesCollapsed(config: MetroConfig): MetroConfig {\n const originalCustomizeFrame = config.symbolicator?.customizeFrame;\n const collapseSentryInternalFrames = (frame: MetroFrame): boolean =>\n typeof frame.file === 'string' &&\n (frame.file.includes('node_modules/@sentry/utils/cjs/instrument.js') ||\n frame.file.includes('node_modules/@sentry/utils/cjs/logger.js'));\n\n const customizeFrame = (frame: MetroFrame): MetroCustomizeFrameReturnValue => {\n const originalOrSentryCustomizeFrame = (\n originalCustomization: MetroCustomizeFrame | undefined,\n ): MetroCustomizeFrame => ({\n ...originalCustomization,\n collapse: (originalCustomization && originalCustomization.collapse) || collapseSentryInternalFrames(frame),\n });\n\n const maybePromiseCustomization = (originalCustomizeFrame && originalCustomizeFrame(frame)) || undefined;\n\n if (maybePromiseCustomization !== undefined && 'then' in maybePromiseCustomization) {\n return maybePromiseCustomization.then<MetroCustomizeFrame>(originalCustomization =>\n originalOrSentryCustomizeFrame(originalCustomization),\n );\n }\n\n return originalOrSentryCustomizeFrame(maybePromiseCustomization);\n };\n\n return {\n ...config,\n symbolicator: {\n ...config.symbolicator,\n customizeFrame,\n },\n };\n}\n\n/**\n * Sets the `___SENTRY_METRO_DEV_SERVER___` environment flag.\n * This is used to determine if the SDK is running in Node in Metro Dev Server.\n * For example during static routes generation in `expo-router`.\n */\nfunction setSentryMetroDevServerEnvFlag(): void {\n env.___SENTRY_METRO_DEV_SERVER___ = 'true';\n}\n"]}
@@ -1,16 +1,13 @@
1
1
  import type { BabelTransformer } from './vendor/metro/metroBabelTransformer';
2
+ export declare const SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH = "SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH";
2
3
  /**
3
- * Saves default Babel transformer path to the project root.
4
+ * Sets default Babel transformer path to the environment variables.
4
5
  */
5
- export declare function saveDefaultBabelTransformerPath(defaultBabelTransformerPath: string): void;
6
+ export declare function setSentryDefaultBabelTransformerPathEnv(defaultBabelTransformerPath: string): void;
6
7
  /**
7
- * Reads default Babel transformer path from the project root.
8
+ * Reads default Babel transformer path from the environment variables.
8
9
  */
9
- export declare function readDefaultBabelTransformerPath(): string | undefined;
10
- /**
11
- * Cleans default Babel transformer path from the project root.
12
- */
13
- export declare function cleanDefaultBabelTransformerPath(): void;
10
+ export declare function getSentryDefaultBabelTransformerPathEnv(): string | undefined;
14
11
  /**
15
12
  * Loads default Babel transformer from `@react-native/metro-config` -> `@react-native/metro-babel-transformer`.
16
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sentryBabelTransformerUtils.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryBabelTransformerUtils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,2BAA2B,EAAE,MAAM,GAAG,IAAI,CASzF;AAED;;GAEG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,GAAG,SAAS,CAQpE;AAED;;GAEG;AACH,wBAAgB,gCAAgC,IAAI,IAAI,CASvD;AAMD;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,gBAAgB,CAS9D"}
1
+ {"version":3,"file":"sentryBabelTransformerUtils.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryBabelTransformerUtils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,eAAO,MAAM,qCAAqC,0CAA0C,CAAC;AAE7F;;GAEG;AACH,wBAAgB,uCAAuC,CAAC,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAGjG;AAED;;GAEG;AACH,wBAAgB,uCAAuC,IAAI,MAAM,GAAG,SAAS,CAE5E;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,gBAAgB,CAW9D"}
@@ -1,63 +1,30 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.loadDefaultBabelTransformer = exports.cleanDefaultBabelTransformerPath = exports.readDefaultBabelTransformerPath = exports.saveDefaultBabelTransformerPath = void 0;
2
+ exports.loadDefaultBabelTransformer = exports.getSentryDefaultBabelTransformerPathEnv = exports.setSentryDefaultBabelTransformerPathEnv = exports.SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH = void 0;
3
3
  const utils_1 = require("@sentry/utils");
4
- const fs = require("fs");
5
- const path = require("path");
6
4
  const process = require("process");
5
+ exports.SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH = 'SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH';
7
6
  /**
8
- * Saves default Babel transformer path to the project root.
7
+ * Sets default Babel transformer path to the environment variables.
9
8
  */
10
- function saveDefaultBabelTransformerPath(defaultBabelTransformerPath) {
11
- try {
12
- fs.mkdirSync(path.join(process.cwd(), '.sentry'), { recursive: true });
13
- fs.writeFileSync(getDefaultBabelTransformerPath(), defaultBabelTransformerPath);
14
- utils_1.logger.debug('Saved default Babel transformer path');
15
- }
16
- catch (e) {
17
- // eslint-disable-next-line no-console
18
- console.error('[Sentry] Failed to save default Babel transformer path:', e);
19
- }
20
- }
21
- exports.saveDefaultBabelTransformerPath = saveDefaultBabelTransformerPath;
22
- /**
23
- * Reads default Babel transformer path from the project root.
24
- */
25
- function readDefaultBabelTransformerPath() {
26
- try {
27
- return fs.readFileSync(getDefaultBabelTransformerPath()).toString();
28
- }
29
- catch (e) {
30
- // eslint-disable-next-line no-console
31
- console.error('[Sentry] Failed to read default Babel transformer path:', e);
32
- }
33
- return undefined;
9
+ function setSentryDefaultBabelTransformerPathEnv(defaultBabelTransformerPath) {
10
+ process.env[exports.SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH] = defaultBabelTransformerPath;
11
+ utils_1.logger.debug(`Saved default Babel transformer path ${defaultBabelTransformerPath}`);
34
12
  }
35
- exports.readDefaultBabelTransformerPath = readDefaultBabelTransformerPath;
13
+ exports.setSentryDefaultBabelTransformerPathEnv = setSentryDefaultBabelTransformerPathEnv;
36
14
  /**
37
- * Cleans default Babel transformer path from the project root.
15
+ * Reads default Babel transformer path from the environment variables.
38
16
  */
39
- function cleanDefaultBabelTransformerPath() {
40
- try {
41
- fs.unlinkSync(getDefaultBabelTransformerPath());
42
- utils_1.logger.debug('Cleaned default Babel transformer path');
43
- }
44
- catch (e) {
45
- // We don't want to fail the build if we can't clean the file
46
- // eslint-disable-next-line no-console
47
- console.error('[Sentry] Failed to clean default Babel transformer path:', e);
48
- }
49
- }
50
- exports.cleanDefaultBabelTransformerPath = cleanDefaultBabelTransformerPath;
51
- function getDefaultBabelTransformerPath() {
52
- return path.join(process.cwd(), '.sentry/.defaultBabelTransformerPath');
17
+ function getSentryDefaultBabelTransformerPathEnv() {
18
+ return process.env[exports.SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH];
53
19
  }
20
+ exports.getSentryDefaultBabelTransformerPathEnv = getSentryDefaultBabelTransformerPathEnv;
54
21
  /**
55
22
  * Loads default Babel transformer from `@react-native/metro-config` -> `@react-native/metro-babel-transformer`.
56
23
  */
57
24
  function loadDefaultBabelTransformer() {
58
- const defaultBabelTransformerPath = readDefaultBabelTransformerPath();
25
+ const defaultBabelTransformerPath = getSentryDefaultBabelTransformerPathEnv();
59
26
  if (!defaultBabelTransformerPath) {
60
- throw new Error('Default Babel Transformer Path not found in `.sentry` directory.');
27
+ throw new Error(`Default Babel transformer path environment variable ${exports.SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH} is not set.`);
61
28
  }
62
29
  utils_1.logger.debug(`Loading default Babel transformer from ${defaultBabelTransformerPath}`);
63
30
  // eslint-disable-next-line @typescript-eslint/no-var-requires
@@ -1 +1 @@
1
- {"version":3,"file":"sentryBabelTransformerUtils.js","s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AAC,GAAG,EAAE,EAAE,sCAAsC,CAAC,CAAC;AAC1E,CAAC;AAED;;GAEG;AACH,SAAgB,2BAA2B;IACzC,MAAM,2BAA2B,GAAG,+BAA+B,EAAE,CAAC;IACtE,IAAI,CAAC,2BAA2B,EAAE;QAChC,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;KACrF;IAED,cAAM,CAAC,KAAK,CAAC,0CAA0C,2BAA2B,EAAE,CAAC,CAAC;IACtF,8DAA8D;IAC9D,OAAO,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAC9C,CAAC;AATD,kEASC","sourcesContent":["import { logger } from '@sentry/utils';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as process from 'process';\n\nimport type { BabelTransformer } from './vendor/metro/metroBabelTransformer';\n\n/**\n * Saves default Babel transformer path to the project root.\n */\nexport function saveDefaultBabelTransformerPath(defaultBabelTransformerPath: string): void {\n try {\n fs.mkdirSync(path.join(process.cwd(), '.sentry'), { recursive: true });\n fs.writeFileSync(getDefaultBabelTransformerPath(), defaultBabelTransformerPath);\n logger.debug('Saved default Babel transformer path');\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Failed to save default Babel transformer path:', e);\n }\n}\n\n/**\n * Reads default Babel transformer path from the project root.\n */\nexport function readDefaultBabelTransformerPath(): string | undefined {\n try {\n return fs.readFileSync(getDefaultBabelTransformerPath()).toString();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Failed to read default Babel transformer path:', e);\n }\n return undefined;\n}\n\n/**\n * Cleans default Babel transformer path from the project root.\n */\nexport function cleanDefaultBabelTransformerPath(): void {\n try {\n fs.unlinkSync(getDefaultBabelTransformerPath());\n logger.debug('Cleaned default Babel transformer path');\n } catch (e) {\n // We don't want to fail the build if we can't clean the file\n // eslint-disable-next-line no-console\n console.error('[Sentry] Failed to clean default Babel transformer path:', e);\n }\n}\n\nfunction getDefaultBabelTransformerPath(): string {\n return path.join(process.cwd(), '.sentry/.defaultBabelTransformerPath');\n}\n\n/**\n * Loads default Babel transformer from `@react-native/metro-config` -> `@react-native/metro-babel-transformer`.\n */\nexport function loadDefaultBabelTransformer(): BabelTransformer {\n const defaultBabelTransformerPath = readDefaultBabelTransformerPath();\n if (!defaultBabelTransformerPath) {\n throw new Error('Default Babel Transformer Path not found in `.sentry` directory.');\n }\n\n logger.debug(`Loading default Babel transformer from ${defaultBabelTransformerPath}`);\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(defaultBabelTransformerPath);\n}\n"]}
1
+ {"version":3,"file":"sentryBabelTransformerUtils.js","sourceRoot":"","sources":["../../../src/js/tools/sentryBabelTransformerUtils.ts"],"names":[],"mappings":";;AAAA,yCAAuC;AACvC,mCAAmC;AAItB,QAAA,qCAAqC,GAAG,uCAAuC,CAAC;AAE7F;;GAEG;AACH,SAAgB,uCAAuC,CAAC,2BAAmC;IACzF,OAAO,CAAC,GAAG,CAAC,6CAAqC,CAAC,GAAG,2BAA2B,CAAC;IACjF,cAAM,CAAC,KAAK,CAAC,wCAAwC,2BAA2B,EAAE,CAAC,CAAC;AACtF,CAAC;AAHD,0FAGC;AAED;;GAEG;AACH,SAAgB,uCAAuC;IACrD,OAAO,OAAO,CAAC,GAAG,CAAC,6CAAqC,CAAC,CAAC;AAC5D,CAAC;AAFD,0FAEC;AAED;;GAEG;AACH,SAAgB,2BAA2B;IACzC,MAAM,2BAA2B,GAAG,uCAAuC,EAAE,CAAC;IAC9E,IAAI,CAAC,2BAA2B,EAAE;QAChC,MAAM,IAAI,KAAK,CACb,uDAAuD,6CAAqC,cAAc,CAC3G,CAAC;KACH;IAED,cAAM,CAAC,KAAK,CAAC,0CAA0C,2BAA2B,EAAE,CAAC,CAAC;IACtF,8DAA8D;IAC9D,OAAO,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAC9C,CAAC;AAXD,kEAWC","sourcesContent":["import { logger } from '@sentry/utils';\nimport * as process from 'process';\n\nimport type { BabelTransformer } from './vendor/metro/metroBabelTransformer';\n\nexport const SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH = 'SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH';\n\n/**\n * Sets default Babel transformer path to the environment variables.\n */\nexport function setSentryDefaultBabelTransformerPathEnv(defaultBabelTransformerPath: string): void {\n process.env[SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH] = defaultBabelTransformerPath;\n logger.debug(`Saved default Babel transformer path ${defaultBabelTransformerPath}`);\n}\n\n/**\n * Reads default Babel transformer path from the environment variables.\n */\nexport function getSentryDefaultBabelTransformerPathEnv(): string | undefined {\n return process.env[SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH];\n}\n\n/**\n * Loads default Babel transformer from `@react-native/metro-config` -> `@react-native/metro-babel-transformer`.\n */\nexport function loadDefaultBabelTransformer(): BabelTransformer {\n const defaultBabelTransformerPath = getSentryDefaultBabelTransformerPathEnv();\n if (!defaultBabelTransformerPath) {\n throw new Error(\n `Default Babel transformer path environment variable ${SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH} is not set.`,\n );\n }\n\n logger.debug(`Loading default Babel transformer from ${defaultBabelTransformerPath}`);\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return require(defaultBabelTransformerPath);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "6.3.0-beta.2";
3
+ export declare const SDK_VERSION = "6.4.0-beta.1";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
2
2
  export const SDK_NAME = 'sentry.javascript.react-native';
3
- export const SDK_VERSION = '6.3.0-beta.2';
3
+ export const SDK_VERSION = '6.4.0-beta.1';
4
4
  //# sourceMappingURL=version.js.map
@@ -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,cAAc,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '6.3.0-beta.2';\n"]}
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,cAAc,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '6.4.0-beta.1';\n"]}
@@ -5,4 +5,8 @@
5
5
 
6
6
  + (void)postInit;
7
7
 
8
+ + (Class)getMaskClass;
9
+
10
+ + (Class)getUnmaskClass;
11
+
8
12
  @end
@@ -1,5 +1,9 @@
1
1
  #import "RNSentryReplay.h"
2
- #import "RNSentryReplayBreadcrumbConverter.h"
2
+ #import "RNSentryReplayBreadcrumbConverterHelper.h"
3
+ #import "React/RCTTextView.h"
4
+ #import "Replay/RNSentryReplayMask.h"
5
+ #import "Replay/RNSentryReplayUnmask.h"
6
+ #import <Sentry/PrivateSentrySDKOnly.h>
3
7
 
4
8
  #if SENTRY_TARGET_REPLAY_SUPPORTED
5
9
 
@@ -56,9 +60,21 @@
56
60
 
57
61
  + (void)postInit
58
62
  {
59
- RNSentryReplayBreadcrumbConverter *breadcrumbConverter =
60
- [[RNSentryReplayBreadcrumbConverter alloc] init];
61
- [PrivateSentrySDKOnly configureSessionReplayWith:breadcrumbConverter screenshotProvider:nil];
63
+ // We can't import RNSentryReplayMask.h here because it's Objective-C++
64
+ // To avoid typos, we test the class existence in the tests
65
+ [PrivateSentrySDKOnly setRedactContainerClass:[RNSentryReplay getMaskClass]];
66
+ [PrivateSentrySDKOnly setIgnoreContainerClass:[RNSentryReplay getUnmaskClass]];
67
+ [RNSentryReplayBreadcrumbConverterHelper configureSessionReplayWithConverter];
68
+ }
69
+
70
+ + (Class)getMaskClass
71
+ {
72
+ return RNSentryReplayMask.class;
73
+ }
74
+
75
+ + (Class)getUnmaskClass
76
+ {
77
+ return RNSentryReplayUnmask.class;
62
78
  }
63
79
 
64
80
  @end
@@ -0,0 +1,7 @@
1
+ #import <Sentry/SentryDefines.h>
2
+
3
+ @interface RNSentryReplayBreadcrumbConverterHelper : NSObject
4
+
5
+ + (void)configureSessionReplayWithConverter;
6
+
7
+ @end
@@ -0,0 +1,17 @@
1
+ #import "RNSentryReplayBreadcrumbConverterHelper.h"
2
+
3
+ #if SENTRY_TARGET_REPLAY_SUPPORTED
4
+ # import "RNSentryReplayBreadcrumbConverter.h"
5
+
6
+ @implementation RNSentryReplayBreadcrumbConverterHelper
7
+
8
+ + (void)configureSessionReplayWithConverter
9
+ {
10
+ RNSentryReplayBreadcrumbConverter *breadcrumbConverter =
11
+ [[RNSentryReplayBreadcrumbConverter alloc] init];
12
+ [PrivateSentrySDKOnly configureSessionReplayWith:breadcrumbConverter screenshotProvider:nil];
13
+ }
14
+
15
+ @end
16
+
17
+ #endif
@@ -0,0 +1,24 @@
1
+ #import <Sentry/SentryDefines.h>
2
+
3
+ #if SENTRY_HAS_UIKIT
4
+
5
+ # import <React/RCTViewManager.h>
6
+
7
+ # ifdef RCT_NEW_ARCH_ENABLED
8
+ # import <React/RCTViewComponentView.h>
9
+ # else
10
+ # import <React/RCTView.h>
11
+ # endif
12
+
13
+ @interface RNSentryReplayMaskManager : RCTViewManager
14
+ @end
15
+
16
+ @interface RNSentryReplayMask :
17
+ # ifdef RCT_NEW_ARCH_ENABLED
18
+ RCTViewComponentView
19
+ # else
20
+ RCTView
21
+ # endif
22
+ @end
23
+
24
+ #endif
@@ -0,0 +1,51 @@
1
+ #import <Sentry/SentryDefines.h>
2
+
3
+ #if SENTRY_HAS_UIKIT
4
+
5
+ # import "RNSentryReplayMask.h"
6
+
7
+ # ifdef RCT_NEW_ARCH_ENABLED
8
+ # import <react/renderer/components/RNSentrySpec/ComponentDescriptors.h>
9
+ # import <react/renderer/components/RNSentrySpec/RCTComponentViewHelpers.h>
10
+ // RCTFabricComponentsPlugins needed for RNSentryReplayMaskCls
11
+ # import <React/RCTFabricComponentsPlugins.h>
12
+ # endif
13
+
14
+ @implementation RNSentryReplayMaskManager
15
+
16
+ RCT_EXPORT_MODULE(RNSentryReplayMask)
17
+
18
+ - (UIView *)view
19
+ {
20
+ return [RNSentryReplayMask new];
21
+ }
22
+
23
+ @end
24
+
25
+ # ifdef RCT_NEW_ARCH_ENABLED
26
+ @interface
27
+ RNSentryReplayMask () <RCTRNSentryReplayMaskViewProtocol>
28
+ @end
29
+ # endif
30
+
31
+ @implementation RNSentryReplayMask
32
+
33
+ # ifdef RCT_NEW_ARCH_ENABLED
34
+ + (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider
35
+ {
36
+ return facebook::react::concreteComponentDescriptorProvider<
37
+ facebook::react::RNSentryReplayMaskComponentDescriptor>();
38
+ }
39
+ # endif
40
+
41
+ @end
42
+
43
+ # ifdef RCT_NEW_ARCH_ENABLED
44
+ Class<RCTComponentViewProtocol>
45
+ RNSentryReplayMaskCls(void)
46
+ {
47
+ return RNSentryReplayMask.class;
48
+ }
49
+ # endif
50
+
51
+ #endif
@@ -0,0 +1,24 @@
1
+ #import <Sentry/SentryDefines.h>
2
+
3
+ #if SENTRY_HAS_UIKIT
4
+
5
+ # import <React/RCTViewManager.h>
6
+
7
+ # ifdef RCT_NEW_ARCH_ENABLED
8
+ # import <React/RCTViewComponentView.h>
9
+ # else
10
+ # import <React/RCTView.h>
11
+ # endif
12
+
13
+ @interface RNSentryReplayUnmaskManager : RCTViewManager
14
+ @end
15
+
16
+ @interface RNSentryReplayUnmask :
17
+ # ifdef RCT_NEW_ARCH_ENABLED
18
+ RCTViewComponentView
19
+ # else
20
+ RCTView
21
+ # endif
22
+ @end
23
+
24
+ #endif
@@ -0,0 +1,51 @@
1
+ #import <Sentry/SentryDefines.h>
2
+
3
+ #if SENTRY_HAS_UIKIT
4
+
5
+ # import "RNSentryReplayUnmask.h"
6
+
7
+ # ifdef RCT_NEW_ARCH_ENABLED
8
+ # import <react/renderer/components/RNSentrySpec/ComponentDescriptors.h>
9
+ # import <react/renderer/components/RNSentrySpec/RCTComponentViewHelpers.h>
10
+ // RCTFabricComponentsPlugins needed for RNSentryReplayUnmaskCls
11
+ # import <React/RCTFabricComponentsPlugins.h>
12
+ # endif
13
+
14
+ @implementation RNSentryReplayUnmaskManager
15
+
16
+ RCT_EXPORT_MODULE(RNSentryReplayUnmask)
17
+
18
+ - (UIView *)view
19
+ {
20
+ return [RNSentryReplayUnmask new];
21
+ }
22
+
23
+ @end
24
+
25
+ # ifdef RCT_NEW_ARCH_ENABLED
26
+ @interface
27
+ RNSentryReplayUnmask () <RCTRNSentryReplayUnmaskViewProtocol>
28
+ @end
29
+ # endif
30
+
31
+ @implementation RNSentryReplayUnmask
32
+
33
+ # ifdef RCT_NEW_ARCH_ENABLED
34
+ + (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider
35
+ {
36
+ return facebook::react::concreteComponentDescriptorProvider<
37
+ facebook::react::RNSentryReplayUnmaskComponentDescriptor>();
38
+ }
39
+ # endif
40
+
41
+ @end
42
+
43
+ # ifdef RCT_NEW_ARCH_ENABLED
44
+ Class<RCTComponentViewProtocol>
45
+ RNSentryReplayUnmaskCls(void)
46
+ {
47
+ return RNSentryReplayUnmask.class;
48
+ }
49
+ # endif
50
+
51
+ #endif
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sentry/react-native",
3
3
  "homepage": "https://github.com/getsentry/sentry-react-native",
4
4
  "repository": "https://github.com/getsentry/sentry-react-native",
5
- "version": "6.3.0-beta.2",
5
+ "version": "6.4.0-beta.1",
6
6
  "description": "Official Sentry SDK for react-native",
7
7
  "typings": "dist/js/index.d.ts",
8
8
  "types": "dist/js/index.d.ts",
@@ -66,21 +66,21 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@sentry/babel-plugin-component-annotate": "2.20.1",
69
- "@sentry/browser": "8.38.0",
69
+ "@sentry/browser": "8.40.0",
70
70
  "@sentry/cli": "2.38.2",
71
- "@sentry/core": "8.38.0",
72
- "@sentry/react": "8.38.0",
73
- "@sentry/types": "8.38.0",
74
- "@sentry/utils": "8.38.0"
71
+ "@sentry/core": "8.40.0",
72
+ "@sentry/react": "8.40.0",
73
+ "@sentry/types": "8.40.0",
74
+ "@sentry/utils": "8.40.0"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@babel/core": "^7.23.5",
78
78
  "@expo/metro-config": "0.17.5",
79
79
  "@mswjs/interceptors": "^0.25.15",
80
80
  "@react-native/babel-preset": "0.75.4",
81
- "@sentry-internal/eslint-config-sdk": "8.38.0",
82
- "@sentry-internal/eslint-plugin-sdk": "8.38.0",
83
- "@sentry-internal/typescript": "8.38.0",
81
+ "@sentry-internal/eslint-config-sdk": "8.40.0",
82
+ "@sentry-internal/eslint-plugin-sdk": "8.40.0",
83
+ "@sentry-internal/typescript": "8.40.0",
84
84
  "@sentry/wizard": "3.34.4",
85
85
  "@testing-library/react-native": "^12.7.2",
86
86
  "@types/jest": "^29.5.3",
@@ -118,7 +118,7 @@
118
118
  },
119
119
  "codegenConfig": {
120
120
  "name": "RNSentrySpec",
121
- "type": "modules",
121
+ "type": "all",
122
122
  "jsSrcsDir": "src",
123
123
  "android": {
124
124
  "javaPackageName": "io.sentry.react"
@@ -0,0 +1,10 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ // The default export exists in the file but eslint doesn't see it
3
+ // eslint-disable-next-line import/default
4
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
5
+
6
+ // If changed to type NativeProps = ViewProps, react native codegen will fail finding the NativeProps type
7
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
8
+ export interface NativeProps extends ViewProps {}
9
+
10
+ export default codegenNativeComponent<NativeProps>('RNSentryReplayMask') as HostComponent<NativeProps>;
@@ -0,0 +1,10 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ // The default export exists in the file but eslint doesn't see it
3
+ // eslint-disable-next-line import/default
4
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
5
+
6
+ // If changed to type NativeProps = ViewProps, react native codegen will fail finding the NativeProps type
7
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
8
+ export interface NativeProps extends ViewProps {}
9
+
10
+ export default codegenNativeComponent<NativeProps>('RNSentryReplayUnmask') as HostComponent<NativeProps>;
@@ -0,0 +1,6 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ export interface NativeProps extends ViewProps {
3
+ }
4
+ declare const _default: HostComponent<NativeProps>;
5
+ export default _default;
6
+ //# sourceMappingURL=RNSentryReplayMaskNativeComponent.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ export interface NativeProps extends ViewProps {
3
+ }
4
+ declare const _default: HostComponent<NativeProps>;
5
+ export default _default;
6
+ //# sourceMappingURL=RNSentryReplayUnmaskNativeComponent.d.ts.map
@@ -9,4 +9,5 @@ export { init, wrap, nativeCrash, flush, close, captureUserFeedback, withScope,
9
9
  export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
10
10
  export { reactNativeTracingIntegration, getCurrentReactNativeTracingIntegration, getReactNativeTracingIntegration, reactNavigationIntegration, reactNativeNavigationIntegration, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, startIdleNavigationSpan, startIdleSpan, getDefaultIdleNavigationSpanOptions, } from './tracing';
11
11
  export type { TimeToDisplayProps } from './tracing';
12
+ export { Mask, Unmask } from './replay/CustomMask';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -13,10 +13,11 @@ export { viewHierarchyIntegration } from './viewhierarchy';
13
13
  export { expoContextIntegration } from './expocontext';
14
14
  export { spotlightIntegration } from './spotlight';
15
15
  export { mobileReplayIntegration } from '../replay/mobilereplay';
16
+ export { browserReplayIntegration } from '../replay/browserReplay';
16
17
  export { appStartIntegration } from '../tracing/integrations/appStart';
17
18
  export { nativeFramesIntegration, createNativeFramesIntegrations } from '../tracing/integrations/nativeFrames';
18
19
  export { stallTrackingIntegration } from '../tracing/integrations/stalltracking';
19
20
  export { userInteractionIntegration } from '../tracing/integrations/userInteraction';
20
21
  export { createReactNativeRewriteFrames } from './rewriteframes';
21
- export { breadcrumbsIntegration, browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, replayIntegration as browserReplayIntegration, } from '@sentry/react';
22
+ export { breadcrumbsIntegration, browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, } from '@sentry/react';
22
23
  //# sourceMappingURL=exports.d.ts.map
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type { HostComponent, ViewProps } from 'react-native';
3
+ declare const MaskFallback: (viewProps: ViewProps) => React.ReactElement;
4
+ declare const UnmaskFallback: (viewProps: ViewProps) => React.ReactElement;
5
+ declare const Mask: HostComponent<ViewProps> | React.ComponentType<ViewProps>;
6
+ declare const Unmask: HostComponent<ViewProps> | React.ComponentType<ViewProps>;
7
+ export { Mask, Unmask, MaskFallback, UnmaskFallback };
8
+ //# sourceMappingURL=CustomMask.d.ts.map
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import type { ViewProps } from 'react-native';
3
+ declare const Mask: (props: ViewProps) => React.ReactElement;
4
+ declare const Unmask: (props: ViewProps) => React.ReactElement;
5
+ export { Mask, Unmask };
6
+ //# sourceMappingURL=CustomMask.web.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { replayIntegration } from '@sentry/react';
2
+ declare const browserReplayIntegration: (options?: Parameters<typeof replayIntegration>[0]) => ReturnType<typeof replayIntegration>;
3
+ export { browserReplayIntegration };
4
+ //# sourceMappingURL=browserReplay.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 = "6.3.0-beta.2";
3
+ export declare const SDK_VERSION = "6.4.0-beta.1";
4
4
  //# sourceMappingURL=version.d.ts.map