react-native-debug-toolkit 3.3.4 → 3.5.0

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 (258) hide show
  1. package/README.md +48 -46
  2. package/README.zh-CN.md +48 -46
  3. package/android/src/main/java/com/reactnativedebugtoolkit/DebugToolkitDevConnectModule.java +0 -187
  4. package/bin/debug-toolkit.js +0 -16
  5. package/ios/DebugToolkitDevConnect.h +0 -12
  6. package/ios/DebugToolkitDevConnect.mm +0 -321
  7. package/lib/commonjs/constants/logLevels.js +19 -0
  8. package/lib/commonjs/constants/logLevels.js.map +1 -0
  9. package/lib/commonjs/core/initialize.js +36 -18
  10. package/lib/commonjs/core/initialize.js.map +1 -1
  11. package/lib/commonjs/features/console/ConsoleLogTab.js +4 -15
  12. package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -1
  13. package/lib/commonjs/features/console/index.js +15 -8
  14. package/lib/commonjs/features/console/index.js.map +1 -1
  15. package/lib/commonjs/features/devConnect/DevConnectTab.js +18 -470
  16. package/lib/commonjs/features/devConnect/DevConnectTab.js.map +1 -1
  17. package/lib/commonjs/features/devConnect/devConnectPreferences.js +0 -12
  18. package/lib/commonjs/features/devConnect/devConnectPreferences.js.map +1 -1
  19. package/lib/commonjs/features/devConnect/devConnectUtils.js +2 -57
  20. package/lib/commonjs/features/devConnect/devConnectUtils.js.map +1 -1
  21. package/lib/commonjs/features/devConnect/index.js +1 -23
  22. package/lib/commonjs/features/devConnect/index.js.map +1 -1
  23. package/lib/commonjs/features/devConnect/nativeDevConnect.js +1 -103
  24. package/lib/commonjs/features/devConnect/nativeDevConnect.js.map +1 -1
  25. package/lib/commonjs/features/network/NetworkLogTab.js +91 -93
  26. package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -1
  27. package/lib/commonjs/features/network/index.js +7 -4
  28. package/lib/commonjs/features/network/index.js.map +1 -1
  29. package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js +1044 -0
  30. package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js.map +1 -0
  31. package/lib/commonjs/features/sessionHistory/index.js +103 -0
  32. package/lib/commonjs/features/sessionHistory/index.js.map +1 -0
  33. package/lib/commonjs/features/track/index.js +4 -3
  34. package/lib/commonjs/features/track/index.js.map +1 -1
  35. package/lib/commonjs/index.js +27 -0
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/commonjs/ui/DebugView.js +3 -0
  38. package/lib/commonjs/ui/DebugView.js.map +1 -1
  39. package/lib/commonjs/ui/panel/DebugPanel.js +67 -34
  40. package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -1
  41. package/lib/commonjs/ui/panel/FeatureIntroCard.js +131 -0
  42. package/lib/commonjs/ui/panel/FeatureIntroCard.js.map +1 -0
  43. package/lib/commonjs/ui/panel/FeatureRail.js +163 -0
  44. package/lib/commonjs/ui/panel/FeatureRail.js.map +1 -0
  45. package/lib/commonjs/ui/panel/FloatPanelView.js +169 -32
  46. package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -1
  47. package/lib/commonjs/ui/panel/buildFeatureSummary.js +207 -0
  48. package/lib/commonjs/ui/panel/buildFeatureSummary.js.map +1 -0
  49. package/lib/commonjs/ui/panel/filterFeatureSnapshot.js +43 -0
  50. package/lib/commonjs/ui/panel/filterFeatureSnapshot.js.map +1 -0
  51. package/lib/commonjs/ui/panel/tabPersistence.js +17 -0
  52. package/lib/commonjs/ui/panel/tabPersistence.js.map +1 -0
  53. package/lib/commonjs/ui/theme/colors.js +6 -0
  54. package/lib/commonjs/ui/theme/colors.js.map +1 -1
  55. package/lib/commonjs/utils/DaemonClient.js +30 -8
  56. package/lib/commonjs/utils/DaemonClient.js.map +1 -1
  57. package/lib/commonjs/utils/SessionManager.js +132 -0
  58. package/lib/commonjs/utils/SessionManager.js.map +1 -0
  59. package/lib/commonjs/utils/StorageAdapter.js +104 -0
  60. package/lib/commonjs/utils/StorageAdapter.js.map +1 -0
  61. package/lib/commonjs/utils/createChannelFeature.js +22 -5
  62. package/lib/commonjs/utils/createChannelFeature.js.map +1 -1
  63. package/lib/commonjs/utils/createDebugTab.js +21 -0
  64. package/lib/commonjs/utils/createDebugTab.js.map +1 -0
  65. package/lib/commonjs/utils/createPersistedObservableStore.js +14 -8
  66. package/lib/commonjs/utils/createPersistedObservableStore.js.map +1 -1
  67. package/lib/commonjs/utils/debugPreferences.js +28 -6
  68. package/lib/commonjs/utils/debugPreferences.js.map +1 -1
  69. package/lib/commonjs/utils/deviceReport.js +5 -1
  70. package/lib/commonjs/utils/deviceReport.js.map +1 -1
  71. package/lib/commonjs/utils/logRuntime.js +32 -0
  72. package/lib/commonjs/utils/logRuntime.js.map +1 -0
  73. package/lib/module/constants/logLevels.js +15 -0
  74. package/lib/module/constants/logLevels.js.map +1 -0
  75. package/lib/module/core/initialize.js +36 -18
  76. package/lib/module/core/initialize.js.map +1 -1
  77. package/lib/module/features/console/ConsoleLogTab.js +1 -12
  78. package/lib/module/features/console/ConsoleLogTab.js.map +1 -1
  79. package/lib/module/features/console/index.js +15 -8
  80. package/lib/module/features/console/index.js.map +1 -1
  81. package/lib/module/features/devConnect/DevConnectTab.js +21 -473
  82. package/lib/module/features/devConnect/DevConnectTab.js.map +1 -1
  83. package/lib/module/features/devConnect/devConnectPreferences.js +1 -12
  84. package/lib/module/features/devConnect/devConnectPreferences.js.map +1 -1
  85. package/lib/module/features/devConnect/devConnectUtils.js +1 -53
  86. package/lib/module/features/devConnect/devConnectUtils.js.map +1 -1
  87. package/lib/module/features/devConnect/index.js +5 -9
  88. package/lib/module/features/devConnect/index.js.map +1 -1
  89. package/lib/module/features/devConnect/nativeDevConnect.js +1 -100
  90. package/lib/module/features/devConnect/nativeDevConnect.js.map +1 -1
  91. package/lib/module/features/network/NetworkLogTab.js +91 -93
  92. package/lib/module/features/network/NetworkLogTab.js.map +1 -1
  93. package/lib/module/features/network/index.js +7 -4
  94. package/lib/module/features/network/index.js.map +1 -1
  95. package/lib/module/features/sessionHistory/SessionHistoryTab.js +1039 -0
  96. package/lib/module/features/sessionHistory/SessionHistoryTab.js.map +1 -0
  97. package/lib/module/features/sessionHistory/index.js +99 -0
  98. package/lib/module/features/sessionHistory/index.js.map +1 -0
  99. package/lib/module/features/track/index.js +4 -3
  100. package/lib/module/features/track/index.js.map +1 -1
  101. package/lib/module/index.js +4 -0
  102. package/lib/module/index.js.map +1 -1
  103. package/lib/module/ui/DebugView.js +3 -0
  104. package/lib/module/ui/DebugView.js.map +1 -1
  105. package/lib/module/ui/panel/DebugPanel.js +67 -34
  106. package/lib/module/ui/panel/DebugPanel.js.map +1 -1
  107. package/lib/module/ui/panel/FeatureIntroCard.js +126 -0
  108. package/lib/module/ui/panel/FeatureIntroCard.js.map +1 -0
  109. package/lib/module/ui/panel/FeatureRail.js +158 -0
  110. package/lib/module/ui/panel/FeatureRail.js.map +1 -0
  111. package/lib/module/ui/panel/FloatPanelView.js +170 -33
  112. package/lib/module/ui/panel/FloatPanelView.js.map +1 -1
  113. package/lib/module/ui/panel/buildFeatureSummary.js +203 -0
  114. package/lib/module/ui/panel/buildFeatureSummary.js.map +1 -0
  115. package/lib/module/ui/panel/filterFeatureSnapshot.js +39 -0
  116. package/lib/module/ui/panel/filterFeatureSnapshot.js.map +1 -0
  117. package/lib/module/ui/panel/tabPersistence.js +13 -0
  118. package/lib/module/ui/panel/tabPersistence.js.map +1 -0
  119. package/lib/module/ui/theme/colors.js +6 -0
  120. package/lib/module/ui/theme/colors.js.map +1 -1
  121. package/lib/module/utils/DaemonClient.js +30 -8
  122. package/lib/module/utils/DaemonClient.js.map +1 -1
  123. package/lib/module/utils/SessionManager.js +127 -0
  124. package/lib/module/utils/SessionManager.js.map +1 -0
  125. package/lib/module/utils/StorageAdapter.js +96 -0
  126. package/lib/module/utils/StorageAdapter.js.map +1 -0
  127. package/lib/module/utils/createChannelFeature.js +22 -5
  128. package/lib/module/utils/createChannelFeature.js.map +1 -1
  129. package/lib/module/utils/createDebugTab.js +17 -0
  130. package/lib/module/utils/createDebugTab.js.map +1 -0
  131. package/lib/module/utils/createPersistedObservableStore.js +14 -8
  132. package/lib/module/utils/createPersistedObservableStore.js.map +1 -1
  133. package/lib/module/utils/debugPreferences.js +27 -6
  134. package/lib/module/utils/debugPreferences.js.map +1 -1
  135. package/lib/module/utils/deviceReport.js +4 -1
  136. package/lib/module/utils/deviceReport.js.map +1 -1
  137. package/lib/module/utils/logRuntime.js +26 -0
  138. package/lib/module/utils/logRuntime.js.map +1 -0
  139. package/lib/typescript/src/constants/logLevels.d.ts +3 -0
  140. package/lib/typescript/src/constants/logLevels.d.ts.map +1 -0
  141. package/lib/typescript/src/core/initialize.d.ts +6 -0
  142. package/lib/typescript/src/core/initialize.d.ts.map +1 -1
  143. package/lib/typescript/src/features/console/ConsoleLogTab.d.ts.map +1 -1
  144. package/lib/typescript/src/features/console/index.d.ts +2 -1
  145. package/lib/typescript/src/features/console/index.d.ts.map +1 -1
  146. package/lib/typescript/src/features/devConnect/DevConnectTab.d.ts.map +1 -1
  147. package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts +0 -2
  148. package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts.map +1 -1
  149. package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts +0 -20
  150. package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts.map +1 -1
  151. package/lib/typescript/src/features/devConnect/index.d.ts +2 -2
  152. package/lib/typescript/src/features/devConnect/index.d.ts.map +1 -1
  153. package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts +0 -25
  154. package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts.map +1 -1
  155. package/lib/typescript/src/features/devConnect/types.d.ts +1 -3
  156. package/lib/typescript/src/features/devConnect/types.d.ts.map +1 -1
  157. package/lib/typescript/src/features/network/NetworkLogTab.d.ts.map +1 -1
  158. package/lib/typescript/src/features/network/index.d.ts +2 -1
  159. package/lib/typescript/src/features/network/index.d.ts.map +1 -1
  160. package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts +20 -0
  161. package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts.map +1 -0
  162. package/lib/typescript/src/features/sessionHistory/index.d.ts +4 -0
  163. package/lib/typescript/src/features/sessionHistory/index.d.ts.map +1 -0
  164. package/lib/typescript/src/features/track/index.d.ts +2 -1
  165. package/lib/typescript/src/features/track/index.d.ts.map +1 -1
  166. package/lib/typescript/src/index.d.ts +6 -0
  167. package/lib/typescript/src/index.d.ts.map +1 -1
  168. package/lib/typescript/src/types/feature.d.ts +1 -1
  169. package/lib/typescript/src/types/feature.d.ts.map +1 -1
  170. package/lib/typescript/src/types/index.d.ts +2 -0
  171. package/lib/typescript/src/types/index.d.ts.map +1 -1
  172. package/lib/typescript/src/ui/DebugView.d.ts +4 -2
  173. package/lib/typescript/src/ui/DebugView.d.ts.map +1 -1
  174. package/lib/typescript/src/ui/panel/DebugPanel.d.ts +3 -1
  175. package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -1
  176. package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts +11 -0
  177. package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts.map +1 -0
  178. package/lib/typescript/src/ui/panel/FeatureRail.d.ts +16 -0
  179. package/lib/typescript/src/ui/panel/FeatureRail.d.ts.map +1 -0
  180. package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -1
  181. package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts +13 -0
  182. package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts.map +1 -0
  183. package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts +3 -0
  184. package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts.map +1 -0
  185. package/lib/typescript/src/ui/panel/tabPersistence.d.ts +3 -0
  186. package/lib/typescript/src/ui/panel/tabPersistence.d.ts.map +1 -0
  187. package/lib/typescript/src/ui/theme/colors.d.ts +5 -0
  188. package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -1
  189. package/lib/typescript/src/utils/DaemonClient.d.ts +7 -1
  190. package/lib/typescript/src/utils/DaemonClient.d.ts.map +1 -1
  191. package/lib/typescript/src/utils/SessionManager.d.ts +30 -0
  192. package/lib/typescript/src/utils/SessionManager.d.ts.map +1 -0
  193. package/lib/typescript/src/utils/StorageAdapter.d.ts +38 -0
  194. package/lib/typescript/src/utils/StorageAdapter.d.ts.map +1 -0
  195. package/lib/typescript/src/utils/createChannelFeature.d.ts +2 -0
  196. package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -1
  197. package/lib/typescript/src/utils/createDebugTab.d.ts +18 -0
  198. package/lib/typescript/src/utils/createDebugTab.d.ts.map +1 -0
  199. package/lib/typescript/src/utils/createPersistedObservableStore.d.ts +4 -1
  200. package/lib/typescript/src/utils/createPersistedObservableStore.d.ts.map +1 -1
  201. package/lib/typescript/src/utils/debugPreferences.d.ts +1 -4
  202. package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -1
  203. package/lib/typescript/src/utils/deviceReport.d.ts +1 -0
  204. package/lib/typescript/src/utils/deviceReport.d.ts.map +1 -1
  205. package/lib/typescript/src/utils/logRuntime.d.ts +13 -0
  206. package/lib/typescript/src/utils/logRuntime.d.ts.map +1 -0
  207. package/package.json +10 -6
  208. package/src/constants/logLevels.ts +13 -0
  209. package/src/core/initialize.ts +61 -21
  210. package/src/features/console/ConsoleLogTab.tsx +1 -14
  211. package/src/features/console/index.ts +18 -8
  212. package/src/features/devConnect/DevConnectTab.tsx +17 -381
  213. package/src/features/devConnect/devConnectPreferences.ts +0 -15
  214. package/src/features/devConnect/devConnectUtils.ts +1 -81
  215. package/src/features/devConnect/index.ts +2 -9
  216. package/src/features/devConnect/nativeDevConnect.ts +1 -136
  217. package/src/features/devConnect/types.ts +1 -3
  218. package/src/features/network/NetworkLogTab.tsx +61 -71
  219. package/src/features/network/index.ts +12 -3
  220. package/src/features/sessionHistory/SessionHistoryTab.tsx +691 -0
  221. package/src/features/sessionHistory/index.ts +102 -0
  222. package/src/features/track/index.ts +10 -3
  223. package/src/index.ts +13 -0
  224. package/src/types/feature.ts +2 -1
  225. package/src/types/index.ts +10 -0
  226. package/src/ui/DebugView.tsx +6 -1
  227. package/src/ui/panel/DebugPanel.tsx +60 -30
  228. package/src/ui/panel/FeatureIntroCard.tsx +127 -0
  229. package/src/ui/panel/FeatureRail.tsx +165 -0
  230. package/src/ui/panel/FloatPanelView.tsx +176 -25
  231. package/src/ui/panel/buildFeatureSummary.ts +288 -0
  232. package/src/ui/panel/filterFeatureSnapshot.ts +51 -0
  233. package/src/ui/panel/tabPersistence.ts +22 -0
  234. package/src/ui/theme/colors.ts +7 -0
  235. package/src/utils/DaemonClient.ts +33 -5
  236. package/src/utils/SessionManager.ts +174 -0
  237. package/src/utils/StorageAdapter.ts +135 -0
  238. package/src/utils/createChannelFeature.ts +28 -6
  239. package/src/utils/createDebugTab.ts +32 -0
  240. package/src/utils/createPersistedObservableStore.ts +18 -10
  241. package/src/utils/debugPreferences.ts +38 -8
  242. package/src/utils/deviceReport.ts +5 -1
  243. package/src/utils/logRuntime.ts +39 -0
  244. package/app.plugin.js +0 -51
  245. package/dev-client.js +0 -3
  246. package/lib/commonjs/ui/panel/FeatureTabBar.js +0 -182
  247. package/lib/commonjs/ui/panel/FeatureTabBar.js.map +0 -1
  248. package/lib/module/ui/panel/FeatureTabBar.js +0 -177
  249. package/lib/module/ui/panel/FeatureTabBar.js.map +0 -1
  250. package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts +0 -13
  251. package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts.map +0 -1
  252. package/scripts/bundle/android.js +0 -101
  253. package/scripts/bundle/cli.js +0 -57
  254. package/scripts/bundle/doctor.js +0 -38
  255. package/scripts/bundle/ios.js +0 -179
  256. package/scripts/bundle/setup.js +0 -39
  257. package/scripts/debug-bundle.gradle +0 -147
  258. package/src/ui/panel/FeatureTabBar.tsx +0 -204
@@ -1,7 +1,7 @@
1
1
  import { DevConnectTab } from './DevConnectTab';
2
2
  import { loadDevConnectPreferences } from './devConnectPreferences';
3
- import { DEFAULT_DAEMON_PORT, DEFAULT_METRO_PORT, extractSubnetPrefix } from './devConnectUtils';
4
- import { getDeviceLocalIp, isNativeDevConnectAvailable } from './nativeDevConnect';
3
+ import { DEFAULT_DAEMON_PORT, extractSubnetPrefix } from './devConnectUtils';
4
+ import { getDeviceLocalIp } from './nativeDevConnect';
5
5
  import { isSimulator } from './platformDetect';
6
6
  import { daemonClient } from '../../utils/DaemonClient';
7
7
  import type { DebugFeature, DebugFeatureListener } from '../../types';
@@ -9,11 +9,9 @@ import type { DevConnectFeatureControls, DevConnectSettingsPatch, DevConnectStat
9
9
 
10
10
  export type { DevConnectState } from './types';
11
11
  export {
12
- buildMetroUrls,
13
12
  normalizeComputerHost,
14
13
  normalizePort,
15
14
  parseComputerTarget,
16
- parseMetroQrPayload,
17
15
  } from './devConnectUtils';
18
16
  export {
19
17
  loadDevConnectPreferences,
@@ -21,7 +19,6 @@ export {
21
19
  saveComputerHost,
22
20
  saveComputerTarget,
23
21
  saveDaemonPort,
24
- saveMetroPort,
25
22
  } from './devConnectPreferences';
26
23
  export { nativeIsDebugBuild } from './nativeDevConnect';
27
24
 
@@ -30,9 +27,7 @@ export const createDevConnectFeature = (): DebugFeature<DevConnectState> => {
30
27
  let state: DevConnectState = {
31
28
  isSimulator: isSimulator(),
32
29
  computerHost: '',
33
- metroPort: DEFAULT_METRO_PORT,
34
30
  daemonPort: DEFAULT_DAEMON_PORT,
35
- nativeMetroAvailable: isNativeDevConnectAvailable(),
36
31
  streaming: daemonClient.isConnected(),
37
32
  };
38
33
 
@@ -62,9 +57,7 @@ export const createDevConnectFeature = (): DebugFeature<DevConnectState> => {
62
57
  state = {
63
58
  ...state,
64
59
  computerHost: preferences.computerHost,
65
- metroPort: preferences.metroPort,
66
60
  daemonPort: preferences.daemonPort,
67
- nativeMetroAvailable: isNativeDevConnectAvailable(),
68
61
  };
69
62
 
70
63
  if (!state.isSimulator) {
@@ -1,55 +1,14 @@
1
1
  import { NativeModules } from 'react-native';
2
2
 
3
- import { buildMetroTarget } from './devConnectUtils';
4
-
5
- export interface NativeDiagnostics {
6
- persistedMetroHost: string | null;
7
- appDelegateClass: string;
8
- // Metro host switching only works in Debug builds (RN strips the packager machinery in
9
- // Release). False means the Remote JS Bundle controls should be disabled.
10
- isDebugBuild: boolean;
11
- hasEmbeddedBundle?: boolean;
12
- embeddedFirstHookInstalled?: boolean;
13
- packagerHookInstalled?: boolean;
14
- bundleRootHookInstalled?: boolean;
15
- }
16
-
17
3
  interface DebugToolkitDevConnectNativeModule {
18
- applyMetroHost: (hostPort: string) => Promise<{ hostPort?: string } | void>;
19
- resetMetroHost: () => Promise<void>;
20
- getMetroHost?: () => Promise<string | null>;
21
4
  getLocalIp?: () => Promise<string | null>;
22
5
  isDebugBuild?: () => Promise<boolean>;
23
6
  getPreference?: (key: string) => Promise<string | null>;
24
- getDiagnostics?: () => Promise<NativeDiagnostics>;
25
7
  }
26
8
 
27
- type MetroBundleFailureReason =
28
- | 'invalid_target'
29
- | 'native_unavailable'
30
- | 'fetch_unavailable'
31
- | 'metro_unreachable'
32
- | 'native_error';
33
-
34
- export type MetroBundleResult =
35
- | { ok: true; hostPort: string }
36
- | { ok: false; reason: MetroBundleFailureReason; error?: string; statusUrl?: string };
37
-
38
- type FetchLike = (
39
- url: string,
40
- init: { method: string },
41
- ) => Promise<{
42
- ok?: boolean;
43
- text?: () => Promise<string>;
44
- }>;
45
-
46
9
  function getNativeModule(): DebugToolkitDevConnectNativeModule | null {
47
10
  const nativeModule = NativeModules.DebugToolkitDevConnect as Partial<DebugToolkitDevConnectNativeModule> | undefined;
48
- if (
49
- nativeModule &&
50
- typeof nativeModule.applyMetroHost === 'function' &&
51
- typeof nativeModule.resetMetroHost === 'function'
52
- ) {
11
+ if (nativeModule && typeof nativeModule.isDebugBuild === 'function') {
53
12
  return nativeModule as DebugToolkitDevConnectNativeModule;
54
13
  }
55
14
  return null;
@@ -59,88 +18,6 @@ export function isNativeDevConnectAvailable(): boolean {
59
18
  return getNativeModule() !== null;
60
19
  }
61
20
 
62
- async function checkMetroStatus(statusUrl: string): Promise<MetroBundleResult | null> {
63
- const fetchImpl = globalThis.fetch as FetchLike | undefined;
64
- if (!fetchImpl) {
65
- return {
66
- ok: false,
67
- reason: 'fetch_unavailable',
68
- statusUrl,
69
- error: 'global fetch is not available',
70
- };
71
- }
72
-
73
- try {
74
- const response = await fetchImpl(statusUrl, { method: 'GET' });
75
- const body = typeof response.text === 'function' ? await response.text() : '';
76
- if (response.ok === false || !body.includes('packager-status:running')) {
77
- return {
78
- ok: false,
79
- reason: 'metro_unreachable',
80
- statusUrl,
81
- error: body || 'Metro status endpoint did not report running',
82
- };
83
- }
84
- return null;
85
- } catch (error) {
86
- return {
87
- ok: false,
88
- reason: 'metro_unreachable',
89
- statusUrl,
90
- error: error instanceof Error ? error.message : String(error),
91
- };
92
- }
93
- }
94
-
95
- export async function applyMetroBundle(host: string, port: string): Promise<MetroBundleResult> {
96
- const target = buildMetroTarget(host, port);
97
- if (!target) {
98
- return { ok: false, reason: 'invalid_target' };
99
- }
100
-
101
- const nativeModule = getNativeModule();
102
- if (!nativeModule) {
103
- return { ok: false, reason: 'native_unavailable' };
104
- }
105
-
106
- const statusError = await checkMetroStatus(target.statusUrl);
107
- if (statusError) {
108
- return statusError;
109
- }
110
-
111
- try {
112
- const result = await nativeModule.applyMetroHost(target.hostPort);
113
- return {
114
- ok: true,
115
- hostPort: result && typeof result.hostPort === 'string' ? result.hostPort : target.hostPort,
116
- };
117
- } catch (error) {
118
- return {
119
- ok: false,
120
- reason: 'native_error',
121
- error: error instanceof Error ? error.message : String(error),
122
- };
123
- }
124
- }
125
-
126
- export async function resetMetroBundle(): Promise<MetroBundleResult | { ok: true }> {
127
- const nativeModule = getNativeModule();
128
- if (!nativeModule) {
129
- return { ok: false, reason: 'native_unavailable' };
130
- }
131
-
132
- try {
133
- await nativeModule.resetMetroHost();
134
- return { ok: true };
135
- } catch (error) {
136
- return {
137
- ok: false,
138
- reason: 'native_error',
139
- error: error instanceof Error ? error.message : String(error),
140
- };
141
- }
142
- }
143
-
144
21
  export async function getDeviceLocalIp(): Promise<string | null> {
145
22
  const nativeModule = getNativeModule();
146
23
  if (!nativeModule?.getLocalIp) {
@@ -166,15 +43,3 @@ export async function nativeIsDebugBuild(): Promise<boolean | null> {
166
43
  return null;
167
44
  }
168
45
  }
169
-
170
- export async function getNativeDiagnostics(): Promise<NativeDiagnostics | null> {
171
- const nativeModule = getNativeModule();
172
- if (!nativeModule?.getDiagnostics) {
173
- return null;
174
- }
175
- try {
176
- return await nativeModule.getDiagnostics();
177
- } catch {
178
- return null;
179
- }
180
- }
@@ -1,15 +1,13 @@
1
1
  export interface DevConnectState {
2
2
  isSimulator: boolean;
3
3
  computerHost: string;
4
- metroPort: string;
5
4
  daemonPort: string;
6
5
  subnetPrefix?: string;
7
- nativeMetroAvailable: boolean;
8
6
  streaming: boolean;
9
7
  }
10
8
 
11
9
  export type DevConnectSettingsPatch = Partial<
12
- Pick<DevConnectState, 'computerHost' | 'metroPort' | 'daemonPort'>
10
+ Pick<DevConnectState, 'computerHost' | 'daemonPort'>
13
11
  >;
14
12
 
15
13
  export interface DevConnectFeatureControls {
@@ -1,9 +1,8 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  import {
3
3
  View,
4
4
  Text,
5
5
  StyleSheet,
6
- TextInput,
7
6
  ScrollView,
8
7
  } from 'react-native';
9
8
  import { Colors, getMethodColor } from '../../ui/theme/colors';
@@ -43,58 +42,38 @@ const buildCurl = (log: NetworkLogEntry): string => {
43
42
  export const NetworkLogTab: React.FC<DebugFeatureRenderProps<NetworkLogEntry[]>> = React.memo(({
44
43
  snapshot,
45
44
  }) => {
46
- const [search, setSearch] = useState('');
47
- const data = snapshot;
48
-
49
- const filtered = search
50
- ? data.filter(
51
- (l) =>
52
- l.request.url.toLowerCase().includes(search.toLowerCase()) ||
53
- l.request.method.toLowerCase().includes(search.toLowerCase()),
54
- )
55
- : data;
56
-
57
- const sorted = [...filtered].sort((a, b) => b.timestamp - a.timestamp);
45
+ const sorted = [...snapshot].sort((a, b) => b.timestamp - a.timestamp);
58
46
 
59
47
  return (
60
48
  <LogListScreen
61
49
  data={sorted}
62
50
  reversed={false}
63
51
  emptyText="No HTTP requests logged"
64
- renderListHeader={() => (
65
- <View style={s.searchContainer}>
66
- <View style={s.searchBar}>
67
- <Text style={s.searchIcon}>⌕</Text>
68
- <TextInput
69
- style={s.search}
70
- placeholder="Search URLs..."
71
- placeholderTextColor={Colors.textLight}
72
- value={search}
73
- onChangeText={setSearch}
74
- />
75
- </View>
76
- </View>
77
- )}
78
52
  renderRow={(item) => {
79
53
  const ok = !item.error && (!item.response || item.response.status < 400);
80
- const sc = ok ? Colors.success : Colors.error;
54
+ const statusColor = ok ? Colors.success : Colors.error;
55
+ const urlParts = formatUrlParts(item.request.url);
56
+
81
57
  return (
82
58
  <View style={s.cardRow}>
83
- <View style={[s.statusIndicator, { backgroundColor: sc }]} />
59
+ <View style={[s.statusIndicator, { backgroundColor: statusColor }]} />
84
60
  <View style={s.cardBody}>
85
- <View style={s.cardMeta}>
86
- <Text style={[s.methodText, { color: getMethodColor(item.request.method) }]}>
87
- {item.request.method}
61
+ <View style={s.primaryRow}>
62
+ <View style={[s.methodChip, { backgroundColor: getMethodColor(item.request.method) }]}>
63
+ <Text style={s.methodChipText}>{item.request.method}</Text>
64
+ </View>
65
+ <Text style={[s.pathText, !ok && { color: Colors.error }]} numberOfLines={1}>
66
+ {urlParts.path}
88
67
  </Text>
89
- <View style={[s.miniPill, { backgroundColor: sc }]}>
90
- <Text style={s.miniPillText}>{item.response?.status ?? 'ERR'}</Text>
68
+ <View style={[s.statusChip, { backgroundColor: statusColor }]}>
69
+ <Text style={s.statusChipText}>{item.response?.status ?? 'ERR'}</Text>
91
70
  </View>
92
- {item.duration != null && <Text style={s.durationText}>{item.duration}ms</Text>}
93
71
  </View>
94
- <Text style={[s.url, !ok && { color: Colors.error }]} numberOfLines={2}>
95
- {item.request.url}
96
- </Text>
97
- <Text style={s.time}>{new Date(item.timestamp).toLocaleTimeString()}</Text>
72
+ <View style={s.metaRow}>
73
+ {item.duration != null && <Text style={s.metaText}>{item.duration}ms</Text>}
74
+ {!!urlParts.host && <Text style={[s.metaText, s.hostText]} numberOfLines={1}>{urlParts.host}</Text>}
75
+ <Text style={s.time}>{new Date(item.timestamp).toLocaleTimeString()}</Text>
76
+ </View>
98
77
  </View>
99
78
  </View>
100
79
  );
@@ -185,43 +164,55 @@ export const NetworkLogTab: React.FC<DebugFeatureRenderProps<NetworkLogEntry[]>>
185
164
  );
186
165
  });
187
166
 
167
+ function formatUrlParts(url: string): { host: string; path: string } {
168
+ try {
169
+ const parsed = new URL(url);
170
+ return {
171
+ host: parsed.host,
172
+ path: parsed.pathname + parsed.search,
173
+ };
174
+ } catch {
175
+ return { host: '', path: url };
176
+ }
177
+ }
178
+
188
179
  const s = StyleSheet.create({
189
- // Search
190
- searchContainer: {
191
- paddingHorizontal: 12,
192
- paddingTop: 10,
193
- paddingBottom: 6,
194
- backgroundColor: Colors.background,
195
- },
196
- searchBar: {
180
+ cardRow: { flexDirection: 'row', padding: 12 },
181
+ statusIndicator: { width: 3, borderRadius: 2, marginRight: 10 },
182
+ cardBody: { flex: 1, gap: 7 },
183
+ primaryRow: {
197
184
  flexDirection: 'row',
198
185
  alignItems: 'center',
199
- backgroundColor: Colors.surface,
200
- borderRadius: 10,
201
- paddingHorizontal: 10,
202
- height: 38,
186
+ gap: 7,
187
+ minWidth: 0,
188
+ },
189
+ methodChip: {
190
+ paddingHorizontal: 8,
191
+ paddingVertical: 3,
192
+ borderRadius: 6,
203
193
  },
204
- searchIcon: { fontSize: 16, color: Colors.textLight, marginRight: 6 },
205
- search: {
194
+ methodChipText: {
195
+ color: '#FFF',
196
+ fontSize: 10,
197
+ fontWeight: '800',
198
+ },
199
+ pathText: {
206
200
  flex: 1,
207
- fontSize: 14,
201
+ fontSize: 13,
202
+ fontWeight: '700',
208
203
  color: Colors.text,
209
- padding: 0,
210
204
  },
211
-
212
- // Row
213
- cardRow: { flexDirection: 'row', padding: 14 },
214
- statusIndicator: { width: 3, borderRadius: 2, marginRight: 12 },
215
- cardBody: { flex: 1 },
216
- cardMeta: { flexDirection: 'row', alignItems: 'center', marginBottom: 6, gap: 6 },
217
- methodText: { fontSize: 13, fontWeight: '700' },
218
- miniPill: { paddingHorizontal: 7, paddingVertical: 2, borderRadius: 4 },
219
- miniPillText: { color: '#FFF', fontSize: 10, fontWeight: '700' },
220
- durationText: { fontSize: 12, color: Colors.textSecondary, fontWeight: '500' },
221
- url: { fontSize: 13, color: Colors.textSecondary, marginBottom: 4, lineHeight: 18 },
205
+ statusChip: { paddingHorizontal: 7, paddingVertical: 3, borderRadius: 6 },
206
+ statusChipText: { color: '#FFF', fontSize: 10, fontWeight: '800' },
207
+ metaRow: {
208
+ flexDirection: 'row',
209
+ alignItems: 'center',
210
+ gap: 7,
211
+ minWidth: 0,
212
+ },
213
+ metaText: { fontSize: 11, color: Colors.textSecondary, fontWeight: '600' },
214
+ hostText: { flex: 1 },
222
215
  time: { fontSize: 11, color: Colors.textLight },
223
-
224
- // Detail header
225
216
  detailHeaderCenter: {
226
217
  flexDirection: 'row',
227
218
  alignItems: 'center',
@@ -236,8 +227,7 @@ const s = StyleSheet.create({
236
227
  methodBadgeText: { color: '#FFF', fontSize: 12, fontWeight: '700' },
237
228
  statusPill: { paddingHorizontal: 9, paddingVertical: 3, borderRadius: 6 },
238
229
  statusPillText: { color: '#FFF', fontSize: 11, fontWeight: '700' },
239
-
240
- // Detail body
230
+ durationText: { fontSize: 12, color: Colors.textSecondary, fontWeight: '500' },
241
231
  detailBody: { flex: 1 },
242
232
  detailBodyContent: { padding: 12, paddingBottom: 40 },
243
233
  urlCard: {
@@ -3,7 +3,8 @@ import { NetworkLogTab } from './NetworkLogTab';
3
3
  import type { NetworkLogEntry } from '../../types';
4
4
  import { createChannelFeature } from '../../utils/createChannelFeature';
5
5
  import { createEventChannel } from '../../utils/createEventChannel';
6
- import { KEYS } from '../../utils/debugPreferences';
6
+ import { sanitizeDebugLogEntry } from '../../utils/deviceReport';
7
+ import { getDefaultLogRuntime, type LogRuntimeContext } from '../../utils/logRuntime';
7
8
  import {
8
9
  startXMLHttpRequest,
9
10
  resetInterceptors,
@@ -44,7 +45,10 @@ export interface NetworkFeatureConfig {
44
45
  blacklist?: Array<string | RegExp>;
45
46
  }
46
47
 
47
- export const createNetworkFeature = (config?: NetworkFeatureConfig) => {
48
+ export const createNetworkFeature = (
49
+ config?: NetworkFeatureConfig,
50
+ runtime: LogRuntimeContext = getDefaultLogRuntime(),
51
+ ) => {
48
52
  const userBlacklist = config?.blacklist ? [...config.blacklist] : [];
49
53
 
50
54
  return createChannelFeature<NetworkLogPayload, NetworkLogEntry>(
@@ -55,7 +59,12 @@ export const createNetworkFeature = (config?: NetworkFeatureConfig) => {
55
59
  label: 'Network',
56
60
  renderContent: NetworkLogTab,
57
61
  maxLogs: config?.maxLogs,
58
- persist: { storageKey: KEYS.networkLogs, maxPersist: 30 },
62
+ persist: {
63
+ storage: runtime.logStorage,
64
+ storageKey: runtime.sessionManager.getLogStorageKey('network_logs'),
65
+ maxPersist: 30,
66
+ serialize: (entry) => sanitizeDebugLogEntry(entry),
67
+ },
59
68
  beforePush: (payload) => {
60
69
  if (isUrlBlacklisted(payload.request.url, [...userBlacklist, ...daemonEndpointBlacklist])) {
61
70
  return null;