react-native-inapp-inspector 2.3.5 → 2.3.7

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 (226) hide show
  1. package/dist/commonjs/analytics.d.ts +0 -4
  2. package/dist/commonjs/analytics.js +0 -4
  3. package/dist/commonjs/bundle.d.ts +0 -4
  4. package/dist/commonjs/bundle.js +0 -4
  5. package/dist/commonjs/components/AnalyticsDetail.js +18 -27
  6. package/dist/commonjs/components/AnalyticsEventCard.js +9 -12
  7. package/dist/commonjs/components/AnalyticsGraph.js +10 -15
  8. package/dist/commonjs/components/AppHeaderLogo.js +0 -3
  9. package/dist/commonjs/components/BrandCircleIcon.js +15 -15
  10. package/dist/commonjs/components/BrandSquareIcon.js +20 -20
  11. package/dist/commonjs/components/CodeSnippet.js +6 -19
  12. package/dist/commonjs/components/ConsoleLogCard.js +0 -1
  13. package/dist/commonjs/components/CopyButton.js +0 -4
  14. package/dist/commonjs/components/DiffViewer.js +0 -2
  15. package/dist/commonjs/components/DomainHeader.js +0 -4
  16. package/dist/commonjs/components/EmptyState.js +0 -3
  17. package/dist/commonjs/components/ErrorBoundary.js +5 -10
  18. package/dist/commonjs/components/HeadersSection.js +0 -5
  19. package/dist/commonjs/components/HighlightText.js +1 -4
  20. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +11 -26
  21. package/dist/commonjs/components/Inspector/AnalyticsTab.js +34 -40
  22. package/dist/commonjs/components/Inspector/BundleTab.js +56 -84
  23. package/dist/commonjs/components/Inspector/ConsoleTab.js +7 -7
  24. package/dist/commonjs/components/Inspector/CrashDetail.js +18 -20
  25. package/dist/commonjs/components/Inspector/CrashFilterModal.js +0 -1
  26. package/dist/commonjs/components/Inspector/CrashTab.js +11 -20
  27. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +12 -24
  28. package/dist/commonjs/components/Inspector/FabLauncher.js +1 -1
  29. package/dist/commonjs/components/Inspector/InspectorContext.js +0 -2
  30. package/dist/commonjs/components/Inspector/InspectorHeader.js +7 -8
  31. package/dist/commonjs/components/Inspector/LogDetail.js +27 -29
  32. package/dist/commonjs/components/Inspector/MainScreen.js +9 -10
  33. package/dist/commonjs/components/Inspector/NetworkDetail.js +10 -11
  34. package/dist/commonjs/components/Inspector/NetworkTab.js +14 -14
  35. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +6 -9
  36. package/dist/commonjs/components/Inspector/PerformanceTab.js +30 -43
  37. package/dist/commonjs/components/Inspector/ReduxDetail.js +18 -34
  38. package/dist/commonjs/components/Inspector/ReduxTab.js +11 -20
  39. package/dist/commonjs/components/Inspector/SettingsPanel.js +32 -36
  40. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +6 -6
  41. package/dist/commonjs/components/Inspector/StorageTab.js +14 -26
  42. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +5 -6
  43. package/dist/commonjs/components/JsonViewer.js +3 -10
  44. package/dist/commonjs/components/LogCard.js +7 -7
  45. package/dist/commonjs/components/MetaAccordion.js +1 -7
  46. package/dist/commonjs/components/NetworkIcons.js +12 -16
  47. package/dist/commonjs/components/SectionHeader.js +0 -4
  48. package/dist/commonjs/components/SkeletonPlaceholder.js +6 -6
  49. package/dist/commonjs/components/Slider.js +6 -6
  50. package/dist/commonjs/components/SourcePageCard.js +0 -4
  51. package/dist/commonjs/components/TreeNode.js +0 -4
  52. package/dist/commonjs/console.d.ts +0 -4
  53. package/dist/commonjs/console.js +0 -4
  54. package/dist/commonjs/constants/index.js +6 -9
  55. package/dist/commonjs/constants/telemetryConfig.d.ts +3 -0
  56. package/dist/commonjs/constants/telemetryConfig.js +6 -0
  57. package/dist/commonjs/constants/version.d.ts +1 -1
  58. package/dist/commonjs/constants/version.js +1 -3
  59. package/dist/commonjs/crash.d.ts +0 -4
  60. package/dist/commonjs/crash.js +0 -4
  61. package/dist/commonjs/customHooks/analyticsLogger.d.ts +0 -7
  62. package/dist/commonjs/customHooks/analyticsLogger.js +3 -59
  63. package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +0 -9
  64. package/dist/commonjs/customHooks/bundleAnalyzer.js +3 -86
  65. package/dist/commonjs/customHooks/consoleLogger.js +0 -16
  66. package/dist/commonjs/customHooks/crashHandler.d.ts +0 -28
  67. package/dist/commonjs/customHooks/crashHandler.js +0 -55
  68. package/dist/commonjs/customHooks/logFilters.d.ts +0 -4
  69. package/dist/commonjs/customHooks/logFilters.js +0 -11
  70. package/dist/commonjs/customHooks/networkLogger.js +2 -13
  71. package/dist/commonjs/customHooks/performanceTracker.d.ts +0 -27
  72. package/dist/commonjs/customHooks/performanceTracker.js +0 -31
  73. package/dist/commonjs/customHooks/reduxLogger.d.ts +0 -12
  74. package/dist/commonjs/customHooks/reduxLogger.js +0 -51
  75. package/dist/commonjs/customHooks/storageInspector.d.ts +0 -40
  76. package/dist/commonjs/customHooks/storageInspector.js +1 -56
  77. package/dist/commonjs/decorators/index.d.ts +0 -37
  78. package/dist/commonjs/decorators/index.js +0 -42
  79. package/dist/commonjs/helpers/gaAnalyticsRegistry.d.ts +0 -10
  80. package/dist/commonjs/helpers/gaAnalyticsRegistry.js +0 -26
  81. package/dist/commonjs/helpers/index.d.ts +0 -7
  82. package/dist/commonjs/helpers/index.js +1 -42
  83. package/dist/commonjs/helpers/memoryManager.d.ts +0 -11
  84. package/dist/commonjs/helpers/memoryManager.js +0 -13
  85. package/dist/commonjs/helpers/searchQueryParser.d.ts +0 -4
  86. package/dist/commonjs/helpers/searchQueryParser.js +0 -18
  87. package/dist/commonjs/helpers/settingsStore.js +0 -8
  88. package/dist/commonjs/helpers/telemetry.d.ts +2 -0
  89. package/dist/commonjs/helpers/telemetry.js +136 -0
  90. package/dist/commonjs/i18n/index.d.ts +0 -9
  91. package/dist/commonjs/i18n/index.js +0 -15
  92. package/dist/commonjs/index.js +15 -97
  93. package/dist/commonjs/native/NativeInspector.d.ts +0 -54
  94. package/dist/commonjs/native/NativeInspector.js +0 -56
  95. package/dist/commonjs/network.d.ts +0 -4
  96. package/dist/commonjs/network.js +0 -4
  97. package/dist/commonjs/performance.d.ts +0 -4
  98. package/dist/commonjs/performance.js +0 -4
  99. package/dist/commonjs/redux.d.ts +0 -4
  100. package/dist/commonjs/redux.js +0 -4
  101. package/dist/commonjs/storage.d.ts +0 -4
  102. package/dist/commonjs/storage.js +0 -4
  103. package/dist/commonjs/styles/AppColors.d.ts +0 -3
  104. package/dist/commonjs/styles/AppColors.js +15 -30
  105. package/dist/commonjs/styles/AppFonts.d.ts +0 -4
  106. package/dist/commonjs/styles/AppFonts.js +0 -4
  107. package/dist/commonjs/styles/common.js +0 -11
  108. package/dist/commonjs/styles/index.js +0 -8
  109. package/dist/commonjs/types/enums.js +0 -3
  110. package/dist/commonjs/types/interfaces.d.ts +3 -3
  111. package/dist/esm/analytics.d.ts +0 -4
  112. package/dist/esm/analytics.js +0 -4
  113. package/dist/esm/bundle.d.ts +0 -4
  114. package/dist/esm/bundle.js +0 -4
  115. package/dist/esm/components/AnalyticsDetail.js +18 -27
  116. package/dist/esm/components/AnalyticsEventCard.js +9 -12
  117. package/dist/esm/components/AnalyticsGraph.js +10 -15
  118. package/dist/esm/components/AppHeaderLogo.js +0 -3
  119. package/dist/esm/components/BrandCircleIcon.js +15 -15
  120. package/dist/esm/components/BrandSquareIcon.js +20 -20
  121. package/dist/esm/components/CodeSnippet.js +6 -19
  122. package/dist/esm/components/ConsoleLogCard.js +0 -1
  123. package/dist/esm/components/CopyButton.js +0 -4
  124. package/dist/esm/components/DiffViewer.js +0 -2
  125. package/dist/esm/components/DomainHeader.js +0 -4
  126. package/dist/esm/components/EmptyState.js +0 -3
  127. package/dist/esm/components/ErrorBoundary.js +5 -10
  128. package/dist/esm/components/HeadersSection.js +0 -5
  129. package/dist/esm/components/HighlightText.js +1 -4
  130. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +11 -26
  131. package/dist/esm/components/Inspector/AnalyticsTab.js +34 -40
  132. package/dist/esm/components/Inspector/BundleTab.js +56 -84
  133. package/dist/esm/components/Inspector/ConsoleTab.js +7 -7
  134. package/dist/esm/components/Inspector/CrashDetail.js +18 -20
  135. package/dist/esm/components/Inspector/CrashFilterModal.js +0 -1
  136. package/dist/esm/components/Inspector/CrashTab.js +11 -20
  137. package/dist/esm/components/Inspector/DeviceInfoTab.js +12 -24
  138. package/dist/esm/components/Inspector/FabLauncher.js +1 -1
  139. package/dist/esm/components/Inspector/InspectorContext.js +0 -2
  140. package/dist/esm/components/Inspector/InspectorHeader.js +7 -8
  141. package/dist/esm/components/Inspector/LogDetail.js +27 -29
  142. package/dist/esm/components/Inspector/MainScreen.js +9 -10
  143. package/dist/esm/components/Inspector/NetworkDetail.js +10 -11
  144. package/dist/esm/components/Inspector/NetworkTab.js +14 -14
  145. package/dist/esm/components/Inspector/NpmUpdateToast.js +6 -9
  146. package/dist/esm/components/Inspector/PerformanceTab.js +30 -43
  147. package/dist/esm/components/Inspector/ReduxDetail.js +18 -34
  148. package/dist/esm/components/Inspector/ReduxTab.js +11 -20
  149. package/dist/esm/components/Inspector/SettingsPanel.js +32 -36
  150. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +6 -6
  151. package/dist/esm/components/Inspector/StorageTab.js +14 -26
  152. package/dist/esm/components/Inspector/UpdateAvailableModal.js +5 -6
  153. package/dist/esm/components/JsonViewer.js +3 -10
  154. package/dist/esm/components/LogCard.js +7 -7
  155. package/dist/esm/components/MetaAccordion.js +1 -7
  156. package/dist/esm/components/NetworkIcons.js +12 -16
  157. package/dist/esm/components/SectionHeader.js +0 -4
  158. package/dist/esm/components/SkeletonPlaceholder.js +6 -6
  159. package/dist/esm/components/Slider.js +6 -6
  160. package/dist/esm/components/SourcePageCard.js +0 -4
  161. package/dist/esm/components/TreeNode.js +0 -4
  162. package/dist/esm/console.d.ts +0 -4
  163. package/dist/esm/console.js +0 -4
  164. package/dist/esm/constants/index.js +6 -9
  165. package/dist/esm/constants/telemetryConfig.d.ts +3 -0
  166. package/dist/esm/constants/telemetryConfig.js +3 -0
  167. package/dist/esm/constants/version.d.ts +1 -1
  168. package/dist/esm/constants/version.js +1 -3
  169. package/dist/esm/crash.d.ts +0 -4
  170. package/dist/esm/crash.js +0 -4
  171. package/dist/esm/customHooks/analyticsLogger.d.ts +0 -7
  172. package/dist/esm/customHooks/analyticsLogger.js +3 -59
  173. package/dist/esm/customHooks/bundleAnalyzer.d.ts +0 -9
  174. package/dist/esm/customHooks/bundleAnalyzer.js +3 -86
  175. package/dist/esm/customHooks/consoleLogger.js +0 -16
  176. package/dist/esm/customHooks/crashHandler.d.ts +0 -28
  177. package/dist/esm/customHooks/crashHandler.js +0 -55
  178. package/dist/esm/customHooks/logFilters.d.ts +0 -4
  179. package/dist/esm/customHooks/logFilters.js +0 -11
  180. package/dist/esm/customHooks/networkLogger.js +2 -13
  181. package/dist/esm/customHooks/performanceTracker.d.ts +0 -27
  182. package/dist/esm/customHooks/performanceTracker.js +0 -31
  183. package/dist/esm/customHooks/reduxLogger.d.ts +0 -12
  184. package/dist/esm/customHooks/reduxLogger.js +0 -51
  185. package/dist/esm/customHooks/storageInspector.d.ts +0 -40
  186. package/dist/esm/customHooks/storageInspector.js +1 -56
  187. package/dist/esm/decorators/index.d.ts +0 -37
  188. package/dist/esm/decorators/index.js +0 -42
  189. package/dist/esm/helpers/gaAnalyticsRegistry.d.ts +0 -10
  190. package/dist/esm/helpers/gaAnalyticsRegistry.js +0 -26
  191. package/dist/esm/helpers/index.d.ts +0 -7
  192. package/dist/esm/helpers/index.js +1 -42
  193. package/dist/esm/helpers/memoryManager.d.ts +0 -11
  194. package/dist/esm/helpers/memoryManager.js +0 -13
  195. package/dist/esm/helpers/searchQueryParser.d.ts +0 -4
  196. package/dist/esm/helpers/searchQueryParser.js +0 -18
  197. package/dist/esm/helpers/settingsStore.js +0 -8
  198. package/dist/esm/helpers/telemetry.d.ts +2 -0
  199. package/dist/esm/helpers/telemetry.js +132 -0
  200. package/dist/esm/i18n/index.d.ts +0 -9
  201. package/dist/esm/i18n/index.js +0 -15
  202. package/dist/esm/index.js +15 -97
  203. package/dist/esm/native/NativeInspector.d.ts +0 -54
  204. package/dist/esm/native/NativeInspector.js +0 -56
  205. package/dist/esm/network.d.ts +0 -4
  206. package/dist/esm/network.js +0 -4
  207. package/dist/esm/performance.d.ts +0 -4
  208. package/dist/esm/performance.js +0 -4
  209. package/dist/esm/redux.d.ts +0 -4
  210. package/dist/esm/redux.js +0 -4
  211. package/dist/esm/storage.d.ts +0 -4
  212. package/dist/esm/storage.js +0 -4
  213. package/dist/esm/styles/AppColors.d.ts +0 -3
  214. package/dist/esm/styles/AppColors.js +15 -30
  215. package/dist/esm/styles/AppFonts.d.ts +0 -4
  216. package/dist/esm/styles/AppFonts.js +0 -4
  217. package/dist/esm/styles/common.js +0 -11
  218. package/dist/esm/styles/index.js +0 -8
  219. package/dist/esm/types/enums.js +0 -3
  220. package/dist/esm/types/interfaces.d.ts +3 -3
  221. package/package.json +2 -2
  222. package/src/constants/telemetryConfig.ts +6 -0
  223. package/src/constants/version.ts +1 -1
  224. package/src/helpers/telemetry.ts +161 -0
  225. package/src/index.tsx +15 -1
  226. package/src/types/interfaces.ts +3 -0
@@ -17,7 +17,6 @@ export const setCrashModuleEnabled = (enabled) => {
17
17
  isCrashModuleEnabled = enabled;
18
18
  };
19
19
  export const getCrashModuleEnabled = () => isCrashModuleEnabled;
20
- // ─── BREADCRUMB MANAGERS ───────────────────────────────────────────────────────
21
20
  export const setMaxCrashLogsLimit = (max) => {
22
21
  maxStoredCrashes = Math.max(10, max);
23
22
  if (crashRecordsStore.length > maxStoredCrashes) {
@@ -86,14 +85,6 @@ export const clearCrashBreadcrumbs = () => {
86
85
  export const getCrashBreadcrumbs = () => {
87
86
  return [...breadcrumbsStore];
88
87
  };
89
- // ─── STACK TRACE PARSING & INTELLIGENT SOURCE DETECTION ───────────────────────
90
- /**
91
- * Intelligent stack trace parser with multi-engine support:
92
- * - Hermes bytecode & source maps
93
- * - Android Java / Kotlin native frames
94
- * - iOS Objective-C / Swift symbols
95
- * - JavaScript standard V8 & SpiderMonkey
96
- */
97
88
  export const parseCrashStackTrace = (stack) => {
98
89
  if (!stack || typeof stack !== 'string')
99
90
  return [];
@@ -103,14 +94,12 @@ export const parseCrashStackTrace = (stack) => {
103
94
  const trimmed = line.trim();
104
95
  if (!trimmed)
105
96
  continue;
106
- // Filter out internal wrapper noise
107
97
  if (trimmed.includes('crashHandler.ts') ||
108
98
  trimmed.includes('handleInterceptedCrash') ||
109
99
  trimmed.includes('addLogFromCrash') ||
110
100
  trimmed.includes('setupGlobalCrashHandler')) {
111
101
  continue;
112
102
  }
113
- // Pattern 1: iOS/Hermes format: method@file:line:column or method@url:line:col
114
103
  const iosMatch = trimmed.match(/^([^@]+)@(.*):(\d+):(\d+)$/);
115
104
  if (iosMatch) {
116
105
  const [, method, file, lineNum, colNum] = iosMatch;
@@ -130,7 +119,6 @@ export const parseCrashStackTrace = (stack) => {
130
119
  });
131
120
  continue;
132
121
  }
133
- // Pattern 2: V8/Android JS format: at method (file:line:column)
134
122
  const androidMatch = trimmed.match(/^at\s+(.+)\s+\((.+):(\d+):(\d+)\)$/);
135
123
  if (androidMatch) {
136
124
  const [, method, file, lineNum, colNum] = androidMatch;
@@ -149,7 +137,6 @@ export const parseCrashStackTrace = (stack) => {
149
137
  });
150
138
  continue;
151
139
  }
152
- // Pattern 3: Simple at file:line:column
153
140
  const simpleMatch = trimmed.match(/^at\s+(.+):(\d+):(\d+)$/);
154
141
  if (simpleMatch) {
155
142
  const [, file, lineNum, colNum] = simpleMatch;
@@ -165,7 +152,6 @@ export const parseCrashStackTrace = (stack) => {
165
152
  });
166
153
  continue;
167
154
  }
168
- // Pattern 4: Java / Android Native Frame: at com.pkg.Class.method(Class.java:123)
169
155
  const javaMatch = trimmed.match(/^at\s+([a-zA-Z0-9_$.]+)\(([a-zA-Z0-9_$]+\.java):(\d+)\)$/);
170
156
  if (javaMatch) {
171
157
  const [, methodPath, fileName, lineNum] = javaMatch;
@@ -181,7 +167,6 @@ export const parseCrashStackTrace = (stack) => {
181
167
  });
182
168
  continue;
183
169
  }
184
- // Pattern 5: iOS Mach-O Symbol: 0 AppName 0x000000010... -[ViewController method] + 48
185
170
  const machOMatch = trimmed.match(/^\d+\s+([^\s]+)\s+(0x[0-9a-fA-F]+)\s+(.+)$/);
186
171
  if (machOMatch) {
187
172
  const [, binaryName, address, symbol] = machOMatch;
@@ -198,7 +183,6 @@ export const parseCrashStackTrace = (stack) => {
198
183
  });
199
184
  continue;
200
185
  }
201
- // Pattern 6: Fallback for generic frame lines
202
186
  frames.push({
203
187
  method: trimmed.startsWith('at ') ? trimmed.slice(3) : trimmed,
204
188
  file: 'runtime',
@@ -210,7 +194,6 @@ export const parseCrashStackTrace = (stack) => {
210
194
  }
211
195
  return frames;
212
196
  };
213
- // ─── DIAGNOSTICS & SYSTEM METRICS ─────────────────────────────────────────────
214
197
  const getMemoryDiagnostics = () => {
215
198
  try {
216
199
  const performance = globalThis.performance;
@@ -233,9 +216,6 @@ const getScreenDimensions = () => {
233
216
  return t('crash.unknown');
234
217
  }
235
218
  };
236
- /**
237
- * Computes a unique fingerprint signature to group recurring crash occurrences.
238
- */
239
219
  export const computeCrashFingerprint = (crash) => {
240
220
  const type = crash.type || 'js';
241
221
  const name = crash.name || 'Error';
@@ -247,7 +227,6 @@ export const computeCrashFingerprint = (crash) => {
247
227
  : 'unknown';
248
228
  return `${type}_${name}_${location}`;
249
229
  };
250
- // ─── CRASH RECORD MANAGEMENT & INTERCEPTION ───────────────────────────────────
251
230
  export const getCrashRecords = () => {
252
231
  return [...crashRecordsStore];
253
232
  };
@@ -268,7 +247,6 @@ export const subscribeCrashEvents = (listener) => {
268
247
  export const emitCrashEvent = (payload) => {
269
248
  if (payload.message !== '__CLEARED__') {
270
249
  const now = Date.now();
271
- // Throttle duplicate rapid crash emissions within 250ms
272
250
  if (now - lastHandledErrorTimestamp < 250) {
273
251
  return;
274
252
  }
@@ -281,10 +259,6 @@ export const emitCrashEvent = (payload) => {
281
259
  catch { }
282
260
  });
283
261
  };
284
- /**
285
- * Core exception interceptor. Ingests all forms of errors, parses call stacks,
286
- * collects device telemetry, records breadcrumbs, and updates the store.
287
- */
288
262
  export const handleInterceptedCrash = (errorOrTitle, rawStack, isFatal = false, customType, componentStack) => {
289
263
  try {
290
264
  const errorObj = errorOrTitle instanceof Error
@@ -306,7 +280,6 @@ export const handleInterceptedCrash = (errorOrTitle, rawStack, isFatal = false,
306
280
  else {
307
281
  stackString = errorObj.stack || new Error().stack || '';
308
282
  }
309
- // Determine Crash Type
310
283
  let inferredType = customType || CrashType.Js;
311
284
  const lowMsg = rawMsg.toLowerCase();
312
285
  if (!customType) {
@@ -378,7 +351,6 @@ export const handleInterceptedCrash = (errorOrTitle, rawStack, isFatal = false,
378
351
  logId: log?.id,
379
352
  crashRecord,
380
353
  });
381
- // Ensure native floating icon is visible & badged even if React UI is broken
382
354
  try {
383
355
  showNativeFloatingButton();
384
356
  setNativeFloatingButtonBadge(true);
@@ -399,21 +371,13 @@ export const handleInterceptedCrash = (errorOrTitle, rawStack, isFatal = false,
399
371
  return fallbackRecord;
400
372
  }
401
373
  };
402
- /**
403
- * Manually report a caught error with custom metadata.
404
- */
405
374
  export const recordCustomCrash = (error, options) => {
406
375
  return handleInterceptedCrash(error, typeof error === 'object' ? error.stack : undefined, options?.isFatal ?? false, options?.type || CrashType.Custom, options?.componentStack);
407
376
  };
408
- /**
409
- * Simulates a crash for developer testing without crashing the host app.
410
- * Uses real runtime Error objects — no mocked file paths or fake stacks.
411
- */
412
377
  export const simulateTestCrash = (type = CrashType.Js, customMessage, customStack) => {
413
378
  const err = new Error(customMessage || _defaultSimMessage(type));
414
379
  return handleInterceptedCrash(type === CrashType.Native ? err.message : err, customStack || err.stack, type === CrashType.Native, type, type === CrashType.Render ? _buildComponentStack() : undefined);
415
380
  };
416
- /** Generates a generic error message per type — no fake references. */
417
381
  const _defaultSimMessage = (type) => {
418
382
  switch (type) {
419
383
  case 'native':
@@ -426,12 +390,10 @@ const _defaultSimMessage = (type) => {
426
390
  return t('crash.simJsMessage');
427
391
  }
428
392
  };
429
- /** Builds a component stack from the real React tree if possible. */
430
393
  const _buildComponentStack = () => {
431
394
  try {
432
395
  const err = new Error();
433
396
  if (err.stack) {
434
- // Return the live stack as a pseudo component-stack
435
397
  return err.stack
436
398
  .split('\n')
437
399
  .slice(1, 6)
@@ -442,10 +404,6 @@ const _buildComponentStack = () => {
442
404
  catch { }
443
405
  return undefined;
444
406
  };
445
- // ─── EXPORT & REPORTING UTILITIES ─────────────────────────────────────────────
446
- /**
447
- * Formats a crash into Text, Markdown, or JSON.
448
- */
449
407
  export const exportCrashReport = (crash, format = 'text') => {
450
408
  if (format === 'json') {
451
409
  return JSON.stringify(crash, null, 2);
@@ -493,7 +451,6 @@ export const exportCrashReport = (crash, format = 'text') => {
493
451
  }
494
452
  return lines.join('\n');
495
453
  }
496
- // Standard Text format
497
454
  const lines = [];
498
455
  lines.push('====================================================');
499
456
  lines.push(` ${t('crash.reportTitle')} `);
@@ -538,16 +495,10 @@ export const exportCrashReport = (crash, format = 'text') => {
538
495
  lines.push('====================================================');
539
496
  return lines.join('\n');
540
497
  };
541
- // ─── GLOBAL HANDLER INITIALIZATION ────────────────────────────────────────────
542
- /**
543
- * Natively intercepts and prevents crashes, native RedBox dialogues,
544
- * unhandled JS errors, and unhandled promise rejections.
545
- */
546
498
  export const setupGlobalCrashHandler = () => {
547
499
  if (isCrashHandlerInitialized)
548
500
  return;
549
501
  isCrashHandlerInitialized = true;
550
- // 1. Completely silence React Native LogBox & RedBox overlays
551
502
  try {
552
503
  if (LogBox && typeof LogBox.ignoreAllLogs === 'function') {
553
504
  LogBox.ignoreAllLogs(true);
@@ -555,14 +506,12 @@ export const setupGlobalCrashHandler = () => {
555
506
  }
556
507
  catch { }
557
508
  try {
558
- // @ts-ignore
559
509
  const LogBoxData = require('react-native/Libraries/LogBox/Data/LogBoxData');
560
510
  if (LogBoxData && typeof LogBoxData.setDisabled === 'function') {
561
511
  LogBoxData.setDisabled(true);
562
512
  }
563
513
  }
564
514
  catch { }
565
- // 2. Intercept Native Module: NetworkInspectorModule (Android & iOS)
566
515
  try {
567
516
  const networkInspectorModule = NativeModules?.NetworkInspectorModule;
568
517
  if (networkInspectorModule) {
@@ -579,7 +528,6 @@ export const setupGlobalCrashHandler = () => {
579
528
  }
580
529
  }
581
530
  catch { }
582
- // 3. Intercept Native ExceptionsManager & RedBox modules (Bridge & TurboModules)
583
531
  try {
584
532
  const tmReg = TurboModuleRegistry || globalThis.__turboModuleProxy;
585
533
  const nativeExceptionsManager = NativeModules?.ExceptionsManager ||
@@ -638,7 +586,6 @@ export const setupGlobalCrashHandler = () => {
638
586
  }
639
587
  }
640
588
  catch { }
641
- // 4. Hook React Native ErrorUtils
642
589
  try {
643
590
  const globalObj = globalThis;
644
591
  const errorUtils = globalObj.ErrorUtils;
@@ -646,7 +593,6 @@ export const setupGlobalCrashHandler = () => {
646
593
  if (typeof errorUtils.setGlobalHandler === 'function') {
647
594
  errorUtils.setGlobalHandler((error, isFatal) => {
648
595
  handleInterceptedCrash(error, error?.stack, isFatal ?? false, 'js');
649
- // Suppress calling default crashing handler to prevent termination & RedBox
650
596
  });
651
597
  }
652
598
  if (typeof errorUtils.reportFatalError === 'function') {
@@ -662,7 +608,6 @@ export const setupGlobalCrashHandler = () => {
662
608
  }
663
609
  }
664
610
  catch { }
665
- // 5. Hook global Promise unhandled rejections
666
611
  try {
667
612
  const globalObj = globalThis;
668
613
  const handleUnhandledPromise = (eventOrError) => {
@@ -1,5 +1 @@
1
- /**
2
- * Configuration for console logs to ignore.
3
- * Logs matching any of these starting prefixes will be filtered out.
4
- */
5
1
  export declare const IGNORED_LOG_PREFIXES: Record<'info' | 'warn' | 'error', string[]>;
@@ -1,17 +1,8 @@
1
- /**
2
- * Configuration for console logs to ignore.
3
- * Logs matching any of these starting prefixes will be filtered out.
4
- */
5
1
  export const IGNORED_LOG_PREFIXES = {
6
2
  info: [
7
- // Add prefixes of info logs you want to ignore, e.g.:
8
- // 'Starting server',
9
3
  'VirtualizedList: You have a large list that is slow to update',
10
4
  ],
11
5
  warn: [
12
- // Add prefixes of warning logs you want to ignore, e.g.:
13
- // 'Require cycle:',
14
- // 'ViewPropTypes will be removed',
15
6
  'This method is deprecated (as well as all React Native Firebase namespaced API) and will be removed in the next major release as part of move to match Firebase Web modular SDK API.',
16
7
  'SerializableStateInvariantMiddleware took',
17
8
  'Non-serializable values were found in the navigation state.',
@@ -23,8 +14,6 @@ export const IGNORED_LOG_PREFIXES = {
23
14
  'A non-serializable value was detected in an action',
24
15
  ],
25
16
  error: [
26
- // Add prefixes of error logs you want to ignore, e.g.:
27
- // 'Warning: Each child in a list should have a unique',
28
17
  'A non-serializable value was detected in the state, in the path: `tierStatusCalculator.date`',
29
18
  'VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.',
30
19
  ],
@@ -28,7 +28,6 @@ function shouldIgnoreUrl(url) {
28
28
  return false;
29
29
  return IGNORED_URL_PATTERNS.some((re) => re.test(url));
30
30
  }
31
- // ─── Helpers ──────────────────────────────────────────────────────────────────
32
31
  function normaliseHeaders(raw) {
33
32
  if (!raw)
34
33
  return undefined;
@@ -55,7 +54,6 @@ function normaliseHeaders(raw) {
55
54
  });
56
55
  return Object.keys(result).length > 0 ? result : undefined;
57
56
  }
58
- // ✅ Parse FormData for File Upload previews
59
57
  function parseRequestData(data) {
60
58
  if (!data)
61
59
  return data;
@@ -80,7 +78,6 @@ function parseRequestData(data) {
80
78
  }
81
79
  return data;
82
80
  }
83
- // ✅ Magic function to extract file and line number from the call stack
84
81
  function getCallerFromStack() {
85
82
  try {
86
83
  const stack = new Error().stack;
@@ -89,7 +86,6 @@ function getCallerFromStack() {
89
86
  const lines = stack.split("\n");
90
87
  for (let i = 0; i < lines.length; i++) {
91
88
  const line = lines[i];
92
- // Skip internal react-native network modules and the logger itself
93
89
  if (line.includes("networkLogger") ||
94
90
  line.includes("node_modules") ||
95
91
  line.includes("Error") ||
@@ -102,7 +98,6 @@ function getCallerFromStack() {
102
98
  catch (e) { }
103
99
  return "Unknown";
104
100
  }
105
- // ─── Subscribe ────────────────────────────────────────────────────────────────
106
101
  export const subscribeNetworkLogs = (callback) => {
107
102
  listeners.push(callback);
108
103
  callback([...logs]);
@@ -133,7 +128,6 @@ export const pruneNetworkLogs = (targetCount) => {
133
128
  }
134
129
  return Math.max(0, pruned);
135
130
  };
136
- // ─── Internal ─────────────────────────────────────────────────────────────────
137
131
  const notify = () => {
138
132
  const snapshot = [...logs];
139
133
  listeners.forEach((cb) => cb(snapshot));
@@ -156,7 +150,6 @@ const addOrUpdateLog = (log) => {
156
150
  logs = logs.slice(0, maxNetworkLogsLimit);
157
151
  notify();
158
152
  };
159
- // ─── Setup ────────────────────────────────────────────────────────────────────
160
153
  export const setupNetworkLogger = () => {
161
154
  if (globalThis.__NETWORK_LOGGER_INITIALIZED__)
162
155
  return;
@@ -179,7 +172,7 @@ export const setupNetworkLogger = () => {
179
172
  let client = 'fetch';
180
173
  try {
181
174
  requestHeaders = normaliseHeaders(options?.headers);
182
- caller = getCallerFromStack(); // ✅ Capture call line
175
+ caller = getCallerFromStack();
183
176
  if (requestHeaders?.['apollographql-client-name'] || finalUrl?.toLowerCase().includes('/graphql')) {
184
177
  client = 'apollo';
185
178
  }
@@ -263,7 +256,6 @@ export const setupNetworkLogger = () => {
263
256
  }
264
257
  };
265
258
  }
266
- // Hook Axios — patches both the default instance and any future axios.create() instances
267
259
  try {
268
260
  if (axios) {
269
261
  addAxiosInterceptors(axios);
@@ -278,7 +270,6 @@ export const setupNetworkLogger = () => {
278
270
  }
279
271
  }
280
272
  catch (_e) {
281
- // Axios not available — fetch-only mode
282
273
  }
283
274
  try {
284
275
  setupGlobalCrashHandler();
@@ -286,7 +277,6 @@ export const setupNetworkLogger = () => {
286
277
  catch { }
287
278
  globalThis.__NETWORK_LOGGER_INITIALIZED__ = true;
288
279
  };
289
- // ─── Axios interceptor helper ─────────────────────────────────────────────────
290
280
  export const addAxiosInterceptors = (axiosInstance) => {
291
281
  axiosInstance.interceptors.request.use(async (config) => {
292
282
  const method = (config.method || "GET").toUpperCase();
@@ -294,11 +284,10 @@ export const addAxiosInterceptors = (axiosInstance) => {
294
284
  return config;
295
285
  const id = counter++;
296
286
  const start = Date.now();
297
- const caller = getCallerFromStack(); // ✅ Capture call line
287
+ const caller = getCallerFromStack();
298
288
  let url = config.url ?? "";
299
289
  if (!url.startsWith("http"))
300
290
  url = `${config.baseURL ?? ""}${url}`;
301
- // ✅ Leave config untagged so the response interceptor skips it too.
302
291
  if (shouldIgnoreUrl(url))
303
292
  return config;
304
293
  config.__logId = id;
@@ -59,20 +59,11 @@ export interface ComponentRenderProfile {
59
59
  fixKeys: PerformanceFixKey[];
60
60
  severity: 'optimal' | 'warning' | 'critical';
61
61
  }
62
- /**
63
- * Dynamically generates tailored Before/After performance optimization code snippets
64
- * based on the target component's real identifier, props, and detected anti-pattern.
65
- */
66
62
  export declare const generateFixSnippet: (fixKey: string, componentName?: string, context?: {
67
63
  propName?: string;
68
64
  actionName?: string;
69
65
  itemHeight?: number;
70
66
  }) => PerformanceFixKey;
71
- /**
72
- * Dynamically resolves caller file path or runtime source from the active JavaScript stack trace.
73
- * Does not assume fixed directory hierarchies (such as src/ or components/) and extracts
74
- * whatever relative path or symbol the host project structure uses.
75
- */
76
67
  export declare function getCallerSourceFile(fallbackName?: string): string;
77
68
  export declare const getInitialRenderProfiles: () => ComponentRenderProfile[];
78
69
  export declare const getInitialPerformanceEvents: () => PerformanceEvent[];
@@ -91,41 +82,23 @@ export declare const trackComponentRender: (params: {
91
82
  reason?: string;
92
83
  fixKeys?: PerformanceFixKey[];
93
84
  }) => void;
94
- /**
95
- * Dynamically queries Hermes or JavaScript runtime memory statistics.
96
- */
97
85
  export declare const getHermesMemoryStats: () => LiveMemoryStats;
98
- /**
99
- * Dynamically records and evaluates screen navigation transition performance.
100
- */
101
86
  export declare const trackNavigationTransition: (screenName: string, durationMs: number, options?: {
102
87
  ttiMs?: number;
103
88
  droppedFrames?: number;
104
89
  source?: string;
105
90
  }) => PerformanceEvent;
106
- /**
107
- * React Hook that automatically profiles screen mounts and navigation transitions.
108
- */
109
91
  export declare const useNavigationProfiler: (screenName: string, options?: {
110
92
  onTransitionEnd?: (durationMs: number) => void;
111
93
  }) => void;
112
- /**
113
- * Measures synchronous execution duration and alerts on frame budget spikes (>16ms).
114
- */
115
94
  export declare const trackHeavyTask: <T>(taskName: string, syncFn: () => T, options?: {
116
95
  thresholdMs?: number;
117
96
  source?: string;
118
97
  }) => T;
119
- /**
120
- * Measures async operation / Promise latency and records slow network or disk tasks.
121
- */
122
98
  export declare const measureAsync: <T>(taskName: string, asyncFn: () => Promise<T>, options?: {
123
99
  thresholdMs?: number;
124
100
  source?: string;
125
101
  }) => Promise<T>;
126
- /**
127
- * Custom React Hook to profile any component or screen renders dynamically in runtime.
128
- */
129
102
  export declare const useComponentProfiler: (componentName: string, options?: {
130
103
  type?: ComponentRenderProfile["type"];
131
104
  sourceFile?: string;
@@ -1,10 +1,6 @@
1
1
  import { AppColors } from '../styles/AppColors';
2
2
  import { t } from '../i18n';
3
3
  import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
4
- /**
5
- * Dynamically generates tailored Before/After performance optimization code snippets
6
- * based on the target component's real identifier, props, and detected anti-pattern.
7
- */
8
4
  export const generateFixSnippet = (fixKey, componentName = 'Component', context) => {
9
5
  const comp = componentName || 'Component';
10
6
  const prop = context?.propName || 'onPress';
@@ -134,11 +130,6 @@ export const generateFixSnippet = (fixKey, componentName = 'Component', context)
134
130
  };
135
131
  }
136
132
  };
137
- /**
138
- * Dynamically resolves caller file path or runtime source from the active JavaScript stack trace.
139
- * Does not assume fixed directory hierarchies (such as src/ or components/) and extracts
140
- * whatever relative path or symbol the host project structure uses.
141
- */
142
133
  export function getCallerSourceFile(fallbackName) {
143
134
  try {
144
135
  const stack = new Error().stack;
@@ -256,9 +247,6 @@ export const trackComponentRender = (params) => {
256
247
  }
257
248
  notifyRenderListeners();
258
249
  };
259
- /**
260
- * Dynamically queries Hermes or JavaScript runtime memory statistics.
261
- */
262
250
  export const getHermesMemoryStats = () => {
263
251
  try {
264
252
  const hermes = globalThis.HermesInternal;
@@ -287,9 +275,6 @@ export const getHermesMemoryStats = () => {
287
275
  allocationRateMbPerSec: 1.2,
288
276
  };
289
277
  };
290
- /**
291
- * Dynamically records and evaluates screen navigation transition performance.
292
- */
293
278
  export const trackNavigationTransition = (screenName, durationMs, options) => {
294
279
  const duration = Math.max(1, Number(durationMs.toFixed(1)));
295
280
  const tti = options?.ttiMs ? Number(options.ttiMs.toFixed(1)) : duration;
@@ -313,9 +298,6 @@ export const trackNavigationTransition = (screenName, durationMs, options) => {
313
298
  severity: duration > 50 ? 'critical' : duration > 25 ? 'warning' : 'optimal',
314
299
  });
315
300
  };
316
- /**
317
- * React Hook that automatically profiles screen mounts and navigation transitions.
318
- */
319
301
  export const useNavigationProfiler = (screenName, options) => {
320
302
  const mountTimeRef = useRef(Date.now());
321
303
  useEffect(() => {
@@ -326,9 +308,6 @@ export const useNavigationProfiler = (screenName, options) => {
326
308
  }
327
309
  }, [screenName]);
328
310
  };
329
- /**
330
- * Measures synchronous execution duration and alerts on frame budget spikes (>16ms).
331
- */
332
311
  export const trackHeavyTask = (taskName, syncFn, options) => {
333
312
  const start = Date.now();
334
313
  try {
@@ -356,9 +335,6 @@ export const trackHeavyTask = (taskName, syncFn, options) => {
356
335
  }
357
336
  }
358
337
  };
359
- /**
360
- * Measures async operation / Promise latency and records slow network or disk tasks.
361
- */
362
338
  export const measureAsync = async (taskName, asyncFn, options) => {
363
339
  const start = Date.now();
364
340
  try {
@@ -383,9 +359,6 @@ export const measureAsync = async (taskName, asyncFn, options) => {
383
359
  }
384
360
  }
385
361
  };
386
- /**
387
- * Custom React Hook to profile any component or screen renders dynamically in runtime.
388
- */
389
362
  export const useComponentProfiler = (componentName, options) => {
390
363
  const renderCountRef = useRef(0);
391
364
  const prevPropsRef = useRef(options?.propsToCompare);
@@ -396,7 +369,6 @@ export const useComponentProfiler = (componentName, options) => {
396
369
  const duration = Date.now() - startTimeRef.current;
397
370
  const now = Date.now();
398
371
  renderCountRef.current += 1;
399
- // Detect rapid re-render loop spikes (>= 10 renders within 500ms)
400
372
  renderTimestampsRef.current = [
401
373
  ...renderTimestampsRef.current.filter(ts => now - ts <= 500),
402
374
  now,
@@ -474,7 +446,6 @@ export const usePerformanceTracker = (enabled = true) => {
474
446
  const lastFrameTimeRef = useRef(Date.now());
475
447
  const rafIdRef = useRef(null);
476
448
  const appStartTimestampRef = useRef(Date.now());
477
- // Live Frame Measurement Loop
478
449
  useEffect(() => {
479
450
  if (!isTrackerActive || !isRecording)
480
451
  return;
@@ -510,7 +481,6 @@ export const usePerformanceTracker = (enabled = true) => {
510
481
  setAvgFps(Math.round(sum / next.length));
511
482
  return next;
512
483
  });
513
- // Update live memory telemetry from Hermes / engine
514
484
  const liveMem = getHermesMemoryStats();
515
485
  setMemoryStats(prev => ({
516
486
  ...prev,
@@ -577,7 +547,6 @@ export const usePerformanceTracker = (enabled = true) => {
577
547
  : 'Poor',
578
548
  };
579
549
  }, [totalFrames, jankyFrameCount, jsLagMs, events]);
580
- // Aggregate re-render stats
581
550
  const reRenderSummary = useMemo(() => {
582
551
  const totalRenders = renderProfiles.reduce((sum, p) => sum + p.renderCount, 0);
583
552
  const totalWasteful = renderProfiles.reduce((sum, p) => sum + p.wastefulCount, 0);
@@ -15,17 +15,5 @@ export declare const getActionHistory: () => ReduxHistoryEntry[];
15
15
  export declare const clearActionHistory: () => void;
16
16
  export declare const setReduxState: (state: any) => void;
17
17
  export declare const subscribeReduxState: (cb: () => void) => () => void;
18
- /**
19
- * Standard Redux middleware — add it to your store to capture every action,
20
- * including those dispatched from thunks, sagas and RTK Query:
21
- *
22
- * const store = configureStore({
23
- * reducer,
24
- * middleware: gDM => gDM().concat(inspectorReduxMiddleware),
25
- * });
26
- *
27
- * Pair with `connectReduxStore(store)` (safe — they de-duplicate) or rely on
28
- * the middleware alone; the initial snapshot is taken on the first action.
29
- */
30
18
  export declare const inspectorReduxMiddleware: (storeApi: any) => (next: (action: any) => any) => (action: any) => any;
31
19
  export declare const connectReduxStore: (store: any) => void;