react-native-inapp-inspector 1.1.34 → 2.0.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.
- package/README.md +123 -101
- package/android/build.gradle +13 -1
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +904 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorPackage.kt +17 -0
- package/dist/commonjs/components/ConsoleLogCard.js +57 -56
- package/dist/commonjs/components/CopyButton.js +10 -1
- package/dist/commonjs/components/ErrorBoundary.js +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +7 -3
- package/dist/commonjs/components/Inspector/BundleTab.js +20 -20
- package/dist/commonjs/components/Inspector/ConsoleTab.js +1 -1
- package/dist/commonjs/components/Inspector/CrashDetail.js +16 -12
- package/dist/commonjs/components/Inspector/CrashTab.js +97 -90
- package/dist/commonjs/components/Inspector/InspectorHeader.js +28 -24
- package/dist/commonjs/components/Inspector/MainScreen.js +20 -103
- package/dist/commonjs/components/Inspector/NetworkTab.js +143 -10
- package/dist/commonjs/components/Inspector/PerformanceTab.js +96 -3
- package/dist/commonjs/components/Inspector/ReduxDetail.js +24 -19
- package/dist/commonjs/components/Inspector/ReduxTab.js +30 -18
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1578 -754
- package/dist/commonjs/components/Inspector/TabBar.js +6 -3
- package/dist/commonjs/components/LogCard.js +27 -9
- package/dist/commonjs/components/MetaAccordion.js +42 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +10 -0
- package/dist/commonjs/components/NetworkIcons.js +53 -1
- package/dist/commonjs/components/Toast.js +3 -3
- package/dist/commonjs/components/TouchableScale.d.ts +5 -2
- package/dist/commonjs/components/TouchableScale.js +30 -32
- package/dist/commonjs/constants/index.d.ts +1 -2
- package/dist/commonjs/constants/index.js +4 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +6 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +16 -5
- package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +2 -0
- package/dist/commonjs/customHooks/bundleAnalyzer.js +26 -17
- package/dist/commonjs/customHooks/consoleLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/consoleLogger.js +10 -1
- package/dist/commonjs/customHooks/crashHandler.d.ts +2 -0
- package/dist/commonjs/customHooks/crashHandler.js +17 -1
- package/dist/commonjs/customHooks/networkLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/networkLogger.js +12 -1
- package/dist/commonjs/customHooks/performanceTracker.d.ts +3 -1
- package/dist/commonjs/customHooks/performanceTracker.js +18 -4
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/reduxLogger.js +10 -1
- package/dist/commonjs/helpers/index.js +10 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +9 -0
- package/dist/commonjs/helpers/settingsStore.js +59 -3
- package/dist/commonjs/i18n/locales/en.json +96 -28
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +307 -73
- package/dist/commonjs/native/NativeInspector.d.ts +125 -0
- package/dist/commonjs/native/NativeInspector.js +313 -0
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +22 -0
- package/dist/commonjs/native/NativeNetworkInspector.js +4 -0
- package/dist/commonjs/styles/AppColors.d.ts +28 -0
- package/dist/commonjs/styles/AppColors.js +30 -0
- package/dist/commonjs/styles/index.js +6 -6
- package/dist/commonjs/types/enums.d.ts +1 -1
- package/dist/commonjs/types/interfaces.d.ts +9 -0
- package/dist/esm/components/ConsoleLogCard.js +58 -57
- package/dist/esm/components/CopyButton.js +10 -1
- package/dist/esm/components/ErrorBoundary.js +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +7 -3
- package/dist/esm/components/Inspector/BundleTab.js +20 -20
- package/dist/esm/components/Inspector/ConsoleTab.js +1 -1
- package/dist/esm/components/Inspector/CrashDetail.js +16 -12
- package/dist/esm/components/Inspector/CrashTab.js +97 -90
- package/dist/esm/components/Inspector/InspectorHeader.js +29 -25
- package/dist/esm/components/Inspector/MainScreen.js +21 -71
- package/dist/esm/components/Inspector/NetworkTab.js +145 -12
- package/dist/esm/components/Inspector/PerformanceTab.js +96 -3
- package/dist/esm/components/Inspector/ReduxDetail.js +24 -19
- package/dist/esm/components/Inspector/ReduxTab.js +30 -18
- package/dist/esm/components/Inspector/SettingsPanel.js +1582 -758
- package/dist/esm/components/Inspector/TabBar.js +7 -4
- package/dist/esm/components/LogCard.js +27 -9
- package/dist/esm/components/MetaAccordion.js +42 -0
- package/dist/esm/components/NetworkIcons.d.ts +10 -0
- package/dist/esm/components/NetworkIcons.js +42 -0
- package/dist/esm/components/Toast.js +3 -3
- package/dist/esm/components/TouchableScale.d.ts +5 -2
- package/dist/esm/components/TouchableScale.js +31 -33
- package/dist/esm/constants/index.d.ts +1 -2
- package/dist/esm/constants/index.js +4 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.d.ts +6 -0
- package/dist/esm/customHooks/analyticsLogger.js +12 -4
- package/dist/esm/customHooks/bundleAnalyzer.d.ts +2 -0
- package/dist/esm/customHooks/bundleAnalyzer.js +23 -16
- package/dist/esm/customHooks/consoleLogger.d.ts +2 -0
- package/dist/esm/customHooks/consoleLogger.js +7 -0
- package/dist/esm/customHooks/crashHandler.d.ts +2 -0
- package/dist/esm/customHooks/crashHandler.js +14 -0
- package/dist/esm/customHooks/networkLogger.d.ts +2 -0
- package/dist/esm/customHooks/networkLogger.js +9 -0
- package/dist/esm/customHooks/performanceTracker.d.ts +3 -1
- package/dist/esm/customHooks/performanceTracker.js +15 -3
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -0
- package/dist/esm/customHooks/reduxLogger.js +7 -0
- package/dist/esm/helpers/index.js +10 -1
- package/dist/esm/helpers/settingsStore.d.ts +9 -0
- package/dist/esm/helpers/settingsStore.js +58 -3
- package/dist/esm/i18n/locales/en.json +96 -28
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +279 -59
- package/dist/esm/native/NativeInspector.d.ts +125 -0
- package/dist/esm/native/NativeInspector.js +289 -0
- package/dist/esm/native/NativeNetworkInspector.d.ts +22 -0
- package/dist/esm/native/NativeNetworkInspector.js +2 -0
- package/dist/esm/styles/AppColors.d.ts +28 -0
- package/dist/esm/styles/AppColors.js +30 -0
- package/dist/esm/styles/index.js +6 -6
- package/dist/esm/types/enums.d.ts +1 -1
- package/dist/esm/types/interfaces.d.ts +9 -0
- package/ios/NetworkInspectorModule.h +6 -0
- package/ios/NetworkInspectorModule.m +720 -5
- package/package.json +15 -3
- package/react-native-inapp-inspector.podspec +7 -2
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.java +0 -97
- package/android/src/main/java/com/inappinspector/NetworkInspectorPackage.java +0 -28
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Animated, ScrollView, Text, View } from 'react-native';
|
|
2
|
+
import { Animated, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import { useInspector } from './InspectorContext';
|
|
4
|
-
import TouchableScale from '../TouchableScale';
|
|
5
4
|
import styles from '../../styles';
|
|
6
5
|
import { AppColors } from '../../styles/AppColors';
|
|
7
6
|
import { SignalIcon, TerminalIcon, AnalyticsIcon, PackageIcon, ReduxIcon, PerformanceIcon, CrashIcon, } from '../NetworkIcons';
|
|
8
7
|
import { isReduxConnected } from '../../customHooks/reduxLogger';
|
|
9
8
|
import { isAnalyticsConnected } from '../../customHooks/analyticsLogger';
|
|
9
|
+
import { triggerNativeHaptic } from '../../native/NativeInspector';
|
|
10
10
|
const TabBar = React.memo(() => {
|
|
11
11
|
const { activeTab, switchActiveTab, tabVisibility, logs, consoleLogs, analyticsEvents, crashRecords, lastReadApisCount, lastReadLogsCount, lastReadCrashesCount, unreadPulseAnim, } = useInspector();
|
|
12
12
|
const isReduxAvail = isReduxConnected();
|
|
@@ -80,7 +80,10 @@ const TabBar = React.memo(() => {
|
|
|
80
80
|
consoleLogs.length > lastReadLogsCount;
|
|
81
81
|
const hasUnreadCrashes = activeTab !== 'crash' &&
|
|
82
82
|
(crashRecords?.length || 0) > (lastReadCrashesCount || 0);
|
|
83
|
-
return (<
|
|
83
|
+
return (<TouchableOpacity key={tab.key} activeOpacity={0.7} onPress={() => {
|
|
84
|
+
switchActiveTab(tab.key);
|
|
85
|
+
triggerNativeHaptic('light');
|
|
86
|
+
}} style={[
|
|
84
87
|
styles.contentTabButton,
|
|
85
88
|
isActive && styles.contentTabButtonActive,
|
|
86
89
|
]}>
|
|
@@ -116,7 +119,7 @@ const TabBar = React.memo(() => {
|
|
|
116
119
|
transform: [{ scale: unreadPulseAnim }],
|
|
117
120
|
}}/>)}
|
|
118
121
|
</View>
|
|
119
|
-
</
|
|
122
|
+
</TouchableOpacity>);
|
|
120
123
|
})}
|
|
121
124
|
</ScrollView>
|
|
122
125
|
</View>);
|
|
@@ -134,11 +134,11 @@ const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, t
|
|
|
134
134
|
styles.chip,
|
|
135
135
|
{
|
|
136
136
|
backgroundColor: item.url.toLowerCase().startsWith('https')
|
|
137
|
-
?
|
|
138
|
-
:
|
|
137
|
+
? AppColors.mintGreenBg
|
|
138
|
+
: AppColors.amberWarmBg,
|
|
139
139
|
borderColor: item.url.toLowerCase().startsWith('https')
|
|
140
|
-
?
|
|
141
|
-
:
|
|
140
|
+
? AppColors.mintGreenBorder
|
|
141
|
+
: AppColors.amberWarmBorder,
|
|
142
142
|
paddingHorizontal: 4,
|
|
143
143
|
paddingVertical: 1,
|
|
144
144
|
borderRadius: 4,
|
|
@@ -150,8 +150,8 @@ const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, t
|
|
|
150
150
|
fontFamily: AppFonts.interBold,
|
|
151
151
|
fontSize: 8,
|
|
152
152
|
color: item.url.toLowerCase().startsWith('https')
|
|
153
|
-
?
|
|
154
|
-
:
|
|
153
|
+
? AppColors.mintGreenText
|
|
154
|
+
: AppColors.amber700,
|
|
155
155
|
},
|
|
156
156
|
]}>
|
|
157
157
|
{item.url.toLowerCase().startsWith('https') ? 'HTTPS' : 'HTTP'}
|
|
@@ -164,8 +164,8 @@ const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, t
|
|
|
164
164
|
item.client === 'graphql') && (<View style={[
|
|
165
165
|
styles.chip,
|
|
166
166
|
{
|
|
167
|
-
backgroundColor:
|
|
168
|
-
borderColor:
|
|
167
|
+
backgroundColor: AppColors.roseBg,
|
|
168
|
+
borderColor: AppColors.roseBorder,
|
|
169
169
|
paddingHorizontal: 4,
|
|
170
170
|
paddingVertical: 1,
|
|
171
171
|
borderRadius: 4,
|
|
@@ -176,7 +176,7 @@ const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, t
|
|
|
176
176
|
{
|
|
177
177
|
fontFamily: AppFonts.interBold,
|
|
178
178
|
fontSize: 8,
|
|
179
|
-
color:
|
|
179
|
+
color: AppColors.pink600,
|
|
180
180
|
},
|
|
181
181
|
]}>
|
|
182
182
|
GQL
|
|
@@ -316,6 +316,24 @@ const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, t
|
|
|
316
316
|
</View>)}
|
|
317
317
|
</View>
|
|
318
318
|
</View>
|
|
319
|
+
|
|
320
|
+
{/* Mini Latency Timing Waterfall Bar */}
|
|
321
|
+
{typeof item.duration === 'number' && item.duration > 0 && !isFailed && (<View style={{ marginTop: 6, gap: 2 }}>
|
|
322
|
+
<View style={{
|
|
323
|
+
height: 2.5,
|
|
324
|
+
width: '100%',
|
|
325
|
+
backgroundColor: AppColors.grayBorderSecondary,
|
|
326
|
+
borderRadius: 1.5,
|
|
327
|
+
overflow: 'hidden',
|
|
328
|
+
}}>
|
|
329
|
+
<View style={{
|
|
330
|
+
height: '100%',
|
|
331
|
+
width: `${Math.min(100, Math.max(6, (item.duration / 1200) * 100))}%`,
|
|
332
|
+
backgroundColor: durationColor,
|
|
333
|
+
borderRadius: 1.5,
|
|
334
|
+
}}/>
|
|
335
|
+
</View>
|
|
336
|
+
</View>)}
|
|
319
337
|
</View>
|
|
320
338
|
<Animated.View pointerEvents="none" style={[
|
|
321
339
|
StyleSheet.absoluteFill,
|
|
@@ -170,6 +170,48 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, metho
|
|
|
170
170
|
</Text>
|
|
171
171
|
</View>
|
|
172
172
|
</View>
|
|
173
|
+
|
|
174
|
+
{/* Visual Latency Timing Breakdown Waterfall */}
|
|
175
|
+
{duration != null && !isFailed && (<View style={{ paddingVertical: 8, gap: 6 }}>
|
|
176
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
|
|
177
|
+
<Text style={{ fontFamily: AppFonts.interBold, fontSize: 11, color: AppColors.primaryBlack }}>
|
|
178
|
+
{t('network.timingWaterfall')}
|
|
179
|
+
</Text>
|
|
180
|
+
<Text style={{ fontFamily: AppFonts.interMedium, fontSize: 10.5, color: getDurationColor(duration) }}>
|
|
181
|
+
{duration < DURATION_FAST_MS
|
|
182
|
+
? t('network.perf.fast')
|
|
183
|
+
: duration < DURATION_SLOW_MS
|
|
184
|
+
? t('network.perf.moderate')
|
|
185
|
+
: t('network.perf.slow')}
|
|
186
|
+
</Text>
|
|
187
|
+
</View>
|
|
188
|
+
|
|
189
|
+
<View style={{
|
|
190
|
+
height: 6,
|
|
191
|
+
backgroundColor: AppColors.grayBorderSecondary,
|
|
192
|
+
borderRadius: 3,
|
|
193
|
+
overflow: 'hidden',
|
|
194
|
+
}}>
|
|
195
|
+
<View style={{
|
|
196
|
+
height: '100%',
|
|
197
|
+
width: `${Math.min(100, Math.max(8, (duration / 1200) * 100))}%`,
|
|
198
|
+
backgroundColor: getDurationColor(duration),
|
|
199
|
+
borderRadius: 3,
|
|
200
|
+
}}/>
|
|
201
|
+
</View>
|
|
202
|
+
|
|
203
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginTop: 1 }}>
|
|
204
|
+
<Text style={{ fontFamily: AppFonts.interRegular, fontSize: 9.5, color: AppColors.grayTextWeak }}>
|
|
205
|
+
0 ms
|
|
206
|
+
</Text>
|
|
207
|
+
<Text style={{ fontFamily: AppFonts.interBold, fontSize: 10, color: getDurationColor(duration) }}>
|
|
208
|
+
{duration} ms
|
|
209
|
+
</Text>
|
|
210
|
+
<Text style={{ fontFamily: AppFonts.interRegular, fontSize: 9.5, color: AppColors.grayTextWeak }}>
|
|
211
|
+
1,200+ ms
|
|
212
|
+
</Text>
|
|
213
|
+
</View>
|
|
214
|
+
</View>)}
|
|
173
215
|
<View style={styles.metaDivider}/>
|
|
174
216
|
|
|
175
217
|
<View style={styles.metaRow}>
|
|
@@ -115,3 +115,13 @@ export declare const AppFramesIcon: ({ color, size, }: IconProps) => React.JSX.E
|
|
|
115
115
|
export declare const AllFramesIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
116
116
|
export declare const ListenerIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
117
117
|
export declare const LoadingSpinnerIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
118
|
+
export declare const FlaskIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
119
|
+
export declare const ZapIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
120
|
+
export declare const DiceIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
121
|
+
export declare const BarChartIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
122
|
+
export declare const KeyIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
123
|
+
export declare const SmartphoneIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
124
|
+
export declare const AlertTriangleIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
125
|
+
export declare const BugIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
126
|
+
export declare const TagIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
127
|
+
export declare const NpmIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
@@ -662,3 +662,45 @@ export const LoadingSpinnerIcon = ({ color = AppColors.amber800Warm, size = 12,
|
|
|
662
662
|
<Path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" stroke={color} strokeWidth="2.2" strokeLinecap="round"/>
|
|
663
663
|
</Svg>);
|
|
664
664
|
};
|
|
665
|
+
export const FlaskIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
666
|
+
<Path d="M10 2v5.5L4.4 18.2A2 2 0 0 0 6.2 21h11.6a2 2 0 0 0 1.8-2.8L14 7.5V2M8.5 2h7M7 15h10" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
667
|
+
<Circle cx="12" cy="18" r="1" fill={color}/>
|
|
668
|
+
</Svg>);
|
|
669
|
+
export const ZapIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
670
|
+
<Path d="M13 2 3 14h9l-1 8 10-12h-9l1-8z" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
671
|
+
</Svg>);
|
|
672
|
+
export const DiceIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
673
|
+
<Rect x="3" y="3" width="18" height="18" rx="4" stroke={color} strokeWidth="1.8"/>
|
|
674
|
+
<Circle cx="8.5" cy="8.5" r="1.5" fill={color}/>
|
|
675
|
+
<Circle cx="15.5" cy="8.5" r="1.5" fill={color}/>
|
|
676
|
+
<Circle cx="12" cy="12" r="1.5" fill={color}/>
|
|
677
|
+
<Circle cx="8.5" cy="15.5" r="1.5" fill={color}/>
|
|
678
|
+
<Circle cx="15.5" cy="15.5" r="1.5" fill={color}/>
|
|
679
|
+
</Svg>);
|
|
680
|
+
export const BarChartIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
681
|
+
<Path d="M18 20V10M12 20V4M6 20v-6" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
682
|
+
</Svg>);
|
|
683
|
+
export const KeyIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
684
|
+
<Circle cx="7.5" cy="15.5" r="4.5" stroke={color} strokeWidth="1.8"/>
|
|
685
|
+
<Path d="m11 12 8.5-8.5M16 4.5l3 3M19 7.5l2-2" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
686
|
+
</Svg>);
|
|
687
|
+
export const SmartphoneIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
688
|
+
<Rect x="5" y="2" width="14" height="20" rx="3" stroke={color} strokeWidth="1.8"/>
|
|
689
|
+
<Path d="M12 18h.01" stroke={color} strokeWidth="2.5" strokeLinecap="round"/>
|
|
690
|
+
</Svg>);
|
|
691
|
+
export const AlertTriangleIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
692
|
+
<Path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
693
|
+
<Path d="M12 9v4M12 17h.01" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
694
|
+
</Svg>);
|
|
695
|
+
export const BugIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
696
|
+
<Rect width="8" height="12" x="8" y="8" rx="4" stroke={color} strokeWidth="1.8"/>
|
|
697
|
+
<Path d="m19 7-3 2M5 7l3 2M19 19l-3-2M5 19l3-2M20 13h-4M4 13h4M10 4l2 2 2-2" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
698
|
+
</Svg>);
|
|
699
|
+
export const TagIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
700
|
+
<Path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8 8a2 2 0 0 0 2.828 0l7.172-7.172a2 2 0 0 0 0-2.828l-8-8z" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
701
|
+
<Circle cx="7.5" cy="7.5" r="1.5" fill={color}/>
|
|
702
|
+
</Svg>);
|
|
703
|
+
export const NpmIcon = ({ color = '#CB3837', size = 14 }) => (<Svg width={size} height={size} viewBox="0 0 256 256" fill="none">
|
|
704
|
+
<Rect width="256" height="256" rx="32" fill={color}/>
|
|
705
|
+
<Path d="M48 48h160v160h-32V96h-32v112H48V48z" fill="#FFFFFF"/>
|
|
706
|
+
</Svg>);
|
|
@@ -85,17 +85,17 @@ const styles = StyleSheet.create({
|
|
|
85
85
|
toastCard: {
|
|
86
86
|
flexDirection: 'row',
|
|
87
87
|
alignItems: 'center',
|
|
88
|
-
backgroundColor:
|
|
88
|
+
backgroundColor: AppColors.toastBg,
|
|
89
89
|
paddingVertical: 10,
|
|
90
90
|
paddingHorizontal: 16,
|
|
91
91
|
borderRadius: 24,
|
|
92
|
-
shadowColor:
|
|
92
|
+
shadowColor: AppColors.black,
|
|
93
93
|
shadowOffset: { width: 0, height: 6 },
|
|
94
94
|
shadowOpacity: 0.28,
|
|
95
95
|
shadowRadius: 10,
|
|
96
96
|
elevation: 8,
|
|
97
97
|
borderWidth: 1,
|
|
98
|
-
borderColor:
|
|
98
|
+
borderColor: AppColors.toastBorder,
|
|
99
99
|
maxWidth: '90%',
|
|
100
100
|
gap: 9,
|
|
101
101
|
},
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { PressableProps } from 'react-native';
|
|
3
|
+
export interface TouchableScaleProps extends PressableProps {
|
|
3
4
|
onPress?: () => void;
|
|
4
5
|
onLongPress?: () => void;
|
|
5
6
|
style?: any;
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
hitSlop?: any;
|
|
8
9
|
disabled?: boolean;
|
|
9
|
-
|
|
10
|
+
enableHaptics?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const TouchableScale: React.NamedExoticComponent<TouchableScaleProps>;
|
|
10
13
|
export default TouchableScale;
|
|
@@ -1,47 +1,45 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
|
-
import { Animated, Pressable
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
style,
|
|
7
|
-
{ opacity: pressed ? 0.75 : 1 },
|
|
8
|
-
]}>
|
|
9
|
-
{children}
|
|
10
|
-
</Pressable>);
|
|
11
|
-
}
|
|
2
|
+
import { Animated, Pressable } from 'react-native';
|
|
3
|
+
import { triggerNativeHaptic } from '../native/NativeInspector';
|
|
4
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
5
|
+
const TouchableScale = React.memo(function TouchableScale({ onPress, onLongPress, style, children, hitSlop, disabled, enableHaptics = true, accessible, accessibilityRole, accessibilityLabel, accessibilityHint, accessibilityState, accessibilityValue, ...rest }) {
|
|
12
6
|
const scale = useRef(new Animated.Value(1)).current;
|
|
13
7
|
const opacity = useRef(new Animated.Value(1)).current;
|
|
14
|
-
const
|
|
8
|
+
const handlePressIn = () => {
|
|
9
|
+
if (disabled)
|
|
10
|
+
return;
|
|
11
|
+
if (enableHaptics) {
|
|
12
|
+
triggerNativeHaptic('light');
|
|
13
|
+
}
|
|
15
14
|
Animated.parallel([
|
|
16
|
-
Animated.
|
|
17
|
-
toValue:
|
|
18
|
-
|
|
19
|
-
tension: 120,
|
|
15
|
+
Animated.timing(scale, {
|
|
16
|
+
toValue: 0.94,
|
|
17
|
+
duration: 50,
|
|
20
18
|
useNativeDriver: true,
|
|
21
19
|
}),
|
|
22
20
|
Animated.timing(opacity, {
|
|
23
|
-
toValue:
|
|
24
|
-
duration:
|
|
21
|
+
toValue: 0.85,
|
|
22
|
+
duration: 50,
|
|
25
23
|
useNativeDriver: true,
|
|
26
24
|
}),
|
|
27
25
|
]).start();
|
|
28
26
|
};
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
const handlePressOut = () => {
|
|
28
|
+
Animated.parallel([
|
|
29
|
+
Animated.timing(scale, {
|
|
30
|
+
toValue: 1,
|
|
31
|
+
duration: 100,
|
|
32
|
+
useNativeDriver: true,
|
|
33
|
+
}),
|
|
34
|
+
Animated.timing(opacity, {
|
|
35
|
+
toValue: 1,
|
|
36
|
+
duration: 100,
|
|
37
|
+
useNativeDriver: true,
|
|
38
|
+
}),
|
|
39
|
+
]).start();
|
|
40
40
|
};
|
|
41
|
-
return (<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</Animated.View>
|
|
45
|
-
</Pressable>);
|
|
41
|
+
return (<AnimatedPressable accessible={accessible} accessibilityRole={accessibilityRole} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} accessibilityState={accessibilityState} accessibilityValue={accessibilityValue} disabled={disabled} style={[style, { opacity, transform: [{ scale }] }]} onPressIn={handlePressIn} onPressOut={handlePressOut} onPress={onPress} onLongPress={onLongPress} hitSlop={hitSlop} {...rest}>
|
|
42
|
+
{children}
|
|
43
|
+
</AnimatedPressable>);
|
|
46
44
|
});
|
|
47
45
|
export default TouchableScale;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Method } from '../types';
|
|
2
|
-
|
|
3
|
-
export declare const STATUS_FILTERS: StatusFilter[];
|
|
2
|
+
export declare const STATUS_FILTERS: string[];
|
|
4
3
|
export declare const METHOD_COLORS: Record<Method, string>;
|
|
5
4
|
export declare const DOMAIN_COLORS: string[];
|
|
6
5
|
export declare const DURATION_FAST_MS = 200;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "
|
|
1
|
+
export declare const LIB_VERSION = "2.0.0";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { AnalyticsEvent } from '../types';
|
|
2
|
+
export declare const setAnalyticsModuleEnabled: (enabled: boolean) => void;
|
|
3
|
+
export declare const getAnalyticsModuleEnabled: () => boolean;
|
|
2
4
|
export declare const subscribeAnalyticsEvents: (callback: (events: AnalyticsEvent[]) => void) => () => void;
|
|
3
5
|
export declare const clearAnalyticsEvents: () => void;
|
|
4
6
|
export declare const getAnalyticsEvents: () => AnalyticsEvent[];
|
|
@@ -15,6 +17,10 @@ export declare const getCollectionEnabled: () => boolean;
|
|
|
15
17
|
* Useful for custom analytics wrappers or testing.
|
|
16
18
|
*/
|
|
17
19
|
export declare const logAnalyticsEvent: (name: string, params?: Record<string, any>, userProperties?: Record<string, any>) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Returns true if analytics logging is active (always ready for custom and Firebase events).
|
|
22
|
+
*/
|
|
18
23
|
export declare const isAnalyticsConnected: () => boolean;
|
|
24
|
+
export declare const isFirebaseAnalyticsPatched: () => boolean;
|
|
19
25
|
export declare const setupAnalyticsLogger: (analyticsInstance: any) => void;
|
|
20
26
|
export declare const autoSetupAnalyticsLogger: () => boolean;
|
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
let events = [];
|
|
25
25
|
let listeners = [];
|
|
26
26
|
let counter = 0;
|
|
27
|
+
let isAnalyticsModuleEnabled = false;
|
|
28
|
+
export const setAnalyticsModuleEnabled = (enabled) => {
|
|
29
|
+
isAnalyticsModuleEnabled = enabled;
|
|
30
|
+
};
|
|
31
|
+
export const getAnalyticsModuleEnabled = () => isAnalyticsModuleEnabled;
|
|
27
32
|
// Running snapshot of user properties set so far — attached to every event
|
|
28
33
|
let currentUserProperties = {};
|
|
29
34
|
let currentUserId;
|
|
@@ -35,6 +40,8 @@ const notify = () => {
|
|
|
35
40
|
listeners.forEach(cb => cb(snapshot));
|
|
36
41
|
};
|
|
37
42
|
const addEvent = (event) => {
|
|
43
|
+
if (!isAnalyticsModuleEnabled)
|
|
44
|
+
return;
|
|
38
45
|
events.unshift(event);
|
|
39
46
|
events = events.slice(0, 200);
|
|
40
47
|
notify();
|
|
@@ -87,10 +94,11 @@ export const logAnalyticsEvent = (name, params = {}, userProperties = {}) => {
|
|
|
87
94
|
* setupAnalyticsLogger(analytics());
|
|
88
95
|
*/
|
|
89
96
|
let isAnalyticsPatched = false;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Returns true if analytics logging is active (always ready for custom and Firebase events).
|
|
99
|
+
*/
|
|
100
|
+
export const isAnalyticsConnected = () => true;
|
|
101
|
+
export const isFirebaseAnalyticsPatched = () => isAnalyticsPatched;
|
|
94
102
|
export const setupAnalyticsLogger = (analyticsInstance) => {
|
|
95
103
|
if (!analyticsInstance) {
|
|
96
104
|
console.warn('[AnalyticsLogger] No analytics instance provided — skipping setup.');
|
|
@@ -103,6 +103,8 @@ export interface HostBundleAnalysisResult {
|
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
+
export declare const setBundleModuleEnabled: (enabled: boolean) => void;
|
|
107
|
+
export declare const getBundleModuleEnabled: () => boolean;
|
|
106
108
|
export declare const getHostScriptURL: () => string;
|
|
107
109
|
export declare const trackRuntimeModuleExecution: () => void;
|
|
108
110
|
export declare const trackRuntimeDefine: () => void;
|
|
@@ -13,6 +13,11 @@ import { NativeModules, Platform, TurboModuleRegistry } from 'react-native';
|
|
|
13
13
|
let cachedAnalysis = null;
|
|
14
14
|
let isAnalyzing = false;
|
|
15
15
|
const subscribers = [];
|
|
16
|
+
let isBundleModuleEnabled = false;
|
|
17
|
+
export const setBundleModuleEnabled = (enabled) => {
|
|
18
|
+
isBundleModuleEnabled = enabled;
|
|
19
|
+
};
|
|
20
|
+
export const getBundleModuleEnabled = () => isBundleModuleEnabled;
|
|
16
21
|
const getSourceCodeModule = () => {
|
|
17
22
|
try {
|
|
18
23
|
const legacy = NativeModules?.SourceCode;
|
|
@@ -699,31 +704,33 @@ export const parseBundleSource = (bundleText, totalBytes, scriptURL, isLive = tr
|
|
|
699
704
|
const releaseJsMb = Number(((totalDevKb * 0.38) / 1024).toFixed(2));
|
|
700
705
|
const nodeModulesMb = Number((nodeModulesKb / 1024).toFixed(2));
|
|
701
706
|
const assetsMediaMb = Number((assetsMediaKb / 1024).toFixed(2));
|
|
702
|
-
|
|
707
|
+
// In node_modules, only ~15-20% of packages contain compiled native code (C++ .so, Swift/Obj-C)
|
|
708
|
+
// Clamp effective native packages so large JS dependency trees (150+ packages) scale realistically
|
|
709
|
+
const effectiveNativePkgCount = Math.min(packagesList.length, 55);
|
|
703
710
|
// ─── 1. iOS Binary Calculations (.ipa / App Store) ────────────────────────
|
|
704
711
|
// Base React Native iOS engine Mach-O + third-party dynamic Frameworks + Assets + Hermes
|
|
705
|
-
const nativeFrameworksMb = Number((
|
|
706
|
-
const nativeMachoMb = Number((
|
|
707
|
-
const assetsCatalogMb = Number((
|
|
712
|
+
const nativeFrameworksMb = Number((48.0 + effectiveNativePkgCount * 0.35 + nodeModulesMb * 0.9).toFixed(1));
|
|
713
|
+
const nativeMachoMb = Number((38.0 + effectiveNativePkgCount * 0.22 + nodeModulesMb * 0.6).toFixed(1));
|
|
714
|
+
const assetsCatalogMb = Number((30.0 + assetsMediaMb * 2.2).toFixed(1));
|
|
708
715
|
const metadataMb = 6.4;
|
|
709
716
|
const iosInstallMb = Number((releaseJsMb + nativeFrameworksMb + nativeMachoMb + assetsCatalogMb + metadataMb).toFixed(1));
|
|
710
|
-
// iOS .ipa is a compressed ZIP archive of the app bundle (typically
|
|
711
|
-
const iosDownloadMb = Number((iosInstallMb * 0.
|
|
717
|
+
// iOS .ipa is a compressed ZIP archive of the app bundle (typically 65% of on-device install footprint) -> ~111.9 MB
|
|
718
|
+
const iosDownloadMb = Number((iosInstallMb * 0.655).toFixed(1));
|
|
712
719
|
// ─── 2. Android Google Play App Bundle (.aab / dynamic split delivery) ───
|
|
713
|
-
const androidCppMb = Number((
|
|
714
|
-
const androidDexMb = Number((
|
|
715
|
-
const androidResMb = Number((
|
|
720
|
+
const androidCppMb = Number((20.0 + effectiveNativePkgCount * 0.12 + nodeModulesMb * 0.4).toFixed(1));
|
|
721
|
+
const androidDexMb = Number((14.0 + effectiveNativePkgCount * 0.08 + nodeModulesMb * 0.25).toFixed(1));
|
|
722
|
+
const androidResMb = Number((16.0 + assetsMediaMb * 1.5).toFixed(1));
|
|
716
723
|
const androidInstallMb = Number((releaseJsMb + androidCppMb + androidDexMb + androidResMb + 3.8).toFixed(1));
|
|
717
|
-
const androidDownloadMb = Number((androidInstallMb * 0.
|
|
724
|
+
const androidDownloadMb = Number((androidInstallMb * 0.54).toFixed(1));
|
|
718
725
|
// ─── 3. Universal Standalone FAT APK (.apk) ───────────────────────────────
|
|
719
726
|
// Multi-ABI FAT APK bundling 4 distinct native architectures (arm64-v8a + armeabi-v7a + x86_64 + x86)
|
|
720
|
-
//
|
|
721
|
-
const androidMultiAbiCppMb = Number((
|
|
722
|
-
const androidApkDexMb = Number((
|
|
723
|
-
const androidApkResMb = Number((
|
|
724
|
-
const androidApkMetaMb = 8.
|
|
727
|
+
// Base multi-ABI engine C++ libraries (libhermes.so, libreactnativejni.so, libfbjni.so, libc++_shared.so) ~195 MB
|
|
728
|
+
const androidMultiAbiCppMb = Number((195.0 + effectiveNativePkgCount * 0.55 + nodeModulesMb * 1.6).toFixed(1));
|
|
729
|
+
const androidApkDexMb = Number((54.0 + effectiveNativePkgCount * 0.2 + nodeModulesMb * 0.6).toFixed(1));
|
|
730
|
+
const androidApkResMb = Number((58.0 + assetsMediaMb * 2.8).toFixed(1));
|
|
731
|
+
const androidApkMetaMb = 8.5;
|
|
725
732
|
const androidApkInstallMb = Number((releaseJsMb + androidMultiAbiCppMb + androidApkDexMb + androidApkResMb + androidApkMetaMb).toFixed(1));
|
|
726
|
-
const androidApkDownloadMb = Number(
|
|
733
|
+
const androidApkDownloadMb = Number(androidApkInstallMb.toFixed(1));
|
|
727
734
|
const iosComponents = [
|
|
728
735
|
{
|
|
729
736
|
id: 'ios-c1',
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ConsoleLog } from '../types';
|
|
2
|
+
export declare const setConsoleModuleEnabled: (enabled: boolean) => void;
|
|
3
|
+
export declare const getConsoleModuleEnabled: () => boolean;
|
|
2
4
|
export declare const addLogFromCrash: (error: any, message: string, stack?: string, isFatal?: boolean) => ConsoleLog;
|
|
3
5
|
export declare const subscribeConsoleLogs: (callback: (logs: ConsoleLog[]) => void) => () => void;
|
|
4
6
|
export declare const clearConsoleLogs: () => void;
|
|
@@ -5,6 +5,11 @@ let logs = [];
|
|
|
5
5
|
let listeners = [];
|
|
6
6
|
let counter = 0;
|
|
7
7
|
let isIntercepting = false;
|
|
8
|
+
let isConsoleModuleEnabled = true;
|
|
9
|
+
export const setConsoleModuleEnabled = (enabled) => {
|
|
10
|
+
isConsoleModuleEnabled = enabled;
|
|
11
|
+
};
|
|
12
|
+
export const getConsoleModuleEnabled = () => isConsoleModuleEnabled;
|
|
8
13
|
const MAX_LOGS = 100;
|
|
9
14
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
10
15
|
const formatArgs = (args) => {
|
|
@@ -186,6 +191,8 @@ const notify = () => {
|
|
|
186
191
|
listeners.forEach(cb => cb(snapshot));
|
|
187
192
|
};
|
|
188
193
|
const addLog = (type, args, sourceMethod) => {
|
|
194
|
+
if (!isConsoleModuleEnabled)
|
|
195
|
+
return;
|
|
189
196
|
if (isIntercepting)
|
|
190
197
|
return;
|
|
191
198
|
isIntercepting = true;
|
|
@@ -11,6 +11,8 @@ export interface CrashEventPayload {
|
|
|
11
11
|
}
|
|
12
12
|
export { CrashExportFormat };
|
|
13
13
|
type CrashListener = (payload: CrashEventPayload) => void;
|
|
14
|
+
export declare const setCrashModuleEnabled: (enabled: boolean) => void;
|
|
15
|
+
export declare const getCrashModuleEnabled: () => boolean;
|
|
14
16
|
export declare const setMaxCrashLogsLimit: (max: number) => void;
|
|
15
17
|
export declare const addCrashBreadcrumb: (type: CrashBreadcrumb["type"], message: string, data?: any) => void;
|
|
16
18
|
export declare const recordNavigationBreadcrumb: (fromRoute: string, toRoute: string) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LogBox, NativeModules, TurboModuleRegistry, NativeEventEmitter, Platform, AppState, Dimensions, } from 'react-native';
|
|
2
2
|
import { CrashExportFormat, CrashType } from '../types/enums';
|
|
3
3
|
import { addLogFromCrash } from './consoleLogger';
|
|
4
|
+
import { showNativeFloatingButton, setNativeFloatingButtonBadge, } from '../native/NativeInspector';
|
|
4
5
|
import { t } from '../i18n';
|
|
5
6
|
export { CrashExportFormat };
|
|
6
7
|
let crashListeners = [];
|
|
@@ -11,6 +12,11 @@ let breadcrumbsStore = [];
|
|
|
11
12
|
const MAX_BREADCRUMBS = 50;
|
|
12
13
|
let maxStoredCrashes = 100;
|
|
13
14
|
const appStartTime = Date.now();
|
|
15
|
+
let isCrashModuleEnabled = false;
|
|
16
|
+
export const setCrashModuleEnabled = (enabled) => {
|
|
17
|
+
isCrashModuleEnabled = enabled;
|
|
18
|
+
};
|
|
19
|
+
export const getCrashModuleEnabled = () => isCrashModuleEnabled;
|
|
14
20
|
// ─── BREADCRUMB MANAGERS ───────────────────────────────────────────────────────
|
|
15
21
|
export const setMaxCrashLogsLimit = (max) => {
|
|
16
22
|
maxStoredCrashes = Math.max(10, max);
|
|
@@ -19,6 +25,8 @@ export const setMaxCrashLogsLimit = (max) => {
|
|
|
19
25
|
}
|
|
20
26
|
};
|
|
21
27
|
export const addCrashBreadcrumb = (type, message, data) => {
|
|
28
|
+
if (!isCrashModuleEnabled)
|
|
29
|
+
return;
|
|
22
30
|
try {
|
|
23
31
|
const entry = {
|
|
24
32
|
type,
|
|
@@ -358,6 +366,12 @@ export const handleInterceptedCrash = (errorOrTitle, rawStack, isFatal = false,
|
|
|
358
366
|
logId: log?.id,
|
|
359
367
|
crashRecord,
|
|
360
368
|
});
|
|
369
|
+
// Ensure native floating icon is visible & badged even if React UI is broken
|
|
370
|
+
try {
|
|
371
|
+
showNativeFloatingButton();
|
|
372
|
+
setNativeFloatingButtonBadge(true);
|
|
373
|
+
}
|
|
374
|
+
catch { }
|
|
361
375
|
return crashRecord;
|
|
362
376
|
}
|
|
363
377
|
catch (err) {
|
|
@@ -12,6 +12,8 @@ type NetworkLog = {
|
|
|
12
12
|
requestHeaders?: Record<string, string>;
|
|
13
13
|
responseHeaders?: Record<string, string>;
|
|
14
14
|
};
|
|
15
|
+
export declare const setNetworkModuleEnabled: (enabled: boolean) => void;
|
|
16
|
+
export declare const getNetworkModuleEnabled: () => boolean;
|
|
15
17
|
export declare const subscribeNetworkLogs: (callback: (logs: NetworkLog[]) => void) => () => void;
|
|
16
18
|
export declare const clearNetworkLogs: () => void;
|
|
17
19
|
export declare const getNetworkLogs: () => NetworkLog[];
|
|
@@ -3,6 +3,11 @@ import { setupGlobalCrashHandler } from "./crashHandler";
|
|
|
3
3
|
let logs = [];
|
|
4
4
|
let listeners = [];
|
|
5
5
|
let counter = 0;
|
|
6
|
+
let isNetworkModuleEnabled = true;
|
|
7
|
+
export const setNetworkModuleEnabled = (enabled) => {
|
|
8
|
+
isNetworkModuleEnabled = enabled;
|
|
9
|
+
};
|
|
10
|
+
export const getNetworkModuleEnabled = () => isNetworkModuleEnabled;
|
|
6
11
|
const ALLOWED_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
7
12
|
const IGNORED_URL_PATTERNS = [
|
|
8
13
|
/\/symbolicate(?:[/?#]|$)/i,
|
|
@@ -112,6 +117,8 @@ const notify = () => {
|
|
|
112
117
|
listeners.forEach((cb) => cb(snapshot));
|
|
113
118
|
};
|
|
114
119
|
const addOrUpdateLog = (log) => {
|
|
120
|
+
if (!isNetworkModuleEnabled)
|
|
121
|
+
return;
|
|
115
122
|
const method = log.method?.toUpperCase();
|
|
116
123
|
if (!ALLOWED_METHODS.includes(method))
|
|
117
124
|
return;
|
|
@@ -135,6 +142,8 @@ export const setupNetworkLogger = () => {
|
|
|
135
142
|
const originalFetch = globalThis.fetch;
|
|
136
143
|
if (originalFetch) {
|
|
137
144
|
globalThis.fetch = async (url, options = {}) => {
|
|
145
|
+
if (!isNetworkModuleEnabled)
|
|
146
|
+
return originalFetch(url, options);
|
|
138
147
|
const method = (options?.method || "GET").toUpperCase();
|
|
139
148
|
if (!ALLOWED_METHODS.includes(method))
|
|
140
149
|
return originalFetch(url, options);
|