react-native-inapp-inspector 1.1.16 → 1.1.17
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 +13 -0
- package/dist/commonjs/components/AnimatedEntrance.js +3 -0
- package/dist/commonjs/components/AppHeaderLogo.d.ts +8 -0
- package/dist/commonjs/components/AppHeaderLogo.js +85 -0
- package/dist/commonjs/components/Inspector/BundleTab.d.ts +41 -0
- package/dist/commonjs/components/Inspector/BundleTab.js +2309 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +185 -52
- package/dist/commonjs/components/Inspector/MainScreen.js +86 -7
- package/dist/commonjs/components/Inspector/ReduxDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ReduxDetail.js +576 -0
- package/dist/commonjs/components/Inspector/ReduxTab.js +433 -49
- package/dist/commonjs/components/Inspector/SettingsPanel.js +8 -2
- package/dist/commonjs/components/Inspector/TabBar.js +9 -6
- package/dist/commonjs/components/JsonViewer.js +91 -30
- package/dist/commonjs/components/LogCard.js +3 -4
- package/dist/commonjs/components/NetworkIcons.d.ts +8 -0
- package/dist/commonjs/components/NetworkIcons.js +54 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/consoleLogger.js +37 -9
- package/dist/commonjs/customHooks/reduxLogger.js +4 -2
- package/dist/commonjs/helpers/index.js +6 -2
- package/dist/commonjs/index.js +15 -1
- package/dist/commonjs/styles/AppColors.js +163 -163
- package/dist/commonjs/styles/index.d.ts +14 -0
- package/dist/commonjs/styles/index.js +14 -0
- package/dist/commonjs/types/enums.d.ts +2 -2
- package/dist/commonjs/types/interfaces.d.ts +11 -0
- package/dist/esm/components/AnimatedEntrance.js +4 -1
- package/dist/esm/components/AppHeaderLogo.d.ts +8 -0
- package/dist/esm/components/AppHeaderLogo.js +45 -0
- package/dist/esm/components/Inspector/BundleTab.d.ts +41 -0
- package/dist/esm/components/Inspector/BundleTab.js +2271 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +151 -51
- package/dist/esm/components/Inspector/MainScreen.js +53 -7
- package/dist/esm/components/Inspector/ReduxDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/ReduxDetail.js +538 -0
- package/dist/esm/components/Inspector/ReduxTab.js +402 -51
- package/dist/esm/components/Inspector/SettingsPanel.js +9 -3
- package/dist/esm/components/Inspector/TabBar.js +10 -7
- package/dist/esm/components/JsonViewer.js +92 -31
- package/dist/esm/components/LogCard.js +3 -4
- package/dist/esm/components/NetworkIcons.d.ts +8 -0
- package/dist/esm/components/NetworkIcons.js +47 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/consoleLogger.js +37 -9
- package/dist/esm/customHooks/reduxLogger.js +4 -2
- package/dist/esm/helpers/index.js +6 -2
- package/dist/esm/index.js +15 -1
- package/dist/esm/styles/AppColors.js +163 -163
- package/dist/esm/styles/index.d.ts +14 -0
- package/dist/esm/styles/index.js +14 -0
- package/dist/esm/types/enums.d.ts +2 -2
- package/dist/esm/types/interfaces.d.ts +11 -0
- package/example/App.tsx +5 -1
- package/example/assets/app_icon.png +0 -0
- package/example/ios/Podfile.lock +3 -3
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +18 -9
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/example/package-lock.json +824 -10
- package/example/package.json +6 -2
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ A self-contained, developer-first in-app debugging overlay for React Native. Ins
|
|
|
31
31
|
| ⏸️ **Live Stream Pause / Resume** | Freeze incoming network requests, console logs, and analytics streams on the fly to inspect active traffic without list jumping. |
|
|
32
32
|
| 📊 **Analytics Tracker** | Tracks manual events and auto-patches `@react-native-firebase/analytics` calls (`logEvent`, `logScreenView`, `setUserProperties`, and `setUserId`). |
|
|
33
33
|
| 🔄 **Redux State & Actions** | Connects to Redux / Redux Toolkit. Inspect dispatched actions with deep state diffs, payload breakdown, slice state trees, and `redux-persist` metadata. |
|
|
34
|
+
| 📦 **Bundle Visualizer** | In-app JavaScript bundle size breakdown, Hermes engine bytecode metrics, visual package treemap, and integrated `react-native-bundle-visualizer` CLI. |
|
|
34
35
|
| 🪟 **Rich JSON Viewer** | Explore data in **Pretty**, **Raw**, and **Table** modes with full-text search highlighting and uniform typography. |
|
|
35
36
|
| 🛡️ **Error Boundary** | Built-in `ErrorBoundary` to gracefully catch and inspect React render crashes. |
|
|
36
37
|
|
|
@@ -246,6 +247,18 @@ const App = () => {
|
|
|
246
247
|
|
|
247
248
|
---
|
|
248
249
|
|
|
250
|
+
## 📦 Application Bundle Size & Asset Inspector
|
|
251
|
+
|
|
252
|
+
The inspector includes a dedicated **Bundle** tab (placed right after Redux) with **5 specialized sub-tabs** to inspect and optimize bundle assets:
|
|
253
|
+
|
|
254
|
+
1. 📊 **Overview & Treemap**: Real-time stacked visual ratio bar, total bundle size (`MB`), Hermes Bytecode engine detection, and category weight cards.
|
|
255
|
+
2. 📁 **Files Explorer**: Searchable file-by-file footprint breakdown (`PNG`, `TSX`, `JS`, `TTF`, `JSON`) with lines, resolution, and optimization status.
|
|
256
|
+
3. 📦 **Packages**: Node modules footprint audit (`react-native`, `@react-navigation`, `axios`, `react-native-svg`), version tags, and direct vs. transitive dependency analysis.
|
|
257
|
+
4. 🖼️ **Media Auditor**: Dedicated asset compression analysis for images and custom fonts with potential WebP savings calculators.
|
|
258
|
+
5. ⚡ **Optimizer Checklist**: Actionable best-practice tips for Hermes engine, selective path imports (tree-shaking), font subsetting, and screen lazy-loading.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
249
262
|
## ⚙️ Settings Persistence
|
|
250
263
|
|
|
251
264
|
Inspector preferences (dark mode, active modules, default landing tab) persist across app launches:
|
|
@@ -36,6 +36,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
const react_1 = __importStar(require("react"));
|
|
37
37
|
const react_native_1 = require("react-native");
|
|
38
38
|
const AnimatedEntrance = react_1.default.memo(function AnimatedEntrance({ children, delay = 0, distance = 10, duration = 220, index = 0, style, }) {
|
|
39
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
40
|
+
return <react_native_1.View style={style}>{children}</react_native_1.View>;
|
|
41
|
+
}
|
|
39
42
|
const progress = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
40
43
|
(0, react_1.useEffect)(() => {
|
|
41
44
|
progress.setValue(0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageSourcePropType } from 'react-native';
|
|
3
|
+
interface AppHeaderLogoProps {
|
|
4
|
+
size?: number;
|
|
5
|
+
customIcon?: ImageSourcePropType | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const AppHeaderLogo: React.FC<AppHeaderLogoProps>;
|
|
8
|
+
export default AppHeaderLogo;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.AppHeaderLogo = void 0;
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const react_native_1 = require("react-native");
|
|
42
|
+
const BrandSquareIcon_1 = __importDefault(require("./BrandSquareIcon"));
|
|
43
|
+
const AppColors_1 = require("../styles/AppColors");
|
|
44
|
+
const AppHeaderLogo = ({ size = 46, customIcon, }) => {
|
|
45
|
+
const [loadError, setLoadError] = (0, react_1.useState)(false);
|
|
46
|
+
// 1. If customIcon is explicitly provided, render it directly
|
|
47
|
+
if (customIcon) {
|
|
48
|
+
return (<react_native_1.View style={[logoStyles.container, { width: size, height: size }]}>
|
|
49
|
+
<react_native_1.Image source={customIcon} style={{ width: size - 4, height: size - 4, borderRadius: 10 }} resizeMode="cover"/>
|
|
50
|
+
</react_native_1.View>);
|
|
51
|
+
}
|
|
52
|
+
// 2. Dynamically query installed native app icon (AppIcon on iOS, ic_launcher on Android)
|
|
53
|
+
if (!loadError && react_native_1.Platform.OS !== 'web') {
|
|
54
|
+
const nativeSource = react_native_1.Platform.select({
|
|
55
|
+
ios: { uri: 'AppIcon' },
|
|
56
|
+
android: { uri: 'ic_launcher' },
|
|
57
|
+
default: { uri: 'AppIcon' },
|
|
58
|
+
});
|
|
59
|
+
return (<react_native_1.View style={[logoStyles.container, { width: size, height: size }]}>
|
|
60
|
+
<react_native_1.Image source={nativeSource} style={{ width: size - 4, height: size - 4, borderRadius: 10 }} resizeMode="cover" onError={() => setLoadError(true)}/>
|
|
61
|
+
</react_native_1.View>);
|
|
62
|
+
}
|
|
63
|
+
// 3. Fallback: Inspector's Signature Owl Brand Logo
|
|
64
|
+
return (<react_native_1.View style={[logoStyles.container, { width: size, height: size }]}>
|
|
65
|
+
<BrandSquareIcon_1.default size={size - 4}/>
|
|
66
|
+
</react_native_1.View>);
|
|
67
|
+
};
|
|
68
|
+
exports.AppHeaderLogo = AppHeaderLogo;
|
|
69
|
+
const logoStyles = react_native_1.StyleSheet.create({
|
|
70
|
+
container: {
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
borderRadius: 12,
|
|
74
|
+
backgroundColor: `${AppColors_1.AppColors.white}24`,
|
|
75
|
+
borderWidth: 1.5,
|
|
76
|
+
borderColor: `${AppColors_1.AppColors.white}4D`,
|
|
77
|
+
overflow: 'hidden',
|
|
78
|
+
shadowColor: AppColors_1.AppColors.primaryBlack,
|
|
79
|
+
shadowOffset: { width: 0, height: 2 },
|
|
80
|
+
shadowOpacity: 0.15,
|
|
81
|
+
shadowRadius: 4,
|
|
82
|
+
elevation: 3,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
exports.default = exports.AppHeaderLogo;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type BundleSubTab = 'overview' | 'files' | 'packages' | 'media' | 'optimizer';
|
|
3
|
+
export type FileTypeCategory = 'image' | 'typescript' | 'javascript' | 'font' | 'json';
|
|
4
|
+
export interface BundleFileItem {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
path: string;
|
|
8
|
+
ext: string;
|
|
9
|
+
category: FileTypeCategory;
|
|
10
|
+
sizeKb: number;
|
|
11
|
+
meta: string;
|
|
12
|
+
color: string;
|
|
13
|
+
status?: 'optimal' | 'warning' | 'info';
|
|
14
|
+
advice?: string;
|
|
15
|
+
previewUri?: string;
|
|
16
|
+
isConsumed?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface BundlePackageItem {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
version: string;
|
|
22
|
+
sizeKb: number;
|
|
23
|
+
percentage: number;
|
|
24
|
+
type: 'direct' | 'peer' | 'transitive';
|
|
25
|
+
category: 'core' | 'navigation' | 'network' | 'ui' | 'utils';
|
|
26
|
+
color: string;
|
|
27
|
+
description: string;
|
|
28
|
+
logoUri?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface TreeNode {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
fullPath: string;
|
|
34
|
+
isFolder: boolean;
|
|
35
|
+
fileItem?: BundleFileItem;
|
|
36
|
+
sizeKb: number;
|
|
37
|
+
fileCount: number;
|
|
38
|
+
children: TreeNode[];
|
|
39
|
+
}
|
|
40
|
+
declare const BundleTab: React.MemoExoticComponent<() => React.JSX.Element>;
|
|
41
|
+
export default BundleTab;
|