react-native-inapp-inspector 1.1.20 → 1.1.21

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 (38) hide show
  1. package/README.md +34 -10
  2. package/dist/commonjs/components/ConsoleLogCard.js +2 -2
  3. package/dist/commonjs/components/DiffViewer.js +2 -2
  4. package/dist/commonjs/components/HeadersSection.js +2 -2
  5. package/dist/commonjs/components/Inspector/BundleTab.js +2 -2
  6. package/dist/commonjs/components/Inspector/ConsoleTab.js +2 -2
  7. package/dist/commonjs/components/Inspector/LogDetail.js +2 -2
  8. package/dist/commonjs/components/Inspector/NetworkDetail.js +2 -2
  9. package/dist/commonjs/components/Inspector/ReduxDetail.js +2 -2
  10. package/dist/commonjs/components/JsonViewer.js +2 -2
  11. package/dist/commonjs/components/LogCard.js +2 -2
  12. package/dist/commonjs/components/MetaAccordion.js +2 -2
  13. package/dist/commonjs/constants/version.d.ts +1 -1
  14. package/dist/commonjs/constants/version.js +1 -1
  15. package/dist/commonjs/i18n/index.d.ts +27 -1
  16. package/dist/commonjs/i18n/index.js +66 -21
  17. package/dist/commonjs/index.d.ts +2 -1
  18. package/dist/commonjs/index.js +8 -4
  19. package/dist/commonjs/types/interfaces.d.ts +1 -0
  20. package/dist/esm/components/ConsoleLogCard.js +1 -1
  21. package/dist/esm/components/DiffViewer.js +1 -1
  22. package/dist/esm/components/HeadersSection.js +1 -1
  23. package/dist/esm/components/Inspector/BundleTab.js +1 -1
  24. package/dist/esm/components/Inspector/ConsoleTab.js +1 -1
  25. package/dist/esm/components/Inspector/LogDetail.js +1 -1
  26. package/dist/esm/components/Inspector/NetworkDetail.js +1 -1
  27. package/dist/esm/components/Inspector/ReduxDetail.js +1 -1
  28. package/dist/esm/components/JsonViewer.js +1 -1
  29. package/dist/esm/components/LogCard.js +1 -1
  30. package/dist/esm/components/MetaAccordion.js +1 -1
  31. package/dist/esm/constants/version.d.ts +1 -1
  32. package/dist/esm/constants/version.js +1 -1
  33. package/dist/esm/i18n/index.d.ts +27 -1
  34. package/dist/esm/i18n/index.js +61 -20
  35. package/dist/esm/index.d.ts +2 -1
  36. package/dist/esm/index.js +6 -2
  37. package/dist/esm/types/interfaces.d.ts +1 -0
  38. package/package.json +35 -13
package/README.md CHANGED
@@ -10,11 +10,16 @@
10
10
 
11
11
  <p align="center">
12
12
  <a href="https://www.npmjs.com/package/react-native-inapp-inspector"><img src="https://img.shields.io/npm/v/react-native-inapp-inspector?color=6366f1&label=npm" alt="npm version" /></a>
13
+ <a href="https://www.npmjs.com/package/react-native-inapp-inspector"><img src="https://img.shields.io/npm/dm/react-native-inapp-inspector?color=3b82f6&label=downloads" alt="npm downloads" /></a>
14
+ <a href="https://bundlephobia.com/package/react-native-inapp-inspector"><img src="https://img.shields.io/bundlephobia/minzip/react-native-inapp-inspector?color=10b981&label=minzipped" alt="bundle size" /></a>
13
15
  <a href="https://github.com/vengatmacuser/react-native-inapp-inspector/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="license" /></a>
14
- <a href="https://github.com/vengatmacuser/react-native-inapp-inspector"><img src="https://img.shields.io/badge/platform-iOS%20%7C%20Android-blue" alt="platform" /></a>
16
+ <a href="https://github.com/vengatmacuser/react-native-inapp-inspector"><img src="https://img.shields.io/badge/platform-iOS%20%7C%20Android%20%7C%20Expo-blue" alt="platform" /></a>
17
+ <a href="https://github.com/vengatmacuser/react-native-inapp-inspector"><img src="https://img.shields.io/badge/TypeScript-Ready-3178c6" alt="TypeScript" /></a>
15
18
  </p>
16
19
 
17
- A self-contained, developer-first in-app debugging overlay for React Native. Inspect network traffic, console logs, stack traces, analytics events, and Redux state directly on your device or simulator with zero external dependencies.
20
+ The **zero-config, all-in-one in-app debugging overlay for React Native & Expo**. Inspect network traffic (fetch/Axios), console logs with Metro symbolicated stack traces, Redux state diffs, Firebase Analytics events, and JavaScript bundle size directly on your device or simulator with zero native setup.
21
+
22
+ > 🚀 **The modern, lightweight alternative to Flipper and Chucker** — works standalone on device, in test builds, and across standalone APKs/IPAs without desktop companion apps, cables, or open debugger ports.
18
23
 
19
24
  <p align="center">
20
25
  <img src="https://raw.githubusercontent.com/vengatmacuser/react-native-inapp-inspector/main/assets/walkthrough.gif" alt="React Native In-App Inspector Walkthrough" width="360" style="border-radius: 20px;" />
@@ -22,6 +27,22 @@ A self-contained, developer-first in-app debugging overlay for React Native. Ins
22
27
 
23
28
  ---
24
29
 
30
+ ## ⚡ Why Choose `react-native-inapp-inspector`?
31
+
32
+ | Capability | **react-native-inapp-inspector** | react-native-network-logger | Flipper / RN Debugger |
33
+ | :--- | :---: | :---: | :---: |
34
+ | **Zero Native Setup / No Cables** | ✅ | ✅ | ❌ (Requires desktop app/cables) |
35
+ | **Network Inspector (Fetch & Axios)** | ✅ | ✅ | ✅ |
36
+ | **cURL & Fetch Snippet Export** | ✅ | ❌ | ⚠️ |
37
+ | **Console Logger + Stack Traces** | ✅ (Metro Symbolicated) | ❌ | ✅ |
38
+ | **Redux State & Action Diffs** | ✅ | ❌ | ⚠️ |
39
+ | **Firebase Analytics Tracker** | ✅ | ❌ | ❌ |
40
+ | **JS Bundle Size & Hermes Analyzer** | ✅ | ❌ | ❌ |
41
+ | **Live Traffic Stream Freeze** | ✅ | ❌ | ❌ |
42
+ | **Expo & Bare React Native** | ✅ | ✅ | ⚠️ |
43
+
44
+ ---
45
+
25
46
  ## ✨ Features
26
47
 
27
48
  | Feature | Description |
@@ -45,25 +66,28 @@ A self-contained, developer-first in-app debugging overlay for React Native. Ins
45
66
 
46
67
  ## 📦 Installation
47
68
 
69
+ ### Bare React Native
48
70
  ```bash
49
71
  npm install --save-dev react-native-inapp-inspector axios
72
+ # or
73
+ yarn add -D react-native-inapp-inspector axios
50
74
  ```
51
75
 
52
76
  ```bash
53
- yarn add -D react-native-inapp-inspector axios
77
+ # iOS Pods
78
+ cd ios && pod install
54
79
  ```
55
80
 
56
- ### Peer & Native Dependencies
81
+ ### Expo Projects
82
+ ```bash
83
+ npx expo install react-native-inapp-inspector react-native-svg react-native-linear-gradient
84
+ ```
57
85
 
58
- The package has React and React Native as peer dependencies. It depends on `@react-navigation/native`, `react-native-linear-gradient`, and `react-native-svg`.
86
+ ### Dependencies
87
+ The package requires React (`>=18.0.0`) and React Native (`>=0.60.0`) as peer dependencies and utilizes `@react-navigation/native`, `react-native-linear-gradient`, and `react-native-svg`.
59
88
 
60
89
  *(Optional)* If you use `@react-native-clipboard/clipboard` in your project, the inspector automatically detects and utilizes native clipboard bridges for seamless emulator-to-host copying.
61
90
 
62
- ```bash
63
- # iOS Pods installation
64
- cd ios && pod install
65
- ```
66
-
67
91
  ---
68
92
 
69
93
  ## 🚀 Basic Setup
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ConsoleLogCard = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
- const react_i18next_1 = require("react-i18next");
8
+ const i18n_1 = require("../i18n");
9
9
  const react_native_1 = require("react-native");
10
10
  const AppColors_1 = require("../styles/AppColors");
11
11
  const AppFonts_1 = require("../styles/AppFonts");
@@ -64,7 +64,7 @@ const getLogMessageWithBadges = (message, searchStr, textStyle, highlightStyle,
64
64
  };
65
65
  exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, searchStr = '', }) {
66
66
  const { setSelectedLog } = (0, InspectorContext_1.useInspector)();
67
- const { t } = (0, react_i18next_1.useTranslation)();
67
+ const { t } = (0, i18n_1.useTranslation)();
68
68
  const jsonContent = (0, helpers_1.getJsonContent)(item.message);
69
69
  const isAnalyticsError = item.message
70
70
  .toLowerCase()
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- const react_i18next_1 = require("react-i18next");
39
+ const i18n_1 = require("../i18n");
40
40
  const react_1 = __importStar(require("react"));
41
41
  const react_native_1 = require("react-native");
42
42
  // Helpers
@@ -45,7 +45,7 @@ const helpers_1 = require("../helpers");
45
45
  const AppColors_1 = require("../styles/AppColors");
46
46
  const styles_1 = __importDefault(require("../styles"));
47
47
  const DiffViewer = react_1.default.memo(({ oldData, newData, forceOpen, }) => {
48
- const { t } = (0, react_i18next_1.useTranslation)();
48
+ const { t } = (0, i18n_1.useTranslation)();
49
49
  const diffs = (0, react_1.useMemo)(() => (0, helpers_1.getDiff)(oldData, newData), [oldData, newData]);
50
50
  if (forceOpen === false) {
51
51
  return (<react_native_1.View style={styles_1.default.codeBlock}>
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const react_1 = __importStar(require("react"));
40
- const react_i18next_1 = require("react-i18next");
40
+ const i18n_1 = require("../i18n");
41
41
  const react_native_1 = require("react-native");
42
42
  // Components
43
43
  const CopyButton_1 = __importDefault(require("./CopyButton"));
@@ -97,7 +97,7 @@ const HeaderRow = react_1.default.memo(function HeaderRow({ headerKey, value, is
97
97
  </react_native_1.Animated.View>);
98
98
  });
99
99
  const HeadersSection = ({ title, headers, search, resetKey, }) => {
100
- const { t } = (0, react_i18next_1.useTranslation)();
100
+ const { t } = (0, i18n_1.useTranslation)();
101
101
  const { toggleOpen, forceOpen, chevronStyle, bodyStyle } = (0, useAccordion_1.default)(false, 2400, 300);
102
102
  (0, react_1.useEffect)(() => {
103
103
  forceOpen(false);
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const react_1 = __importStar(require("react"));
40
40
  const react_native_1 = require("react-native");
41
- const react_i18next_1 = require("react-i18next");
41
+ const i18n_1 = require("../../i18n");
42
42
  const TouchableScale_1 = __importDefault(require("../TouchableScale"));
43
43
  const CopyButton_1 = __importDefault(require("../CopyButton"));
44
44
  const HighlightText_1 = __importDefault(require("../HighlightText"));
@@ -776,7 +776,7 @@ const CATEGORY_COLORS = {
776
776
  json: { label: 'JSON / Data', color: '#10B981', bg: '#D1FAE5' },
777
777
  };
778
778
  const BundleTab = react_1.default.memo(() => {
779
- const { t } = (0, react_i18next_1.useTranslation)();
779
+ const { t } = (0, i18n_1.useTranslation)();
780
780
  const [activeSubTab, setActiveSubTab] = (0, react_1.useState)('overview');
781
781
  const [search, setSearch] = (0, react_1.useState)('');
782
782
  const [activeCategory, setActiveCategory] = (0, react_1.useState)('ALL');
@@ -39,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const react_1 = __importStar(require("react"));
40
40
  const react_native_1 = require("react-native");
41
41
  const InspectorContext_1 = require("./InspectorContext");
42
- const react_i18next_1 = require("react-i18next");
42
+ const i18n_1 = require("../../i18n");
43
43
  const TouchableScale_1 = __importDefault(require("../TouchableScale"));
44
44
  const AnimatedEntrance_1 = __importDefault(require("../AnimatedEntrance"));
45
45
  const ConsoleLogCard_1 = require("../ConsoleLogCard");
@@ -50,7 +50,7 @@ const AppColors_1 = require("../../styles/AppColors");
50
50
  const AppFonts_1 = require("../../styles/AppFonts");
51
51
  const NetworkIcons_1 = require("../NetworkIcons");
52
52
  const ConsoleTab = react_1.default.memo(() => {
53
- const { t } = (0, react_i18next_1.useTranslation)();
53
+ const { t } = (0, i18n_1.useTranslation)();
54
54
  const { logSearch, setLogSearch, logSortOrder, setLogSortOrder, handleDelete, logFilters, setLogFilters, logCounts, filteredConsoleLogs, visibleConsoleLogs, isConsolePaused, setIsConsolePaused, } = (0, InspectorContext_1.useInspector)();
55
55
  const renderItem = (0, react_1.useCallback)(({ item, index }) => (<AnimatedEntrance_1.default index={index} distance={8}>
56
56
  <ConsoleLogCard_1.ConsoleLogCard item={item} searchStr={logSearch}/>
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const react_1 = __importStar(require("react"));
40
- const react_i18next_1 = require("react-i18next");
40
+ const i18n_1 = require("../../i18n");
41
41
  const react_native_1 = require("react-native");
42
42
  const InspectorContext_1 = require("./InspectorContext");
43
43
  const HighlightText_1 = __importDefault(require("../HighlightText"));
@@ -65,7 +65,7 @@ const getRelativeTime = (timestamp) => {
65
65
  return `${days}d ago`;
66
66
  };
67
67
  const LogDetail = react_1.default.memo(() => {
68
- const { t } = (0, react_i18next_1.useTranslation)();
68
+ const { t } = (0, i18n_1.useTranslation)();
69
69
  const { selectedLog } = (0, InspectorContext_1.useInspector)();
70
70
  const [activeTab, setActiveTab] = (0, react_1.useState)('output');
71
71
  const [detailSearch, setDetailSearch] = (0, react_1.useState)('');
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const react_1 = __importDefault(require("react"));
40
- const react_i18next_1 = require("react-i18next");
40
+ const i18n_1 = require("../../i18n");
41
41
  const react_native_1 = require("react-native");
42
42
  const react_native_svg_1 = __importStar(require("react-native-svg"));
43
43
  const InspectorContext_1 = require("./InspectorContext");
@@ -57,7 +57,7 @@ const constants_1 = require("../../constants");
57
57
  const helpers_1 = require("../../helpers");
58
58
  const NetworkIcons_1 = require("../NetworkIcons");
59
59
  const NetworkDetail = react_1.default.memo(() => {
60
- const { t } = (0, react_i18next_1.useTranslation)();
60
+ const { t } = (0, i18n_1.useTranslation)();
61
61
  const { selected, detailDisplayUrl, apiDetailActiveTab, setApiDetailActiveTab, detailSearch, setDetailSearch, reqExpanded, setReqExpanded, resExpanded, setResExpanded, showReqDiff, setShowReqDiff, showResDiff, setShowResDiff, prevRequestData, prevResponseData, logRouteMapRef, } = (0, InspectorContext_1.useInspector)();
62
62
  if (!selected)
63
63
  return null;
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const react_1 = __importStar(require("react"));
40
40
  const react_native_1 = require("react-native");
41
- const react_i18next_1 = require("react-i18next");
41
+ const i18n_1 = require("../../i18n");
42
42
  const InspectorContext_1 = require("./InspectorContext");
43
43
  const SegmentedTabs_1 = __importDefault(require("../SegmentedTabs"));
44
44
  const JsonViewer_1 = __importDefault(require("../JsonViewer"));
@@ -54,7 +54,7 @@ const AppColors_1 = require("../../styles/AppColors");
54
54
  const AppFonts_1 = require("../../styles/AppFonts");
55
55
  const NetworkIcons_1 = require("../NetworkIcons");
56
56
  const ReduxDetail = react_1.default.memo(() => {
57
- const { t } = (0, react_i18next_1.useTranslation)();
57
+ const { t } = (0, i18n_1.useTranslation)();
58
58
  const { reduxState, reduxLastActionMap, selectedReduxSlice, selectedReduxAction, setSelectedReduxSlice, setSelectedReduxAction, } = (0, InspectorContext_1.useInspector)();
59
59
  // Search filter within details
60
60
  const [detailSearch, setDetailSearch] = (0, react_1.useState)('');
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const react_1 = __importStar(require("react"));
40
40
  const react_native_1 = require("react-native");
41
- const react_i18next_1 = require("react-i18next");
41
+ const i18n_1 = require("../i18n");
42
42
  // Components
43
43
  const TreeNode_1 = __importDefault(require("./TreeNode"));
44
44
  const SegmentedTabs_1 = __importDefault(require("./SegmentedTabs"));
@@ -94,7 +94,7 @@ const JsonTableRow = react_1.default.memo(({ itemKey, val, search, }) => {
94
94
  });
95
95
  // ── JsonViewer Component ─────────────────────────────────────────────────────
96
96
  const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
97
- const { t } = (0, react_i18next_1.useTranslation)();
97
+ const { t } = (0, i18n_1.useTranslation)();
98
98
  const [internalMode, setInternalMode] = (0, react_1.useState)('pretty');
99
99
  const mode = externalMode ?? internalMode;
100
100
  const setMode = (newMode) => {
@@ -46,9 +46,9 @@ const NetworkIcons_1 = require("./NetworkIcons");
46
46
  const styles_1 = __importDefault(require("../styles"));
47
47
  const HighlightText_1 = __importDefault(require("./HighlightText"));
48
48
  const TouchableScale_1 = __importDefault(require("./TouchableScale"));
49
- const react_i18next_1 = require("react-i18next");
49
+ const i18n_1 = require("../i18n");
50
50
  const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineMinStart, timelineTotalRange, isNew, isSelected, onToggleSelect, searchStr, }) {
51
- const { t } = (0, react_i18next_1.useTranslation)();
51
+ const { t } = (0, i18n_1.useTranslation)();
52
52
  const methodColor = constants_1.METHOD_COLORS[item.method] ?? constants_1.METHOD_COLORS.ALL;
53
53
  const isFailed = item.status === 0 || (item.status != null && item.status >= 400);
54
54
  const isLoading = item.status == null;
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const react_1 = __importStar(require("react"));
40
- const react_i18next_1 = require("react-i18next");
40
+ const i18n_1 = require("../i18n");
41
41
  const react_native_1 = require("react-native");
42
42
  // Constants
43
43
  const constants_1 = require("../constants");
@@ -54,7 +54,7 @@ const AppColors_1 = require("../styles/AppColors");
54
54
  const AppFonts_1 = require("../styles/AppFonts");
55
55
  const styles_1 = __importDefault(require("../styles"));
56
56
  const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, method, contentType, url, }) => {
57
- const { t } = (0, react_i18next_1.useTranslation)();
57
+ const { t } = (0, i18n_1.useTranslation)();
58
58
  const [urlExpanded, setUrlExpanded] = (0, react_1.useState)(false);
59
59
  const { toggleOpen, chevronStyle, bodyStyle } = (0, useAccordion_1.default)(true, 800, 390);
60
60
  const isFailed = status === 0 || status == null;
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "1.1.20";
1
+ export declare const LIB_VERSION = "1.1.21";
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
4
  // AUTO-GENERATED FILE — do not edit by hand.
5
5
  // Regenerated from package.json on every build by scripts/gen-version.js.
6
- exports.LIB_VERSION = '1.1.20';
6
+ exports.LIB_VERSION = '1.1.21';
@@ -1,2 +1,28 @@
1
- declare const i18n: import("i18next").i18n;
1
+ import React from 'react';
2
+ type TranslationParams = Record<string, any>;
3
+ /**
4
+ * Standalone zero-dependency translation function
5
+ */
6
+ export declare function t(key: string, optionsOrFallback?: TranslationParams | string): string;
7
+ export declare const i18n: {
8
+ t: typeof t;
9
+ language: string;
10
+ };
11
+ /**
12
+ * React hook compatible with react-i18next useTranslation()
13
+ */
14
+ export declare function useTranslation(): {
15
+ t: typeof t;
16
+ i18n: {
17
+ t: typeof t;
18
+ language: string;
19
+ };
20
+ };
21
+ /**
22
+ * Backward-compatible I18nextProvider component
23
+ */
24
+ export declare const I18nextProvider: ({ children }: {
25
+ children?: React.ReactNode;
26
+ i18n?: any;
27
+ }) => any;
2
28
  export default i18n;
@@ -3,25 +3,70 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const i18next_1 = __importDefault(require("i18next"));
7
- const react_i18next_1 = require("react-i18next");
6
+ exports.I18nextProvider = exports.i18n = void 0;
7
+ exports.t = t;
8
+ exports.useTranslation = useTranslation;
9
+ const react_1 = __importDefault(require("react"));
8
10
  const en_json_1 = __importDefault(require("./locales/en.json"));
9
- // Dedicated instance so the inspector never collides with the host app's own
10
- // i18next setup (or with i18next instances created by other libraries).
11
- const i18n = i18next_1.default.createInstance();
12
- i18n.use(react_i18next_1.initReactI18next).init({
13
- lng: 'en',
14
- fallbackLng: 'en',
15
- resources: {
16
- en: {
17
- translation: en_json_1.default,
18
- },
19
- },
20
- interpolation: {
21
- escapeValue: false,
22
- },
23
- react: {
24
- useSuspense: false,
25
- },
26
- });
27
- exports.default = i18n;
11
+ /**
12
+ * Lightweight nested lookup for translation keys (e.g. "network.headers")
13
+ */
14
+ function lookupKey(obj, path) {
15
+ if (!obj || !path)
16
+ return undefined;
17
+ const parts = path.split('.');
18
+ let current = obj;
19
+ for (let i = 0; i < parts.length; i++) {
20
+ if (current == null)
21
+ return undefined;
22
+ current = current[parts[i]];
23
+ }
24
+ return current;
25
+ }
26
+ /**
27
+ * Interpolates {{key}} placeholders in string templates
28
+ */
29
+ function interpolate(template, params) {
30
+ if (!params || typeof template !== 'string')
31
+ return template;
32
+ return template.replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g, (_, key) => {
33
+ return params[key] !== undefined ? String(params[key]) : `{{${key}}}`;
34
+ });
35
+ }
36
+ /**
37
+ * Standalone zero-dependency translation function
38
+ */
39
+ function t(key, optionsOrFallback) {
40
+ const raw = lookupKey(en_json_1.default, key);
41
+ if (typeof raw === 'string') {
42
+ if (typeof optionsOrFallback === 'object' && optionsOrFallback !== null) {
43
+ return interpolate(raw, optionsOrFallback);
44
+ }
45
+ return raw;
46
+ }
47
+ if (typeof optionsOrFallback === 'string') {
48
+ return optionsOrFallback;
49
+ }
50
+ return key;
51
+ }
52
+ exports.i18n = {
53
+ t,
54
+ language: 'en',
55
+ };
56
+ /**
57
+ * React hook compatible with react-i18next useTranslation()
58
+ */
59
+ function useTranslation() {
60
+ return {
61
+ t,
62
+ i18n: exports.i18n,
63
+ };
64
+ }
65
+ /**
66
+ * Backward-compatible I18nextProvider component
67
+ */
68
+ const I18nextProvider = ({ children }) => {
69
+ return react_1.default.createElement(react_1.default.Fragment, null, children);
70
+ };
71
+ exports.I18nextProvider = I18nextProvider;
72
+ exports.default = exports.i18n;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- declare const NetworkInspectorWrapper: (props: any) => React.JSX.Element;
2
+ import { NetworkInspectorProps } from './types';
3
+ declare const NetworkInspectorWrapper: (props: NetworkInspectorProps) => React.JSX.Element;
3
4
  export default NetworkInspectorWrapper;
4
5
  export { setupNetworkLogger, clearNetworkLogs, subscribeNetworkLogs, addAxiosInterceptors, } from './customHooks/networkLogger';
5
6
  export { setupConsoleLogger, clearConsoleLogs, subscribeConsoleLogs, } from './customHooks/consoleLogger';
@@ -41,8 +41,7 @@ const react_1 = __importStar(require("react"));
41
41
  const react_native_1 = require("react-native");
42
42
  const native_1 = require("@react-navigation/native");
43
43
  // i18n
44
- const react_i18next_1 = require("react-i18next");
45
- const i18n_1 = __importDefault(require("./i18n"));
44
+ const i18n_1 = require("./i18n");
46
45
  // Components
47
46
  const ErrorBoundary_1 = __importDefault(require("./components/ErrorBoundary"));
48
47
  const MainScreen_1 = __importDefault(require("./components/Inspector/MainScreen"));
@@ -1280,11 +1279,16 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
1280
1279
  </InspectorContext_1.InspectorContext.Provider>);
1281
1280
  };
1282
1281
  const NetworkInspectorWrapper = (props) => {
1283
- return (<react_i18next_1.I18nextProvider i18n={i18n_1.default}>
1282
+ // If running in production release build and not explicitly force-enabled (e.g. for QA builds),
1283
+ // return null immediately for 0-overhead production stubbing.
1284
+ if (typeof __DEV__ !== 'undefined' && !__DEV__ && !props?.forceEnable) {
1285
+ return null;
1286
+ }
1287
+ return (<i18n_1.I18nextProvider i18n={i18n_1.i18n}>
1284
1288
  <ErrorBoundary_1.default fallbackType="inline">
1285
1289
  <NetworkInspector {...props}/>
1286
1290
  </ErrorBoundary_1.default>
1287
- </react_i18next_1.I18nextProvider>);
1291
+ </i18n_1.I18nextProvider>);
1288
1292
  };
1289
1293
  exports.default = NetworkInspectorWrapper;
1290
1294
  // Re-export public APIs
@@ -85,6 +85,7 @@ export interface PersistedSettings {
85
85
  export interface NetworkInspectorProps {
86
86
  enabled?: boolean;
87
87
  isEnabled?: boolean;
88
+ forceEnable?: boolean;
88
89
  storage?: InspectorStorage;
89
90
  navigationRef?: any;
90
91
  appIcon?: any;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useTranslation } from 'react-i18next';
2
+ import { useTranslation } from '../i18n';
3
3
  import { Pressable, StyleSheet, Text, View, } from 'react-native';
4
4
  import { AppColors } from '../styles/AppColors';
5
5
  import { AppFonts } from '../styles/AppFonts';
@@ -1,4 +1,4 @@
1
- import { useTranslation } from 'react-i18next';
1
+ import { useTranslation } from '../i18n';
2
2
  import React, { useMemo } from 'react';
3
3
  import { View, Text, ScrollView } from 'react-native';
4
4
  // Helpers
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useMemo, useRef, useState } from 'react';
2
- import { useTranslation } from 'react-i18next';
2
+ import { useTranslation } from '../i18n';
3
3
  import { View, Pressable, Text, Animated } from 'react-native';
4
4
  // Components
5
5
  import CopyButton from './CopyButton';
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useMemo, useCallback } from 'react';
2
2
  import { Image, Linking, Pressable, ScrollView, StyleSheet, Text, TextInput, View, } from 'react-native';
3
- import { useTranslation } from 'react-i18next';
3
+ import { useTranslation } from '../../i18n';
4
4
  import TouchableScale from '../TouchableScale';
5
5
  import CopyButton from '../CopyButton';
6
6
  import HighlightText from '../HighlightText';
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback, useMemo } from 'react';
2
2
  import { FlatList, Pressable, ScrollView, Text, TextInput, View, } from 'react-native';
3
3
  import { useInspector } from './InspectorContext';
4
- import { useTranslation } from 'react-i18next';
4
+ import { useTranslation } from '../../i18n';
5
5
  import TouchableScale from '../TouchableScale';
6
6
  import AnimatedEntrance from '../AnimatedEntrance';
7
7
  import { ConsoleLogCard } from '../ConsoleLogCard';
@@ -1,5 +1,5 @@
1
1
  import React, { useMemo, useState } from 'react';
2
- import { useTranslation } from 'react-i18next';
2
+ import { useTranslation } from '../../i18n';
3
3
  import { Pressable, ScrollView, StyleSheet, Text, TextInput, View, } from 'react-native';
4
4
  import { useInspector } from './InspectorContext';
5
5
  import HighlightText from '../HighlightText';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useTranslation } from 'react-i18next';
2
+ import { useTranslation } from '../../i18n';
3
3
  import { Image, Linking, Pressable, ScrollView, Text, TextInput, View, } from 'react-native';
4
4
  import Svg, { Circle } from 'react-native-svg';
5
5
  import { animateNextLayout, useInspector } from './InspectorContext';
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useMemo, useEffect } from 'react';
2
2
  import { Alert, Platform, Pressable, ScrollView, StyleSheet, Text, TextInput, ToastAndroid, TouchableOpacity, View, } from 'react-native';
3
- import { useTranslation } from 'react-i18next';
3
+ import { useTranslation } from '../../i18n';
4
4
  import { useInspector } from './InspectorContext';
5
5
  import SegmentedTabs from '../SegmentedTabs';
6
6
  import JsonViewer from '../JsonViewer';
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { ScrollView, View, Text, StyleSheet, TouchableOpacity } from 'react-native';
3
- import { useTranslation } from 'react-i18next';
3
+ import { useTranslation } from '../i18n';
4
4
  // Components
5
5
  import TreeNode from './TreeNode';
6
6
  import SegmentedTabs from './SegmentedTabs';
@@ -8,7 +8,7 @@ import { CalendarIcon, ClockIcon, SizeIcon } from './NetworkIcons';
8
8
  import styles from '../styles';
9
9
  import HighlightText from './HighlightText';
10
10
  import TouchableScale from './TouchableScale';
11
- import { useTranslation } from 'react-i18next';
11
+ import { useTranslation } from '../i18n';
12
12
  const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, timelineTotalRange, isNew, isSelected, onToggleSelect, searchStr, }) {
13
13
  const { t } = useTranslation();
14
14
  const methodColor = METHOD_COLORS[item.method] ?? METHOD_COLORS.ALL;
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { useTranslation } from 'react-i18next';
2
+ import { useTranslation } from '../i18n';
3
3
  import { View, Pressable, Text, Animated } from 'react-native';
4
4
  // Constants
5
5
  import { DURATION_FAST_MS, DURATION_SLOW_MS } from '../constants';
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "1.1.20";
1
+ export declare const LIB_VERSION = "1.1.21";
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED FILE — do not edit by hand.
2
2
  // Regenerated from package.json on every build by scripts/gen-version.js.
3
- export const LIB_VERSION = '1.1.20';
3
+ export const LIB_VERSION = '1.1.21';
@@ -1,2 +1,28 @@
1
- declare const i18n: import("i18next").i18n;
1
+ import React from 'react';
2
+ type TranslationParams = Record<string, any>;
3
+ /**
4
+ * Standalone zero-dependency translation function
5
+ */
6
+ export declare function t(key: string, optionsOrFallback?: TranslationParams | string): string;
7
+ export declare const i18n: {
8
+ t: typeof t;
9
+ language: string;
10
+ };
11
+ /**
12
+ * React hook compatible with react-i18next useTranslation()
13
+ */
14
+ export declare function useTranslation(): {
15
+ t: typeof t;
16
+ i18n: {
17
+ t: typeof t;
18
+ language: string;
19
+ };
20
+ };
21
+ /**
22
+ * Backward-compatible I18nextProvider component
23
+ */
24
+ export declare const I18nextProvider: ({ children }: {
25
+ children?: React.ReactNode;
26
+ i18n?: any;
27
+ }) => any;
2
28
  export default i18n;
@@ -1,22 +1,63 @@
1
- import i18next from 'i18next';
2
- import { initReactI18next } from 'react-i18next';
1
+ import React from 'react';
3
2
  import en from './locales/en.json';
4
- // Dedicated instance so the inspector never collides with the host app's own
5
- // i18next setup (or with i18next instances created by other libraries).
6
- const i18n = i18next.createInstance();
7
- i18n.use(initReactI18next).init({
8
- lng: 'en',
9
- fallbackLng: 'en',
10
- resources: {
11
- en: {
12
- translation: en,
13
- },
14
- },
15
- interpolation: {
16
- escapeValue: false,
17
- },
18
- react: {
19
- useSuspense: false,
20
- },
21
- });
3
+ /**
4
+ * Lightweight nested lookup for translation keys (e.g. "network.headers")
5
+ */
6
+ function lookupKey(obj, path) {
7
+ if (!obj || !path)
8
+ return undefined;
9
+ const parts = path.split('.');
10
+ let current = obj;
11
+ for (let i = 0; i < parts.length; i++) {
12
+ if (current == null)
13
+ return undefined;
14
+ current = current[parts[i]];
15
+ }
16
+ return current;
17
+ }
18
+ /**
19
+ * Interpolates {{key}} placeholders in string templates
20
+ */
21
+ function interpolate(template, params) {
22
+ if (!params || typeof template !== 'string')
23
+ return template;
24
+ return template.replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g, (_, key) => {
25
+ return params[key] !== undefined ? String(params[key]) : `{{${key}}}`;
26
+ });
27
+ }
28
+ /**
29
+ * Standalone zero-dependency translation function
30
+ */
31
+ export function t(key, optionsOrFallback) {
32
+ const raw = lookupKey(en, key);
33
+ if (typeof raw === 'string') {
34
+ if (typeof optionsOrFallback === 'object' && optionsOrFallback !== null) {
35
+ return interpolate(raw, optionsOrFallback);
36
+ }
37
+ return raw;
38
+ }
39
+ if (typeof optionsOrFallback === 'string') {
40
+ return optionsOrFallback;
41
+ }
42
+ return key;
43
+ }
44
+ export const i18n = {
45
+ t,
46
+ language: 'en',
47
+ };
48
+ /**
49
+ * React hook compatible with react-i18next useTranslation()
50
+ */
51
+ export function useTranslation() {
52
+ return {
53
+ t,
54
+ i18n,
55
+ };
56
+ }
57
+ /**
58
+ * Backward-compatible I18nextProvider component
59
+ */
60
+ export const I18nextProvider = ({ children }) => {
61
+ return React.createElement(React.Fragment, null, children);
62
+ };
22
63
  export default i18n;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- declare const NetworkInspectorWrapper: (props: any) => React.JSX.Element;
2
+ import { NetworkInspectorProps } from './types';
3
+ declare const NetworkInspectorWrapper: (props: NetworkInspectorProps) => React.JSX.Element;
3
4
  export default NetworkInspectorWrapper;
4
5
  export { setupNetworkLogger, clearNetworkLogs, subscribeNetworkLogs, addAxiosInterceptors, } from './customHooks/networkLogger';
5
6
  export { setupConsoleLogger, clearConsoleLogs, subscribeConsoleLogs, } from './customHooks/consoleLogger';
package/dist/esm/index.js CHANGED
@@ -2,8 +2,7 @@ import React, { useEffect, useMemo, useRef, useState, useCallback } from 'react'
2
2
  import { Alert, Animated, PanResponder, Platform, UIManager, LogBox, InteractionManager, } from 'react-native';
3
3
  import { NavigationContext } from '@react-navigation/native';
4
4
  // i18n
5
- import { I18nextProvider } from 'react-i18next';
6
- import i18n from './i18n';
5
+ import { I18nextProvider, i18n } from './i18n';
7
6
  // Components
8
7
  import ErrorBoundary from './components/ErrorBoundary';
9
8
  import MainScreen from './components/Inspector/MainScreen';
@@ -1241,6 +1240,11 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
1241
1240
  </InspectorContext.Provider>);
1242
1241
  };
1243
1242
  const NetworkInspectorWrapper = (props) => {
1243
+ // If running in production release build and not explicitly force-enabled (e.g. for QA builds),
1244
+ // return null immediately for 0-overhead production stubbing.
1245
+ if (typeof __DEV__ !== 'undefined' && !__DEV__ && !props?.forceEnable) {
1246
+ return null;
1247
+ }
1244
1248
  return (<I18nextProvider i18n={i18n}>
1245
1249
  <ErrorBoundary fallbackType="inline">
1246
1250
  <NetworkInspector {...props}/>
@@ -85,6 +85,7 @@ export interface PersistedSettings {
85
85
  export interface NetworkInspectorProps {
86
86
  enabled?: boolean;
87
87
  isEnabled?: boolean;
88
+ forceEnable?: boolean;
88
89
  storage?: InspectorStorage;
89
90
  navigationRef?: any;
90
91
  appIcon?: any;
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "react-native-inapp-inspector",
3
- "version": "1.1.20",
4
- "description": "A self-contained network, console, analytics, and webview inspector for React Native applications.",
3
+ "version": "1.1.21",
4
+ "description": "The zero-config, all-in-one in-app debugger for React Native & Expo. Inspect Network (fetch/axios), Console logs, Stack Traces, Redux State, Firebase Analytics, and JS Bundle size directly on device.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vengatmacuser/react-native-inapp-inspector.git"
8
8
  },
9
9
  "bugs": {
10
- "url": "https://github.com/vengatmacuser/react-native-inapp-inspector/issues"
10
+ "url": "https://github.com/vengatmacuser/react-native-inapp-inspector/issues",
11
+ "email": "vengatmacuser@gmail.com"
11
12
  },
12
13
  "homepage": "https://github.com/vengatmacuser/react-native-inapp-inspector#readme",
13
14
  "main": "dist/commonjs/index.js",
@@ -35,11 +36,32 @@
35
36
  },
36
37
  "keywords": [
37
38
  "react-native",
39
+ "react-native-inapp-inspector",
38
40
  "network-logger",
39
41
  "network-inspector",
42
+ "react-native-network-logger",
43
+ "flipper-alternative",
44
+ "chucker",
45
+ "chucker-react-native",
46
+ "in-app-inspector",
47
+ "in-app-debugger",
48
+ "react-native-debugger",
49
+ "react-native-devtools",
50
+ "devtools",
51
+ "expo",
52
+ "expo-network-logger",
53
+ "http-logger",
54
+ "api-inspector",
55
+ "console-logger",
56
+ "redux-inspector",
57
+ "redux-logger",
40
58
  "analytics-logger",
41
- "webview-logger",
42
- "debug-tool"
59
+ "bundle-visualizer",
60
+ "hermes",
61
+ "zero-config",
62
+ "debug-tool",
63
+ "ios",
64
+ "android"
43
65
  ],
44
66
  "author": "Vengateswaran Balakrishnan",
45
67
  "contributors": [
@@ -53,16 +75,16 @@
53
75
  "type": "github",
54
76
  "url": "https://github.com/sponsors/vengatmacuser"
55
77
  },
56
- "dependencies": {
57
- "@react-navigation/native": "^6.1.9",
58
- "i18next": "^26.3.6",
59
- "react-i18next": "^17.0.11",
60
- "react-native-linear-gradient": "^2.8.3",
61
- "react-native-svg": "^15.14.0"
62
- },
63
78
  "peerDependencies": {
64
79
  "react": ">=18.0.0",
65
- "react-native": ">=0.60.0"
80
+ "react-native": ">=0.60.0",
81
+ "react-native-linear-gradient": ">=2.0.0",
82
+ "react-native-svg": ">=12.0.0"
83
+ },
84
+ "peerDependenciesMeta": {
85
+ "@react-navigation/native": {
86
+ "optional": true
87
+ }
66
88
  },
67
89
  "devDependencies": {
68
90
  "@react-navigation/native": "^6.1.9",