react-native-inapp-inspector 1.1.32 → 1.1.33
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/dist/commonjs/components/Inspector/BundleTab.js +33 -31
- package/dist/commonjs/components/Inspector/ReduxDetail.js +574 -75
- package/dist/commonjs/components/Inspector/ReduxTab.js +59 -180
- package/dist/commonjs/components/NetworkIcons.d.ts +2 -0
- package/dist/commonjs/components/NetworkIcons.js +14 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +5 -2
- package/dist/commonjs/customHooks/bundleAnalyzer.js +159 -184
- package/dist/commonjs/customHooks/consoleLogger.js +7 -2
- package/dist/commonjs/helpers/index.js +19 -2
- package/dist/esm/components/Inspector/BundleTab.js +34 -32
- package/dist/esm/components/Inspector/ReduxDetail.js +575 -76
- package/dist/esm/components/Inspector/ReduxTab.js +60 -181
- package/dist/esm/components/NetworkIcons.d.ts +2 -0
- package/dist/esm/components/NetworkIcons.js +11 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/bundleAnalyzer.d.ts +5 -2
- package/dist/esm/customHooks/bundleAnalyzer.js +157 -183
- package/dist/esm/customHooks/consoleLogger.js +7 -2
- package/dist/esm/helpers/index.js +19 -2
- package/package.json +1 -1
|
@@ -346,22 +346,25 @@ function buildBundleFileTree(files) {
|
|
|
346
346
|
}
|
|
347
347
|
const downloadBundleFile = async (file, scriptURL) => {
|
|
348
348
|
let content = '';
|
|
349
|
-
// 1. Attempt to fetch real source code from Metro dev server
|
|
349
|
+
// 1. Attempt to fetch real source code from Metro dev server dynamically
|
|
350
350
|
try {
|
|
351
|
-
let devServerOrigin = '
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
let devServerOrigin = '';
|
|
352
|
+
const activeUrl = scriptURL || (0, bundleAnalyzer_1.getHostScriptURL)();
|
|
353
|
+
if (activeUrl && activeUrl.startsWith('http')) {
|
|
354
|
+
const match = activeUrl.match(/^(https?:\/\/[^/]+)/);
|
|
354
355
|
if (match) {
|
|
355
356
|
devServerOrigin = match[1];
|
|
356
357
|
}
|
|
357
358
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
359
|
+
if (devServerOrigin) {
|
|
360
|
+
const cleanPath = file.path.replace(/^\/+/, '');
|
|
361
|
+
const url = `${devServerOrigin}/${cleanPath}`;
|
|
362
|
+
const res = await fetch(url);
|
|
363
|
+
if (res.ok) {
|
|
364
|
+
const text = await res.text();
|
|
365
|
+
if (text && text.length > 0) {
|
|
366
|
+
content = text;
|
|
367
|
+
}
|
|
365
368
|
}
|
|
366
369
|
}
|
|
367
370
|
}
|
|
@@ -523,22 +526,32 @@ const BundleTab = react_1.default.memo(() => {
|
|
|
523
526
|
const [search, setSearch] = (0, react_1.useState)('');
|
|
524
527
|
const [activeCategory, setActiveCategory] = (0, react_1.useState)('ALL');
|
|
525
528
|
// ─── Live Host App Bundle Analysis (fetched from Metro / runtime) ─────────
|
|
526
|
-
const [analysis, setAnalysis] = (0, react_1.useState)(() => (0, bundleAnalyzer_1.getCachedBundleAnalysis)());
|
|
527
|
-
const [isAnalyzing, setIsAnalyzing] = (0, react_1.useState)(
|
|
529
|
+
const [analysis, setAnalysis] = (0, react_1.useState)(() => (0, bundleAnalyzer_1.getCachedBundleAnalysis)() || (0, bundleAnalyzer_1.getInitialBundleAnalysis)());
|
|
530
|
+
const [isAnalyzing, setIsAnalyzing] = (0, react_1.useState)(false);
|
|
528
531
|
const refreshAnalysis = (0, react_1.useCallback)(() => {
|
|
529
532
|
setIsAnalyzing(true);
|
|
530
|
-
(0, bundleAnalyzer_1.analyzeHostAppBundle)(true)
|
|
533
|
+
(0, bundleAnalyzer_1.analyzeHostAppBundle)(true)
|
|
534
|
+
.then(result => {
|
|
531
535
|
setAnalysis(result);
|
|
532
536
|
setIsAnalyzing(false);
|
|
537
|
+
})
|
|
538
|
+
.catch(() => {
|
|
539
|
+
setIsAnalyzing(false);
|
|
533
540
|
});
|
|
534
541
|
}, []);
|
|
535
542
|
(0, react_1.useEffect)(() => {
|
|
536
543
|
let mounted = true;
|
|
537
|
-
(0, bundleAnalyzer_1.analyzeHostAppBundle)()
|
|
544
|
+
(0, bundleAnalyzer_1.analyzeHostAppBundle)()
|
|
545
|
+
.then(result => {
|
|
538
546
|
if (mounted) {
|
|
539
547
|
setAnalysis(result);
|
|
540
548
|
setIsAnalyzing(false);
|
|
541
549
|
}
|
|
550
|
+
})
|
|
551
|
+
.catch(() => {
|
|
552
|
+
if (mounted) {
|
|
553
|
+
setIsAnalyzing(false);
|
|
554
|
+
}
|
|
542
555
|
});
|
|
543
556
|
return () => {
|
|
544
557
|
mounted = false;
|
|
@@ -792,21 +805,10 @@ const BundleTab = react_1.default.memo(() => {
|
|
|
792
805
|
</TouchableScale_1.default>
|
|
793
806
|
</react_native_1.View>
|
|
794
807
|
|
|
795
|
-
{/* ─── Live Bundle Analysis Loading State ─── */}
|
|
796
|
-
{isAnalyzing && (<react_native_1.View style={bundleStyles.analyzingContainer}>
|
|
797
|
-
<react_native_1.ActivityIndicator size="small" color={AppColors_1.AppColors.brandPurple}/>
|
|
798
|
-
<react_native_1.Text style={bundleStyles.analyzingText}>
|
|
799
|
-
{t('bundle.analyzingTitle')}
|
|
800
|
-
</react_native_1.Text>
|
|
801
|
-
<react_native_1.Text style={bundleStyles.analyzingHint}>
|
|
802
|
-
{t('bundle.analyzingHint')}
|
|
803
|
-
</react_native_1.Text>
|
|
804
|
-
</react_native_1.View>)}
|
|
805
|
-
|
|
806
808
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
807
809
|
{/* ── 1. TAB: OVERVIEW & TREEMAP ───────────────────────────────────────── */}
|
|
808
810
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
809
|
-
{activeSubTab === 'overview' &&
|
|
811
|
+
{activeSubTab === 'overview' && (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={bundleStyles.contentContainer} keyboardShouldPersistTaps="handled">
|
|
810
812
|
|
|
811
813
|
{/* Hero Overview Card */}
|
|
812
814
|
<react_native_1.View style={bundleStyles.heroCard}>
|
|
@@ -1129,7 +1131,7 @@ const BundleTab = react_1.default.memo(() => {
|
|
|
1129
1131
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
1130
1132
|
{/* ── 2. TAB: PRODUCTION BUILDS & PLATFORMS ───────────────────────────── */}
|
|
1131
1133
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
1132
|
-
{activeSubTab === 'production' &&
|
|
1134
|
+
{activeSubTab === 'production' && (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={bundleStyles.contentContainer} keyboardShouldPersistTaps="handled">
|
|
1133
1135
|
|
|
1134
1136
|
{/* Platform Segmented Switcher (Horizontally Scrollable) */}
|
|
1135
1137
|
<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={bundleStyles.prodPlatformScroll}>
|
|
@@ -1357,7 +1359,7 @@ const BundleTab = react_1.default.memo(() => {
|
|
|
1357
1359
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
1358
1360
|
{/* ── 2. TAB: FILES BREAKDOWN ─────────────────────────────────────────── */}
|
|
1359
1361
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
1360
|
-
{activeSubTab === 'files' &&
|
|
1362
|
+
{activeSubTab === 'files' && (<react_native_1.View style={{ flex: 1 }}>
|
|
1361
1363
|
{/* Search & Category Filter */}
|
|
1362
1364
|
<react_native_1.View style={bundleStyles.filterContainer}>
|
|
1363
1365
|
<react_native_1.View style={bundleStyles.searchRow}>
|
|
@@ -1551,7 +1553,7 @@ const BundleTab = react_1.default.memo(() => {
|
|
|
1551
1553
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
1552
1554
|
{/* ── 3. TAB: PACKAGES & NODE_MODULES ─────────────────────────────────── */}
|
|
1553
1555
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
1554
|
-
{activeSubTab === 'packages' &&
|
|
1556
|
+
{activeSubTab === 'packages' && (<react_native_1.View style={{ flex: 1 }}>
|
|
1555
1557
|
<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={bundleStyles.contentContainer} keyboardShouldPersistTaps="handled">
|
|
1556
1558
|
|
|
1557
1559
|
<react_native_1.View style={bundleStyles.filterContainer}>
|
|
@@ -1705,7 +1707,7 @@ const BundleTab = react_1.default.memo(() => {
|
|
|
1705
1707
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
1706
1708
|
{/* ── 4. TAB: MEDIA & ASSET AUDITOR ───────────────────────────────────── */}
|
|
1707
1709
|
{/* ══════════════════════════════════════════════════════════════════════ */}
|
|
1708
|
-
{activeSubTab === 'media' &&
|
|
1710
|
+
{activeSubTab === 'media' && (<react_native_1.View style={{ flex: 1 }}>
|
|
1709
1711
|
<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={bundleStyles.contentContainer} keyboardShouldPersistTaps="handled">
|
|
1710
1712
|
|
|
1711
1713
|
<react_native_1.View style={bundleStyles.tipsCard}>
|