@bugsee/react-native 0.0.0-stage → 7.0.0-beta2

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 (250) hide show
  1. package/BugseeReactNative.podspec +95 -0
  2. package/LICENSE +21 -0
  3. package/README.md +557 -2
  4. package/android/build.gradle +162 -0
  5. package/android/consumer-rules.pro +2 -0
  6. package/android/src/main/AndroidManifest.xml +33 -0
  7. package/android/src/main/java/com/bugsee/reactnative/AppearanceBridge.java +82 -0
  8. package/android/src/main/java/com/bugsee/reactnative/AttributeBridge.java +209 -0
  9. package/android/src/main/java/com/bugsee/reactnative/BreadcrumbFilterBridge.java +443 -0
  10. package/android/src/main/java/com/bugsee/reactnative/BridgeJson.java +168 -0
  11. package/android/src/main/java/com/bugsee/reactnative/BugseeModule.java +1869 -0
  12. package/android/src/main/java/com/bugsee/reactnative/BugseeOptionEnums.java +136 -0
  13. package/android/src/main/java/com/bugsee/reactnative/BugseePackage.java +42 -0
  14. package/android/src/main/java/com/bugsee/reactnative/BugseeReactNativeWrapper.java +200 -0
  15. package/android/src/main/java/com/bugsee/reactnative/BugseeStatusMapper.java +66 -0
  16. package/android/src/main/java/com/bugsee/reactnative/BugseeTokens.java +22 -0
  17. package/android/src/main/java/com/bugsee/reactnative/ConsoleEchoDedup.java +202 -0
  18. package/android/src/main/java/com/bugsee/reactnative/CreatedReports.java +127 -0
  19. package/android/src/main/java/com/bugsee/reactnative/DataRequestBridge.java +375 -0
  20. package/android/src/main/java/com/bugsee/reactnative/ExceptionBridge.java +88 -0
  21. package/android/src/main/java/com/bugsee/reactnative/ExceptionExecutors.java +33 -0
  22. package/android/src/main/java/com/bugsee/reactnative/LogFilterBridge.java +375 -0
  23. package/android/src/main/java/com/bugsee/reactnative/NetworkEvents.java +227 -0
  24. package/android/src/main/java/com/bugsee/reactnative/NetworkFilterBridge.java +498 -0
  25. package/android/src/main/java/com/bugsee/reactnative/PluginEndpoint.java +48 -0
  26. package/android/src/main/java/com/bugsee/reactnative/ReactNativeWebException.java +19 -0
  27. package/android/src/main/java/com/bugsee/reactnative/ReactNativeWrapperInitProvider.java +61 -0
  28. package/android/src/main/java/com/bugsee/reactnative/ReactRootOriginTracker.java +867 -0
  29. package/android/src/main/java/com/bugsee/reactnative/ReportArgs.java +58 -0
  30. package/android/src/main/java/com/bugsee/reactnative/ReportHandlerBridge.java +336 -0
  31. package/android/src/main/java/com/bugsee/reactnative/ReportHandlerDeadlines.java +57 -0
  32. package/android/src/main/java/com/bugsee/reactnative/ReportOps.java +287 -0
  33. package/android/src/main/java/com/bugsee/reactnative/SecureRectanglePulls.java +113 -0
  34. package/android/src/main/java/com/bugsee/reactnative/SecureRectangleStore.java +692 -0
  35. package/android/src/main/java/com/bugsee/reactnative/SpanHandles.java +143 -0
  36. package/android/src/main/java/com/bugsee/reactnative/WrapperChannelHolder.java +137 -0
  37. package/android/src/main/java/com/bugsee/reactnative/WrapperEventBus.java +110 -0
  38. package/android/src/main/java/com/bugsee/reactnative/WrapperRegistrar.java +54 -0
  39. package/app.plugin.js +4 -0
  40. package/ios/BGSRNConsoleCapture.h +52 -0
  41. package/ios/BGSRNConsoleCapture.mm +344 -0
  42. package/ios/BugseeModule.h +25 -0
  43. package/ios/BugseeModule.mm +2728 -0
  44. package/ios/Package.swift +71 -0
  45. package/ios/Support/Package.resolved +14 -0
  46. package/ios/Support/Package.swift +44 -0
  47. package/ios/Support/Sources/BugseeRNSupport/BGSRNAttributes.m +52 -0
  48. package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReportOps.m +236 -0
  49. package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReports.m +184 -0
  50. package/ios/Support/Sources/BugseeRNSupport/BGSRNDataRequestBridge.m +431 -0
  51. package/ios/Support/Sources/BugseeRNSupport/BGSRNErrorMessage.m +40 -0
  52. package/ios/Support/Sources/BugseeRNSupport/BGSRNEventBus.m +70 -0
  53. package/ios/Support/Sources/BugseeRNSupport/BGSRNExceptions.m +63 -0
  54. package/ios/Support/Sources/BugseeRNSupport/BGSRNGuardedEmit.mm +32 -0
  55. package/ios/Support/Sources/BugseeRNSupport/BGSRNJSON.m +40 -0
  56. package/ios/Support/Sources/BugseeRNSupport/BGSRNLaunchHold.m +147 -0
  57. package/ios/Support/Sources/BugseeRNSupport/BGSRNMainThread.m +23 -0
  58. package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkEvents.m +159 -0
  59. package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkFilter.m +155 -0
  60. package/ios/Support/Sources/BugseeRNSupport/BGSRNPluginEndpoint.m +21 -0
  61. package/ios/Support/Sources/BugseeRNSupport/BGSRNReactRootOriginTracker.m +63 -0
  62. package/ios/Support/Sources/BugseeRNSupport/BGSRNReactWindow.m +251 -0
  63. package/ios/Support/Sources/BugseeRNSupport/BGSRNReportArgs.m +47 -0
  64. package/ios/Support/Sources/BugseeRNSupport/BGSRNReportDeadlines.m +8 -0
  65. package/ios/Support/Sources/BugseeRNSupport/BGSRNReportHandlerBridge.m +308 -0
  66. package/ios/Support/Sources/BugseeRNSupport/BGSRNReportOps.m +345 -0
  67. package/ios/Support/Sources/BugseeRNSupport/BGSRNSecureRectangles.m +508 -0
  68. package/ios/Support/Sources/BugseeRNSupport/BGSRNSettleOnce.m +62 -0
  69. package/ios/Support/Sources/BugseeRNSupport/BGSRNSpanHandles.m +136 -0
  70. package/ios/Support/Sources/BugseeRNSupport/BGSRNStatusMapper.m +18 -0
  71. package/ios/Support/Sources/BugseeRNSupport/BGSRNTokens.m +9 -0
  72. package/ios/Support/Sources/BugseeRNSupport/BGSRNValues.m +5 -0
  73. package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapper.m +54 -0
  74. package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapperChannelHolder.m +59 -0
  75. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNAttributes.h +63 -0
  76. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReportOps.h +51 -0
  77. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReports.h +81 -0
  78. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNDataRequestBridge.h +118 -0
  79. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNErrorMessage.h +30 -0
  80. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNEventBus.h +45 -0
  81. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNExceptions.h +31 -0
  82. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNGuardedEmit.h +31 -0
  83. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNJSON.h +25 -0
  84. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNLaunchHold.h +86 -0
  85. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNMainThread.h +32 -0
  86. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkEvents.h +28 -0
  87. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkFilter.h +28 -0
  88. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNPluginEndpoint.h +17 -0
  89. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactRootOriginTracker.h +48 -0
  90. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactWindow.h +135 -0
  91. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportArgs.h +17 -0
  92. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportDeadlines.h +37 -0
  93. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportHandlerBridge.h +94 -0
  94. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h +86 -0
  95. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSecureRectangles.h +198 -0
  96. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSettleOnce.h +25 -0
  97. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSpanHandles.h +49 -0
  98. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNStatusMapper.h +26 -0
  99. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNTokens.h +14 -0
  100. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNValues.h +18 -0
  101. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapper.h +40 -0
  102. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapperChannelHolder.h +74 -0
  103. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNAttributesTests.m +194 -0
  104. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportOpsTests.m +274 -0
  105. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportsTests.m +240 -0
  106. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNDataRequestBridgeTests.m +685 -0
  107. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNErrorMessageTests.m +102 -0
  108. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNEventBusTests.m +136 -0
  109. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNExceptionsTests.m +68 -0
  110. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h +41 -0
  111. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.m +166 -0
  112. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNGuardedEmitTests.mm +85 -0
  113. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNJSONTests.m +281 -0
  114. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNLaunchHoldTests.m +230 -0
  115. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNMainThreadTests.m +97 -0
  116. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkEventsTests.m +99 -0
  117. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkFilterTests.m +134 -0
  118. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNPluginEndpointTests.m +38 -0
  119. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactRootOriginTrackerTests.m +210 -0
  120. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactWindowTests.m +548 -0
  121. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportArgsTests.m +51 -0
  122. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportDeadlinesTests.m +22 -0
  123. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m +382 -0
  124. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportOpsTests.m +295 -0
  125. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSecureRectanglesTests.m +568 -0
  126. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSettleOnceTests.m +134 -0
  127. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSpanHandlesTests.m +153 -0
  128. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNStatusMapperTests.m +81 -0
  129. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNValuesTests.m +32 -0
  130. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m +205 -0
  131. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperTests.m +66 -0
  132. package/ios/react-native-spm-prefix.h +10 -0
  133. package/native-versions.json +10 -0
  134. package/package.json +62 -3
  135. package/plugin/build/bundle-phase.d.ts +41 -0
  136. package/plugin/build/bundle-phase.js +116 -0
  137. package/plugin/build/bundle-phase.js.map +1 -0
  138. package/plugin/build/dsym-script.d.ts +32 -0
  139. package/plugin/build/dsym-script.js +159 -0
  140. package/plugin/build/dsym-script.js.map +1 -0
  141. package/plugin/build/endpoint.d.ts +30 -0
  142. package/plugin/build/endpoint.js +69 -0
  143. package/plugin/build/endpoint.js.map +1 -0
  144. package/plugin/build/gradle.d.ts +65 -0
  145. package/plugin/build/gradle.js +1066 -0
  146. package/plugin/build/gradle.js.map +1 -0
  147. package/plugin/build/index.d.ts +85 -0
  148. package/plugin/build/index.js +217 -0
  149. package/plugin/build/index.js.map +1 -0
  150. package/plugin/build/manifest.d.ts +48 -0
  151. package/plugin/build/manifest.js +69 -0
  152. package/plugin/build/manifest.js.map +1 -0
  153. package/plugin/build/native-versions.baked.json +4 -0
  154. package/plugin/build/native-versions.d.ts +10 -0
  155. package/plugin/build/native-versions.js +27 -0
  156. package/plugin/build/native-versions.js.map +1 -0
  157. package/plugin/build/pbx-string.d.ts +8 -0
  158. package/plugin/build/pbx-string.js +31 -0
  159. package/plugin/build/pbx-string.js.map +1 -0
  160. package/plugin/build/podfile.d.ts +3 -0
  161. package/plugin/build/podfile.js +28 -0
  162. package/plugin/build/podfile.js.map +1 -0
  163. package/plugin/build/properties.d.ts +19 -0
  164. package/plugin/build/properties.js +41 -0
  165. package/plugin/build/properties.js.map +1 -0
  166. package/plugin/build/scheme.d.ts +20 -0
  167. package/plugin/build/scheme.js +107 -0
  168. package/plugin/build/scheme.js.map +1 -0
  169. package/react-native.config.js +26 -0
  170. package/scripts/bugsee-sourcemaps.gradle +201 -0
  171. package/scripts/bugsee-xcode.sh +83 -0
  172. package/scripts/compose-then-inject.js +113 -0
  173. package/scripts/hermes-sourcemaps.js +634 -0
  174. package/scripts/hermesc-preserve-js.cmd +6 -0
  175. package/scripts/hermesc-preserve-js.js +200 -0
  176. package/scripts/hermesc-preserve-js.sh +7 -0
  177. package/src/NativeBugsee.ts +622 -0
  178. package/src/apm/notify.ts +58 -0
  179. package/src/apm/span.ts +403 -0
  180. package/src/apm/types.ts +57 -0
  181. package/src/appearance/report.ts +171 -0
  182. package/src/architecture.ts +48 -0
  183. package/src/attributes/errors.ts +39 -0
  184. package/src/attributes/validate.ts +150 -0
  185. package/src/breadcrumbs/add.ts +58 -0
  186. package/src/breadcrumbs/data.ts +33 -0
  187. package/src/breadcrumbs/filter.ts +215 -0
  188. package/src/breadcrumbs/types.ts +64 -0
  189. package/src/bridge/json.ts +110 -0
  190. package/src/console/capture.ts +180 -0
  191. package/src/console/dedup.ts +175 -0
  192. package/src/data/validate.ts +259 -0
  193. package/src/errorName.ts +32 -0
  194. package/src/exceptions/ErrorBoundary.tsx +92 -0
  195. package/src/exceptions/RootErrorReporter.tsx +61 -0
  196. package/src/exceptions/debugIds.ts +118 -0
  197. package/src/exceptions/handlers.ts +236 -0
  198. package/src/exceptions/options.ts +85 -0
  199. package/src/exceptions/payload.ts +456 -0
  200. package/src/exceptions/report.ts +170 -0
  201. package/src/exceptions/sha1.ts +148 -0
  202. package/src/exceptions/stack.ts +355 -0
  203. package/src/index.ts +962 -0
  204. package/src/logs/filter.ts +90 -0
  205. package/src/logs/log.ts +36 -0
  206. package/src/network/add.ts +165 -0
  207. package/src/network/filter.ts +198 -0
  208. package/src/options/AndroidLaunchOptions.ts +78 -0
  209. package/src/options/BugseeLaunchOptions.ts +190 -0
  210. package/src/options/IOSLaunchOptions.ts +57 -0
  211. package/src/options/android-options-manifest.json +646 -0
  212. package/src/options/createDefaultLaunchOptions.ts +29 -0
  213. package/src/options/endpoint.ts +58 -0
  214. package/src/options/enums.ts +104 -0
  215. package/src/options/ios-enums.json +19 -0
  216. package/src/options/keys.ts +39 -0
  217. package/src/options/option-enums.json +34 -0
  218. package/src/options/option-keys.json +107 -0
  219. package/src/report/BugseeReport.ts +264 -0
  220. package/src/report/CreatedReport.ts +127 -0
  221. package/src/report/dispatcher.ts +95 -0
  222. package/src/report/errors.ts +48 -0
  223. package/src/report/fields.ts +40 -0
  224. package/src/report/types.ts +157 -0
  225. package/src/report/validate.ts +197 -0
  226. package/src/secure/BugseeSecure.tsx +202 -0
  227. package/src/secure/ancestry.ts +622 -0
  228. package/src/secure/drivers.ts +342 -0
  229. package/src/secure/followEvents.ts +57 -0
  230. package/src/secure/hold.ts +99 -0
  231. package/src/secure/measureLoop.ts +323 -0
  232. package/src/secure/nativeAnimation.ts +1005 -0
  233. package/src/secure/rectangles.ts +93 -0
  234. package/src/secure/registry.ts +237 -0
  235. package/src/secure/surface.ts +83 -0
  236. package/src/secure/tracker.ts +723 -0
  237. package/src/secure/transition.ts +488 -0
  238. package/src/secure/unit.ts +22 -0
  239. package/src/status.ts +16 -0
  240. package/src/version.ts +9 -0
  241. package/src/viewtree/anchor.tsx +105 -0
  242. package/src/viewtree/constants.ts +20 -0
  243. package/src/viewtree/fiber.ts +251 -0
  244. package/src/viewtree/requests.ts +347 -0
  245. package/src/viewtree/walk.ts +902 -0
  246. package/src/wrapper/channel.ts +33 -0
  247. package/src/wrapper/collect.ts +52 -0
  248. package/src/wrapper/events.ts +45 -0
  249. package/src/wrapper/identity.ts +54 -0
  250. package/src/wrapper/lifecycle-events.ts +89 -0
@@ -0,0 +1,95 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+ # The one source of every native pin. In this repo it is the root file. In an
5
+ # app the package sits in node_modules, where the root file is not above it, so
6
+ # prepack ships a copy at the package root (scripts/pack-native-versions.ts);
7
+ # that copy is read first.
8
+ native_versions_file = [
9
+ File.join(__dir__, 'native-versions.json'),
10
+ File.join(__dir__, '..', '..', 'native-versions.json'),
11
+ ].find { |path| File.file?(path) }
12
+ raise "native-versions.json not found in #{__dir__} or the repo root above it" unless native_versions_file
13
+ native = JSON.parse(File.read(native_versions_file))
14
+
15
+ Pod::Spec.new do |s|
16
+ s.name = 'BugseeReactNative'
17
+ s.version = package['version']
18
+ s.summary = package['description']
19
+ s.homepage = package['homepage']
20
+ # No :file — the path would be resolved against this package's directory as
21
+ # the autolinker symlinks it into an app's node_modules, so `../../LICENSE`
22
+ # lands in <app>/node_modules/LICENSE and CocoaPods warns it cannot be read.
23
+ s.license = { :type => 'MIT', :text => 'The wrapper is MIT, see LICENSE in the package root. The native Bugsee SDK it bundles is a separate package with its own terms.' }
24
+ s.author = 'Bugsee'
25
+ # React Native's floor, read from React Native, so it tracks whichever
26
+ # version the app is on rather than drifting. RN defines this top-level
27
+ # helper in scripts/react_native_pods.rb, which every RN Podfile requires,
28
+ # so it is in scope by the time CocoaPods evaluates this podspec; the
29
+ # literal is the fallback for evaluation outside an app (`pod spec lint`).
30
+ # Bugsee itself floors at 15.0 (since 7.0.0-beta2; the bugsee/spm manifest
31
+ # declares .iOS(.v15)), just below React Native's 15.1, so React Native's is
32
+ # the floor that binds and an app can never sit lower than this.
33
+ s.platforms = {
34
+ :ios => defined?(min_ios_version_supported) ? min_ios_version_supported : '15.1'
35
+ }
36
+ s.source = { :path => '.' }
37
+
38
+ s.source_files = 'ios/**/*.{h,m,mm}'
39
+ # The SPM package under ios/Support is compiled by SPM on the other delivery
40
+ # path; here its sources are part of this pod, so exclude only its manifest.
41
+ s.exclude_files = 'ios/Support/Package.swift', 'ios/Support/Tests/**/*'
42
+
43
+ # Bugsee is NOT a CocoaPods dependency: nothing is published to trunk, and
44
+ # never will be. What ships on the SPM channel is a plain xcframework zip at
45
+ # a stable URL, so this vendors that same artifact directly.
46
+ #
47
+ # Deliberately NOT `spm_dependency`. That helper attaches the package product
48
+ # to the Pods project target, and nothing then embeds the framework into the
49
+ # app: a static pod fails to link it at all, and a dynamic one links it and
50
+ # ships an app that dyld-crashes on launch. Both were reproduced. CocoaPods
51
+ # does embed and sign a vendored framework correctly, which is the whole
52
+ # reason this path exists.
53
+ s.vendored_frameworks = "Bugsee.xcframework"
54
+ # The cache is keyed by VERSION, not by mere presence. Checking only that a
55
+ # directory exists means a version bump never replaces an already-downloaded
56
+ # xcframework: `pod install` succeeds, CI goes green, and the app ships the
57
+ # previous SDK. The stamp file records what was unpacked.
58
+ s.prepare_command = <<-CMD
59
+ set -e
60
+ VERSION="#{native['ios']['sdk']}"
61
+ STAMP=".bugsee-xcframework-version"
62
+ if [ ! -d "Bugsee.xcframework" ] || [ "$(cat "${STAMP}" 2>/dev/null)" != "${VERSION}" ]; then
63
+ # A download directory of this run's own. A fixed /tmp path is shared by
64
+ # every pod install on the machine: two at once overwrote and deleted
65
+ # each other's archive mid-extract ("bad CRC").
66
+ WORK="$(mktemp -d "${TMPDIR:-/tmp}/bugsee-xcframework.XXXXXX")"
67
+ # Unpacked beside its destination, so the final mv is a rename on one
68
+ # filesystem: a failed download or extract leaves nothing half-written.
69
+ STAGE="$(mktemp -d "./.bugsee-xcframework.XXXXXX")"
70
+ trap 'rm -rf "${WORK}" "${STAGE}"' EXIT
71
+ curl -sSfL -o "${WORK}/Bugsee.zip" \
72
+ "https://download.bugsee.com/sdk/ios/spm/Bugsee-${VERSION}.zip"
73
+ # Only the framework. The archive also carries the iOS SDK's own
74
+ # README.md and LICENSE at its root, and extracting everything drops
75
+ # them into this package -- where npm publishes README.md and LICENSE
76
+ # whatever `files` says. That is how this package came to ship the SDK's
77
+ # CocoaPods instructions and PLCrashReporter's licence.
78
+ unzip -q -o "${WORK}/Bugsee.zip" 'Bugsee.xcframework/*' -d "${STAGE}"
79
+ rm -rf "Bugsee.xcframework"
80
+ mv "${STAGE}/Bugsee.xcframework" "Bugsee.xcframework"
81
+ printf '%s' "${VERSION}" > "${STAMP}"
82
+ fi
83
+ CMD
84
+
85
+ s.requires_arc = true
86
+ # A Swift pod integrated as a static library can only depend on pods that
87
+ # define a module. BugseeReactNativeFeedback does, and this pod is that
88
+ # dependency. Without this, `pod install` stops before it compiles anything.
89
+ s.pod_target_xcconfig = {
90
+ 'DEFINES_MODULE' => 'YES'
91
+ }
92
+ s.dependency 'React-Core'
93
+
94
+ install_modules_dependencies(s) if defined?(install_modules_dependencies)
95
+ end
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bugsee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,558 @@
1
- # Temporary Holding Version
1
+ # @bugsee/react-native
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Bugsee for React Native. Crash, error and bug reports carrying the video,
4
+ network traffic, console logs and traces that led up to them.
5
+
6
+ Wraps the native Bugsee SDKs — it is not a reimplementation — so a report from
7
+ a React Native app is the same report a native app produces, with the JS layer
8
+ added.
9
+
10
+ ## Status: beta
11
+
12
+ This is a beta (`7.0.0-beta2`), built on the 7.x native SDKs, and the iOS SDK it
13
+ bundles is itself a beta. `latest` and `beta` both point at it for now, so a plain
14
+ `yarn add @bugsee/react-native` installs it; the `@beta` form in [Install](#install)
15
+ keeps following betas once a stable release exists. The API can still change
16
+ between betas.
17
+
18
+ It replaces `react-native-bugsee` (6.x), which stays on its own line. The two
19
+ are different packages with different APIs, not an upgrade in place: remove the
20
+ old one and follow this README.
21
+
22
+ ## Requirements
23
+
24
+ | | |
25
+ |---|---|
26
+ | React Native | 0.81 or later, New Architecture enabled |
27
+ | iOS | 15.0 or later |
28
+ | Android | API 21 or later |
29
+ | JavaScript engine | Hermes (React Native's default) |
30
+
31
+ The New Architecture is the default from React Native 0.76. On 0.81 it can
32
+ still be turned off; this package requires it on.
33
+
34
+ Hermes is required; JavaScriptCore (Hermes off) is not supported. React
35
+ Native removed JSC from core in 0.81, and the community package that replaces
36
+ it, `@react-native-community/javascriptcore`, does not work with current React
37
+ Native: its Android JSC cannot parse React Native's own bundle, and its iOS
38
+ build fails on 0.86 and 0.87.
39
+
40
+ ## Install
41
+
42
+ ```sh
43
+ yarn add @bugsee/react-native@beta
44
+ ```
45
+
46
+ `npm install @bugsee/react-native@beta` and `pnpm add @bugsee/react-native@beta` work the
47
+ same way.
48
+
49
+ **iOS.** React Native 0.87 and later resolve the SDK through Swift Package
50
+ Manager. Earlier versions use CocoaPods, where the podspec vendors the same
51
+ XCFramework — run `pod install` as usual. Nothing is published to CocoaPods
52
+ trunk, so no `pod repo update` is needed.
53
+
54
+ **Android.** Autolinking picks the module up, and the app builds and
55
+ launches with no Gradle changes. Release symbolication needs the Bugsee Gradle
56
+ plugin and the source-map hooks: see [Release symbolication](#release-symbolication).
57
+
58
+ **pnpm 10 and later** run no dependency's install script unless the project
59
+ decides, and pnpm 11 fails the install until it does
60
+ (`ERR_PNPM_IGNORED_BUILDS`): `@bugsee/cli`, which uploads symbols and source
61
+ maps, has a `postinstall`. Its binary comes from a platform-specific optional
62
+ dependency, so the script is only a download fallback for registry mirrors
63
+ that lack those packages. Decide in `pnpm-workspace.yaml`:
64
+
65
+ ```yaml
66
+ allowBuilds:
67
+ '@bugsee/cli': false # true only if your registry lacks @bugsee/cli-<platform>
68
+ ```
69
+
70
+ React Native itself also needs `nodeLinker: hoisted` under pnpm.
71
+
72
+ ## Use
73
+
74
+ ```ts
75
+ import Bugsee, { createDefaultLaunchOptions } from '@bugsee/react-native';
76
+
77
+ const options = createDefaultLaunchOptions();
78
+ options.captureLogs = true;
79
+
80
+ await Bugsee.launch('<your app token>', options);
81
+ ```
82
+
83
+ `launch` and `relaunch` take the options object as is. They also accept the plain
84
+ `com.bugsee.option.*` map, for options you build or merge yourself; the object's
85
+ `BugseeLaunchOptions.serialize(options)` returns exactly that map.
86
+
87
+ `launch` resolves to whether the SDK started. It can decline — already
88
+ running, or a token the backend rejects — without that being an error worth
89
+ throwing on. Capture comes up asynchronously, so poll `getStatus()` rather
90
+ than assuming a resolved `launch` means recording has begun.
91
+
92
+ ### Hiding a view from recordings
93
+
94
+ Wrap anything that must never be recorded in `<BugseeSecure>`:
95
+
96
+ ```tsx
97
+ import { BugseeSecure } from '@bugsee/react-native';
98
+
99
+ <BugseeSecure>
100
+ <Text>{accountNumber}</Text>
101
+ </BugseeSecure>
102
+ ```
103
+
104
+ The part of it that is on screen is masked, and taps on it are dropped, while
105
+ it is mounted and `enabled` (default `true`). It follows scrolling, hidden
106
+ screens, react-native-screens push and pop transitions, sliding `<Modal>`s and
107
+ `Animated` transforms driven by the native driver, masking more rather than
108
+ less where it cannot tell exactly. `enabled={false}` unmasks at once; an
109
+ unmount keeps the mask for about half a second, as native may still draw the
110
+ view.
111
+
112
+ Known limits:
113
+
114
+ - Content that mounts in a pushed screen or an opening `<Modal>` after it
115
+ came (behind a spinner), or that is first shown on the screen a pop
116
+ uncovers, is masked for the rest of the transition. When a screen came or
117
+ went is known only if a `<BugseeSecure>` saw it; otherwise the first one to
118
+ look masks as if it happened then (the whole screen, or the Modal's band,
119
+ for under a second).
120
+ - A value a native event drives (an `Animated.event` in an `Animated`
121
+ component's `onScroll` or `onGestureEvent`, or `Animated.attachNativeEvent`,
122
+ which React Native's own ScrollView uses for `stickyHeaderIndices`) moves
123
+ with the scroll or the gesture. What it transforms is masked wherever it can
124
+ be drawn, for as long as the event is attached, idle or not:
125
+ - a clamped interpolation, one whose ends are flat (a swipeable row without
126
+ overshoot), or a `diffClamp`: over its output range;
127
+ - on Android, a ScrollView's `contentOffset`, vertical or horizontal (a
128
+ collapsing or parallax header, a sticky header): over the offsets the
129
+ ScrollView can reach, from its measured content and viewport, plus 64 dp
130
+ either way for a fling's overrun (AOSP flings 6 dp past an end; the
131
+ margin assumes no device flings more than ten times that). A view inside
132
+ the content of the ScrollView whose offset drives it (a sticky header,
133
+ from `stickyHeaderIndices` or a `SectionList`) moves with that content
134
+ too, natively ahead of what JS measures: it is masked over that
135
+ ScrollView's whole viewport;
136
+ - anything else (a gesture's translation through an interpolation that
137
+ extends, an iOS ScrollView, which bounces and can be scrolled anywhere by
138
+ `scrollTo`, a ScrollView in another React root, or under a scale other
139
+ than 1): the whole surface around it, cut by the clipping ancestors above
140
+ it (a list's viewport, say).
141
+ - Native events are followed from when `@bugsee/react-native` is first
142
+ evaluated: with Metro's `inlineRequires`, its first use. Import it (or call
143
+ `Bugsee.launch`) at the top of `index.js` to follow them from the start.
144
+ A value made native before then is masked as if anything could drive it,
145
+ until JS next animates or sets it. A native event attached without
146
+ `Animated` (code that calls React Native's native Animated module itself)
147
+ is not seen at all, and the value it drives is taken to be where JS last
148
+ had it.
149
+ - A transform animated from JS (`useNativeDriver: false`) is followed every
150
+ frame while its animation runs. Other styles a JS animation moves (`top`,
151
+ `left`, `margin`, a size) are followed by the 100 ms re-measure only.
152
+ - Reanimated runs its animations on the UI thread, out of JS's sight. A
153
+ Reanimated component whose style sets a transform through an animated
154
+ style, sets a shared value inline, or uses a CSS animation or transition
155
+ masks the whole surface around it; other Reanimated motion (an animated
156
+ style that adds a transform only later, layout animations,
157
+ `entering`/`exiting`, shared element transitions) is not followed.
158
+ - An interactive back gesture (iOS swipe-back, Android predictive back) moves
159
+ a mounted screen without anything JS can see.
160
+ - The mask is published in the same JS task that starts a native animation
161
+ (or sets, resets or offsets an `Animated.Value`), but the two reach native
162
+ separately: under heavy load the animation's first frame could still be
163
+ drawn before the mask lands.
164
+
165
+ ## Expo config plugin
166
+
167
+ ```json
168
+ {
169
+ "expo": {
170
+ "plugins": [
171
+ ["@bugsee/react-native", { "appToken": { "ios": "<ios token>", "android": "<android token>" } }]
172
+ ]
173
+ }
174
+ }
175
+ ```
176
+
177
+ `appToken` is one string for both platforms, or one token per platform. On
178
+ `expo prebuild` the plugin wires the Bugsee Gradle plugin, the Hermes debug-id
179
+ hooks and the iOS dSYM Archive action. Release builds then upload their source
180
+ maps, and Archives upload their dSYMs, whenever a real token is set.
181
+ `uploadSourcemaps: false` and `uploadSymbols: false` turn those uploads off.
182
+ A committed `ios/` (`project.pbxproj` and the shared scheme) or
183
+ `android/bugsee.properties` carries the token.
184
+
185
+ With the config plugin, no upload runs with a missing token or the placeholder token
186
+ (`00000000-0000-4000-8000-000000000000`, the version and variant digits
187
+ aside): the source-map upload, the Archive dSYM post-action and the Bugsee
188
+ Gradle plugin's mapping, symbol and build uploads each skip, with one line in
189
+ the build log (for the post-action: `warning: bugsee: dSYM upload skipped: the
190
+ app token is the placeholder`), and the build or Archive carries on. For
191
+ Android the plugin simply leaves the placeholder out of `bugsee.properties`.
192
+
193
+ ### Self-hosted, staging or regional endpoint
194
+
195
+ ```json
196
+ ["@bugsee/react-native", { "appToken": "<token>", "endpoint": "https://bugsee.example.com" }]
197
+ ```
198
+
199
+ `endpoint` is the API base: `https://`, a host, an optional port and path, and
200
+ no credentials, query, fragment or `/v2` (each reader adds the API version
201
+ itself). Anything else fails the prebuild. Unset, the default, everything stays
202
+ on Bugsee's production API. Set, it reaches every upload and the runtime:
203
+
204
+ - Android: `plugin.endpoint` in `android/bugsee.properties`, for the Gradle
205
+ plugin's uploads and the source-map upload; `com.bugsee.reactnative.endpoint`
206
+ application meta-data for the SDK.
207
+ - iOS: `BUGSEE_ENDPOINT` in the bundle phase (source maps) and in the Archive
208
+ dSYM post-action; `BugseeReactNativeEndpoint` in `Info.plist` for the SDK.
209
+ - Runtime: `Bugsee.launch()` and `relaunch()` use it whenever their options
210
+ carry no `endpoint`; an `endpoint` you pass yourself wins.
211
+ `getLaunchOptions()` reads it back. With `autoLaunch` it is also written as
212
+ the auto-launched SDK's `com.bugsee.option.$$ENDPOINT`, unless your manifest
213
+ already has one, which is then left as it is.
214
+
215
+ Each of these is the plugin's own, so a later prebuild with a new value
216
+ replaces it, and one without `endpoint` removes it again.
217
+
218
+ The plugin's Gradle edits never remove or change a line of your own code, on a
219
+ clean or a `--no-clean` prebuild, however often it runs: it adds its own
220
+ marked lines, replaces only those, and rewrites exactly one of yours,
221
+ `react.hermesCommand`, with any trailing comment kept. Its own lines are
222
+ recognised only by their markers: the NDK dependency ends in `// bugsee:ndk`
223
+ (as does the opener of the `dependencies` block it adds when the file has
224
+ none). A `bugsee-android-ndk` dependency of your own, anywhere and however
225
+ written, is never touched: the plugin then adds none of its own and says so in
226
+ the prebuild log. The plugin writes no `debugSymbolLevel` (see
227
+ [Native symbols](#native-symbols-android)), and your own `ndk { }` block or
228
+ level is never touched. It inserts only at anchors that hold nothing but their
229
+ brace (`dependencies {`, `buildscript … }`, `pluginManagement {`,
230
+ `repositories {`; a trailing comment is fine), always as whole lines at your
231
+ indentation, and never splits a line. Where it cannot do that
232
+ with certainty it refuses the prebuild with one error that names the file,
233
+ the reason and the fix, and writes nothing. It refuses:
234
+
235
+ - a Kotlin DSL `settings.gradle.kts`, `build.gradle.kts` or app
236
+ `build.gradle.kts`;
237
+ - a Gradle file it cannot read for sure: a string that does not close on its
238
+ line, a comment or string still open at the end of the file, braces that do
239
+ not balance, or a `/` that could start a slashy string as well as divide;
240
+ - a `react.hermesCommand` that spans several lines or shares its line with
241
+ another statement after `;`;
242
+ - an anchor brace that shares its line with code: a one-line
243
+ `dependencies { … }`, a `buildscript { … }; …`, a one-line
244
+ `pluginManagement` or `repositories` block (with the option that needs that
245
+ edit on);
246
+ - a `gradlePluginVersion` option or a baked NDK version that is not a plain
247
+ version string.
248
+
249
+ A declaration of `com.bugsee.android.gradle` in `android/build.gradle` is
250
+ taken as the plugin's own pin, whoever wrote it: its version follows the
251
+ wrapper's on each prebuild. Gradle allows one `plugins {}` block per script,
252
+ so when the root file already has one the pin goes into it (its braces must
253
+ stand alone on their lines, or the prebuild refuses); a new block is written
254
+ only when there is none.
255
+
256
+ ## Release symbolication
257
+
258
+ A Release build has to send Bugsee what turns its crash frames back into
259
+ source: the JS source map (with a debug id that ties it to the shipped
260
+ bundle), the R8 mapping and the native (NDK) symbols on Android, and the
261
+ dSYMs on iOS. **An Expo app gets all of it from the config plugin.** A bare
262
+ app needs the three sections below — the Android source-map hooks, the Bugsee
263
+ Gradle plugin, and the iOS bundle phase. Without them the app still builds
264
+ and runs, but JS and native frames in Release reports stay unsymbolicated.
265
+
266
+ ## Android source maps
267
+
268
+ Release builds give the Hermes bundle a debug id and upload its source map, so
269
+ JS frames in a crash report resolve. An Expo app gets this from the config
270
+ plugin. A bare app needs two edits in `android/app/build.gradle`. Resolve the
271
+ package through node, as React Native's own template resolves
272
+ `react-native`, so a hoisted or nested install works too:
273
+
274
+ ```groovy
275
+ def bugseeDir = new File(["node", "--print", "require.resolve('@bugsee/react-native/package.json')"]
276
+ .execute(null, rootDir).text.trim()).getParentFile()
277
+
278
+ react {
279
+ // Copies the JS aside before hermesc compiles it, so the debug id can
280
+ // reach the bytecode. React Native runs this command through cmd on
281
+ // Windows, so Windows gets the .cmd launcher and macOS and Linux the .sh.
282
+ // Keep it on one line: tools that apply this snippet read it as one.
283
+ hermesCommand = new File(new File(bugseeDir, "scripts"), System.getProperty("os.name").startsWith("Windows") ? "hermesc-preserve-js.cmd" : "hermesc-preserve-js.sh").absolutePath
284
+ }
285
+
286
+ // At the end of the file. Applying it twice is harmless.
287
+ apply from: new File(new File(bugseeDir, "scripts"), "bugsee-sourcemaps.gradle")
288
+ ```
289
+
290
+ The OS is checked when Gradle configures the build, so one `build.gradle`
291
+ works on macOS, Linux and Windows. Both launchers run
292
+ `scripts/hermesc-preserve-js.js` with `node`, which must be on the `PATH` (as
293
+ React Native's own bundling already needs). The wrapper exits non-zero when
294
+ hermesc writes no bytecode.
295
+
296
+ If Hermes compiles a bundle without going through the wrapper, the bundle
297
+ task fails rather than ship a release without a debug id. On Windows a
298
+ `hermesCommand` that names a `.sh` (what earlier versions of this README
299
+ said) fails the bundle task before hermesc runs, with the line to use
300
+ instead: `cmd` cannot run a shell script. With Hermes off, the plain JS
301
+ bundle and Metro's map get the id instead.
302
+
303
+ - **The upload needs a real token.** Set `app_token` in
304
+ `android/bugsee.properties`, or `BUGSEE_APP_TOKEN`. Without a token, or with
305
+ `-PbugseeUploadSourcemaps=false`, the build skips the upload with one line. A
306
+ failed upload warns and does not fail the build.
307
+ - **The version and build number** are the variant's own, flavors included.
308
+ - **The preserve directory.** For a bundle at `build/generated/assets/<x>`
309
+ the wrapper keeps the JS in `build/intermediates/bugsee-sourcemaps/<x>`.
310
+ The wrapper and `hermes-sourcemaps.js` take the last `generated/assets` in
311
+ the path; the Gradle hook takes the path relative to the build directory.
312
+ The three agree unless the bundle directory itself nests another
313
+ `generated/assets`, which React Native never does.
314
+ - **Expo.** `expo prebuild` writes the same per-OS choice. A `hermesCommand`
315
+ that an earlier prebuild wrote (the `.sh` on every OS) is recognised by its
316
+ exact text and moved to the per-OS one; a `hermesCommand` of your own that
317
+ already names `hermesc-preserve-js` is left as it is.
318
+ - **Windows paths with spaces or brackets.** React Native runs
319
+ `hermesCommand` through `cmd /c`, which cuts an absolute path holding a
320
+ space together with `(` `)` (`C:\Program Files (x86)\…`), or `(` `)` alone
321
+ (`C:\Users\John(US)\…`). On Windows the hook gives the launcher to React
322
+ Native relative to the project root instead, as React Native gives its own
323
+ paths; the build is verified from `C:\s (x86)\b rn`. A project whose path is long
324
+ can still pass Windows' 260-character limit in React Native's own native
325
+ build, which has nothing to do with Bugsee.
326
+ - **Limitations.** The hook has not yet been verified with Gradle's
327
+ configuration cache.
328
+
329
+ ## Android: Bugsee Gradle plugin
330
+
331
+ Uploads the R8/ProGuard mapping, the native (NDK) symbols and the build info
332
+ of each Release build. It is a Gradle plugin, so autolinking cannot add it;
333
+ the config plugin writes these same edits for an Expo app.
334
+
335
+ `android/settings.gradle` — the plugin is published to Maven Central, which
336
+ Gradle does not search for plugins unless told to:
337
+
338
+ ```groovy
339
+ pluginManagement {
340
+ includeBuild("../node_modules/@react-native/gradle-plugin")
341
+ repositories {
342
+ gradlePluginPortal()
343
+ google()
344
+ mavenCentral()
345
+ }
346
+ }
347
+ ```
348
+
349
+ `android/build.gradle` — declare it at the version this package is built
350
+ against (`android.gradlePlugin` in
351
+ `node_modules/@bugsee/react-native/native-versions.json`), above
352
+ `apply plugin: "com.facebook.react.rootproject"`:
353
+
354
+ ```groovy
355
+ plugins {
356
+ id 'com.bugsee.android.gradle' version '4.0.8' apply false
357
+ }
358
+ ```
359
+
360
+ `android/app/build.gradle` — apply it, and for native crash symbols add the
361
+ NDK module at the SDK version the package pins. No `ndk.debugSymbolLevel` is
362
+ needed for Bugsee ([Native symbols](#native-symbols-android)); set one only
363
+ for what Google Play should get.
364
+
365
+ ```groovy
366
+ apply plugin: "com.android.application"
367
+ apply plugin: "org.jetbrains.kotlin.android"
368
+ apply plugin: "com.facebook.react"
369
+ apply plugin: "com.bugsee.android.gradle"
370
+
371
+ // bugseeDir as in "Android source maps" above.
372
+ def bugseeVersions = new groovy.json.JsonSlurper().parse(new File(bugseeDir, "native-versions.json"))
373
+
374
+ dependencies {
375
+ implementation "com.bugsee:bugsee-android-ndk:${bugseeVersions.android.sdk}"
376
+ }
377
+ ```
378
+
379
+ `android/bugsee.properties` (next to `android/build.gradle`; keep it out of
380
+ version control if the token is private):
381
+
382
+ ```properties
383
+ app_token=<your Android app token>
384
+ plugin.ndk.enabled=true
385
+ ```
386
+
387
+ ### Native symbols (Android)
388
+
389
+ With `plugin.ndk.enabled=true` (the config plugin writes it for a real token
390
+ unless `nativeCrashReporting` is `false`), each Release build's
391
+ `uploadBugsee<Variant>Native` task uploads native symbols. Bugsee Gradle
392
+ plugin 4.0.8 and later read them from the **unstripped** libraries AGP leaves
393
+ in `build/intermediates/merged_native_libs/<variant>`, keyed by GNU build-id,
394
+ with `bugsee-cli` 0.8.1 or later (the plugin's own floor). That makes them
395
+ independent of `ndk.debugSymbolLevel`:
396
+
397
+ - every library that still has its debug info is uploaded with it, so crash
398
+ frames get function names and `file:line`. That covers your own native
399
+ code, and React Native's `libreactnative.so`, which the Maven
400
+ `react-android` artefact ships with full DWARF. Libraries shipped stripped
401
+ (Maven Hermes's `libhermesvm.so`, the Bugsee SDK's own) get their symbol
402
+ table, function names only;
403
+ - an unchanged prebuilt library (`libreactnative.so`, `libc++_shared.so`) has
404
+ the same build-id in every release, and the server keeps one copy; a copy
405
+ stored earlier with function names only is upgraded to the full one;
406
+ - the symbols are a build artefact: nothing is added to the APK or AAB.
407
+
408
+ `debugSymbolLevel` is therefore **your app's own choice, for Google Play**
409
+ (what AGP packs into `native-debug-symbols.zip` and the AAB). The config
410
+ plugin writes none. Earlier versions of it wrote
411
+ `ndk { debugSymbolLevel 'SYMBOL_TABLE' }`, under a
412
+ `// bugsee-symbol-table:` comment, into the `debug` and `release` build
413
+ types; the next prebuild removes that block, recognised by its exact lines
414
+ only. A block you changed inside is yours: it is left as it is, and the
415
+ prebuild log says so. A level of your own is never touched.
416
+
417
+ The wrapper's own `@bugsee/cli` (source maps, dSYMs) is 0.7.12 or later.
418
+ If you pin the Gradle plugin's CLI yourself (`plugin.cliPath` or
419
+ `plugin.cliVersion`), use 0.8.1 or later: older CLIs do not read
420
+ `merged_native_libs`, and the plugin then falls back to AGP's
421
+ `native-debug-symbols.zip`, which depends on `debugSymbolLevel` (and
422
+ 0.7.0–0.7.11 send nothing for a `SYMBOL_TABLE` zip, bugsee/bugsee-cli#61).
423
+
424
+ ## iOS: bundle phase
425
+
426
+ The JS half of iOS symbolication. In Xcode, the app target's **Bundle React
427
+ Native code and images** build phase runs React Native's
428
+ `react-native-xcode.sh`. Point it at this package's `bugsee-xcode.sh`
429
+ instead, which runs React Native's script, then composes the Hermes source
430
+ map, gives the bundle and the map a debug id, and uploads the map:
431
+
432
+ ```sh
433
+ set -e
434
+
435
+ WITH_ENVIRONMENT="$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
436
+ REACT_NATIVE_XCODE="${SRCROOT}/../node_modules/@bugsee/react-native/scripts/bugsee-xcode.sh"
437
+
438
+ /bin/sh -c "\"$WITH_ENVIRONMENT\" \"$REACT_NATIVE_XCODE\""
439
+ ```
440
+
441
+ The upload needs a real token, from `BUGSEE_APP_TOKEN` or `BUGSEE_TOKEN_IOS`
442
+ in the build environment (for example `export BUGSEE_APP_TOKEN=…` in
443
+ `ios/.xcode.env.local`). Without one the phase bundles as usual and says it
444
+ skipped the upload; `BUGSEE_UPLOAD_SOURCEMAPS=false` turns the upload off,
445
+ and a failed upload warns without failing the build. Debug builds skip it.
446
+
447
+ Native iOS frames come from the dSYMs. The config plugin adds an Archive
448
+ post-action that uploads them with `bugsee-cli xcode post-action`; a bare app
449
+ adds the same post-action to its scheme's Archive action (the example app's
450
+ scheme, `examples/bare/ios/BareExample.xcodeproj`, is the reference). Keep its
451
+ token check: without a real token the post-action must stop, exit 0, before
452
+ it runs `bugsee-cli`, which would otherwise register the build and send the
453
+ placeholder to your endpoint, or to production when none is set.
454
+
455
+ ### React Native framework dSYMs (iOS)
456
+
457
+ React Native's prebuilt `React.xcframework` ships without dSYMs, so after an
458
+ Archive the `React` frames in a crash stay raw addresses (`React 0x10271dbc4`)
459
+ while your own and Bugsee's frames symbolicate. **Leaving this off means React
460
+ Native frames on iOS show as raw addresses.** React Native downloads the dSYMs
461
+ only when `pod install` runs with `RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1`:
462
+
463
+ ```sh
464
+ cd ios && RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 pod install
465
+ ```
466
+
467
+ With it set, the Archive's `dSYMs/` folder includes React's dSYMs and the
468
+ post-action uploads them with the rest. A bare app has to export it wherever
469
+ it runs `pod install`, including CI.
470
+
471
+ The dSYMs are fetched together with the prebuilt `React-Core-prebuilt` pod, so
472
+ the variable does nothing for a pod that is already in `ios/Pods` (or in
473
+ CocoaPods' cache) from an earlier `pod install` without it: the log shows no
474
+ `Resolved stable dSYMs`, and the Archive has no `React.framework.dSYM`. On such
475
+ a machine remove the pod first and install again, from the app's root
476
+ directory:
477
+
478
+ ```sh
479
+ rm -rf ios/Pods/React-Core-prebuilt
480
+ pod cache clean React-Core-prebuilt --all
481
+ (cd ios && RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 pod install)
482
+ ```
483
+
484
+ A fresh CI checkout is not affected. The check that it worked is the Archive's
485
+ `dSYMs/React.framework.dSYM`. With the Expo config plugin it is opt-in:
486
+
487
+ ```json
488
+ ["@bugsee/react-native", { "appToken": "…", "symbolicateReactNativeFrameworks": true }]
489
+ ```
490
+
491
+ `expo prebuild` then adds `ENV['RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS'] ||= '1'`
492
+ to the top of `ios/Podfile` (Expo's Podfile reads only a fixed set of
493
+ `Podfile.properties.json` keys, so a property cannot do it), and a later
494
+ prebuild without the option removes the line again. A value you export
495
+ yourself, such as `0`, wins.
496
+
497
+ The trade-off: `pod install` makes an extra download (React Native's dSYM
498
+ tarballs). React Native fetches them in the same step as the prebuilt
499
+ framework itself, so a failed download drops the prebuilt React for that
500
+ install, and a failure while unpacking the dSYMs aborts `pod install`. That is
501
+ why the plugin leaves it off unless you ask. Apps that build React Native from
502
+ source already get its dSYMs.
503
+
504
+ Uploaded source maps list project files relative to the project root
505
+ (`/scenarios/staging.ts`), as Expo's do. The bundle phase and the Gradle hook
506
+ rewrite absolute `sources` before upload: under the project root they become
507
+ `/path/from/root`, and outside it (linked workspace packages in a monorepo)
508
+ `../path/from/root`. Entries that are already relative are left as they are. The map on disk is not changed and symbolication does not depend on
509
+ the strings.
510
+
511
+ ## Troubleshooting
512
+
513
+ **`fmt`: "call to consteval function … is not a constant expression" (iOS,
514
+ React Native 0.81 and 0.82, Xcode 26.4 or later).** Not Bugsee: React Native
515
+ 0.81 and 0.82 build `fmt` 11.0.2 from source, which newer Apple clang rejects
516
+ as C++20 ([fmtlib/fmt#4740](https://github.com/fmtlib/fmt/issues/4740)); 0.83
517
+ and later ship `fmt` 12 and are not affected. Build that one pod as C++17 from
518
+ the `post_install` in `ios/Podfile`, after `react_native_post_install(...)`,
519
+ then run `pod install` again:
520
+
521
+ ```ruby
522
+ installer.pods_project.targets.each do |target|
523
+ next unless target.name == 'fmt'
524
+ target.build_configurations.each do |config|
525
+ config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
526
+ end
527
+ end
528
+ ```
529
+
530
+ **`TypeError: ExceptionOptions has unknown key "labels"` (or
531
+ `"includeVideo"`).** `Bugsee.logException` takes `{ domain }` only, as the
532
+ 7.x native SDKs do, and throws on any other key before anything is sent.
533
+ Earlier betas accepted `labels` and `includeVideo`. Set labels from the
534
+ report handler instead. It has no per-call context: the labels it sets land
535
+ on every report it handles, not only on one `logException` call's.
536
+ `onAfterReportCreated` may run more than once, so set the labels rather than
537
+ append to them:
538
+
539
+ ```ts
540
+ Bugsee.setReportHandler({
541
+ onAfterReportCreated: report => report.setLabels(['checkout']),
542
+ });
543
+ ```
544
+
545
+ The handler sees only the reports that reach JavaScript. An Android NDK
546
+ relaunch never does, and an iOS report recovered at launch is best-effort;
547
+ `BugseeReportHandler` has the details.
548
+
549
+ `includeVideo` has no replacement: neither SDK can leave the video out of a
550
+ single report.
551
+
552
+ ## Examples
553
+
554
+ [`examples/playground`](https://github.com/bugsee/bugsee-react-native/tree/main/examples/playground) is a sample app with a button for every SDK API, a demo shop and a manual validation map.
555
+
556
+ ## Licence
557
+
558
+ The React Native wrapper is MIT. See [LICENSE](./LICENSE). The native Bugsee SDKs it bundles (iOS and Android) are separate packages with their own terms.