react-native-inapp-inspector 1.1.15 β 1.1.16
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 +137 -130
- package/dist/commonjs/components/CopyButton.d.ts +1 -1
- package/dist/commonjs/components/CopyButton.js +4 -4
- package/dist/commonjs/components/EndOfListFooter.js +2 -3
- package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +1 -1
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +7 -8
- package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +1 -1
- package/dist/commonjs/components/Inspector/ConsoleTab.js +9 -9
- package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +1 -1
- package/dist/commonjs/components/Inspector/InspectorHeader.js +2 -2
- package/dist/commonjs/components/Inspector/LogDetail.d.ts +1 -1
- package/dist/commonjs/components/Inspector/LogDetail.js +2 -2
- package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +1 -1
- package/dist/commonjs/components/Inspector/NetworkDetail.js +2 -2
- package/dist/commonjs/components/Inspector/NetworkTab.d.ts +1 -1
- package/dist/commonjs/components/Inspector/NetworkTab.js +10 -9
- package/dist/commonjs/components/Inspector/ReduxTab.d.ts +1 -1
- package/dist/commonjs/components/Inspector/ReduxTab.js +2 -2
- package/dist/commonjs/components/Inspector/TabBar.d.ts +1 -1
- package/dist/commonjs/components/Inspector/TabBar.js +2 -2
- package/dist/commonjs/components/JsonViewer.d.ts +2 -2
- package/dist/commonjs/components/JsonViewer.js +2 -2
- package/dist/commonjs/components/ReduxTreeView.d.ts +2 -2
- package/dist/commonjs/components/ReduxTreeView.js +2 -3
- package/dist/commonjs/components/SegmentedTabs.d.ts +1 -1
- package/dist/commonjs/components/SegmentedTabs.js +2 -2
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/esm/components/CopyButton.d.ts +1 -1
- package/dist/esm/components/CopyButton.js +5 -5
- package/dist/esm/components/EndOfListFooter.js +2 -2
- package/dist/esm/components/Inspector/AnalyticsTab.d.ts +1 -1
- package/dist/esm/components/Inspector/AnalyticsTab.js +7 -8
- package/dist/esm/components/Inspector/ConsoleTab.d.ts +1 -1
- package/dist/esm/components/Inspector/ConsoleTab.js +9 -9
- package/dist/esm/components/Inspector/InspectorHeader.d.ts +1 -1
- package/dist/esm/components/Inspector/InspectorHeader.js +2 -2
- package/dist/esm/components/Inspector/LogDetail.d.ts +1 -1
- package/dist/esm/components/Inspector/LogDetail.js +2 -2
- package/dist/esm/components/Inspector/NetworkDetail.d.ts +1 -1
- package/dist/esm/components/Inspector/NetworkDetail.js +2 -2
- package/dist/esm/components/Inspector/NetworkTab.d.ts +1 -1
- package/dist/esm/components/Inspector/NetworkTab.js +10 -9
- package/dist/esm/components/Inspector/ReduxTab.d.ts +1 -1
- package/dist/esm/components/Inspector/ReduxTab.js +2 -2
- package/dist/esm/components/Inspector/TabBar.d.ts +1 -1
- package/dist/esm/components/Inspector/TabBar.js +2 -2
- package/dist/esm/components/JsonViewer.d.ts +2 -2
- package/dist/esm/components/JsonViewer.js +2 -2
- package/dist/esm/components/ReduxTreeView.d.ts +2 -2
- package/dist/esm/components/ReduxTreeView.js +2 -2
- package/dist/esm/components/SegmentedTabs.d.ts +1 -1
- package/dist/esm/components/SegmentedTabs.js +2 -2
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/example/App.tsx +57 -1
- package/example/README.md +33 -77
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ const valueContainsTerm = (val, term) => {
|
|
|
40
40
|
}
|
|
41
41
|
return Object.keys(val).some(key => key.toLowerCase().includes(t) || valueContainsTerm(val[key], term));
|
|
42
42
|
};
|
|
43
|
-
export const ReduxTreeView = ({ state, actionHistory = [], lastActionMap = {}, search = '', onSearchChange, autoRefresh = true, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey = null, onSelectSliceKey, selectedActionId = null, onSelectActionId, }) => {
|
|
43
|
+
export const ReduxTreeView = React.memo(({ state, actionHistory = [], lastActionMap = {}, search = '', onSearchChange, autoRefresh = true, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey = null, onSelectSliceKey, selectedActionId = null, onSelectActionId, }) => {
|
|
44
44
|
const [activeTab, setActiveTab] = useState('state');
|
|
45
45
|
const [actionSubTab, setActionSubTab] = useState('payload');
|
|
46
46
|
// local fallbacks if props are not provided
|
|
@@ -708,7 +708,7 @@ export const ReduxTreeView = ({ state, actionHistory = [], lastActionMap = {}, s
|
|
|
708
708
|
}))}
|
|
709
709
|
</ScrollView>)}
|
|
710
710
|
</View>);
|
|
711
|
-
};
|
|
711
|
+
});
|
|
712
712
|
const styles = StyleSheet.create({
|
|
713
713
|
container: {
|
|
714
714
|
flex: 1,
|
|
@@ -11,5 +11,5 @@ interface SegmentedTabsProps {
|
|
|
11
11
|
onChange: (key: string) => void;
|
|
12
12
|
style?: ViewStyle | ViewStyle[];
|
|
13
13
|
}
|
|
14
|
-
declare const SegmentedTabs: ({ tabs, activeKey, onChange, style }: SegmentedTabsProps) => React.JSX.Element
|
|
14
|
+
declare const SegmentedTabs: React.MemoExoticComponent<({ tabs, activeKey, onChange, style }: SegmentedTabsProps) => React.JSX.Element>;
|
|
15
15
|
export default SegmentedTabs;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Pressable, Text, View } from 'react-native';
|
|
3
3
|
import { AppColors } from '../styles/AppColors';
|
|
4
4
|
import { AppFonts } from '../styles/AppFonts';
|
|
5
|
-
const SegmentedTabs = ({ tabs, activeKey, onChange, style }) => (<View style={[
|
|
5
|
+
const SegmentedTabs = React.memo(({ tabs, activeKey, onChange, style }) => (<View style={[
|
|
6
6
|
{
|
|
7
7
|
flexDirection: 'row',
|
|
8
8
|
borderRadius: 8,
|
|
@@ -43,5 +43,5 @@ const SegmentedTabs = ({ tabs, activeKey, onChange, style }) => (<View style={[
|
|
|
43
43
|
</Text>
|
|
44
44
|
</Pressable>);
|
|
45
45
|
})}
|
|
46
|
-
</View>);
|
|
46
|
+
</View>));
|
|
47
47
|
export default SegmentedTabs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.1.
|
|
1
|
+
export declare const LIB_VERSION = "1.1.16";
|
package/example/App.tsx
CHANGED
|
@@ -458,6 +458,39 @@ function HomeScreen({ navigation }: any) {
|
|
|
458
458
|
Trigger Log, Warn & Error Logs
|
|
459
459
|
</Text>
|
|
460
460
|
</TouchableOpacity>
|
|
461
|
+
|
|
462
|
+
<View style={[styles.btnRow, {marginTop: 8}]}>
|
|
463
|
+
<TouchableOpacity
|
|
464
|
+
style={[styles.gridBtn, { borderColor: '#8B5CF6' }]}
|
|
465
|
+
onPress={() => {
|
|
466
|
+
console.log(
|
|
467
|
+
'Multi-argument payload inspection:',
|
|
468
|
+
{ userId: 101, username: 'venkatesh', role: 'Lead Architect' },
|
|
469
|
+
['permissions.read', 'permissions.write', 'permissions.admin'],
|
|
470
|
+
{ device: 'iPhone 15 Pro', os: 'iOS 18.0', battery: '92%' },
|
|
471
|
+
);
|
|
472
|
+
}}
|
|
473
|
+
>
|
|
474
|
+
<Text style={[styles.btnText, { color: '#8B5CF6' }]}>
|
|
475
|
+
Multi-Arg Log
|
|
476
|
+
</Text>
|
|
477
|
+
</TouchableOpacity>
|
|
478
|
+
|
|
479
|
+
<TouchableOpacity
|
|
480
|
+
style={[styles.gridBtn, { borderColor: '#EF4444' }]}
|
|
481
|
+
onPress={() => {
|
|
482
|
+
try {
|
|
483
|
+
throw new TypeError('Cannot read properties of undefined (reading "authToken")');
|
|
484
|
+
} catch (err) {
|
|
485
|
+
console.error(err);
|
|
486
|
+
}
|
|
487
|
+
}}
|
|
488
|
+
>
|
|
489
|
+
<Text style={[styles.btnText, { color: '#EF4444' }]}>
|
|
490
|
+
Error Stack Log
|
|
491
|
+
</Text>
|
|
492
|
+
</TouchableOpacity>
|
|
493
|
+
</View>
|
|
461
494
|
</View>
|
|
462
495
|
|
|
463
496
|
<View style={styles.panelCard}>
|
|
@@ -517,8 +550,31 @@ function HomeScreen({ navigation }: any) {
|
|
|
517
550
|
|
|
518
551
|
<View style={styles.panelCard}>
|
|
519
552
|
<Text style={styles.panelHeader}>βοΈ REDUX & STATE ACTIONS</Text>
|
|
553
|
+
<View style={styles.btnRow}>
|
|
554
|
+
<TouchableOpacity
|
|
555
|
+
style={[styles.gridBtn, { borderColor: '#10B981' }]}
|
|
556
|
+
onPress={handleToggleSidebar}
|
|
557
|
+
>
|
|
558
|
+
<Text style={[styles.btnText, { color: '#10B981' }]}>
|
|
559
|
+
Toggle Sidebar
|
|
560
|
+
</Text>
|
|
561
|
+
</TouchableOpacity>
|
|
562
|
+
<TouchableOpacity
|
|
563
|
+
style={[styles.gridBtn, { borderColor: '#06B6D4' }]}
|
|
564
|
+
onPress={() => {
|
|
565
|
+
mockStore.dispatch({
|
|
566
|
+
type: 'SET_THEME',
|
|
567
|
+
payload: mockStore.getState().settings.theme === 'dark' ? 'light' : 'dark',
|
|
568
|
+
});
|
|
569
|
+
}}
|
|
570
|
+
>
|
|
571
|
+
<Text style={[styles.btnText, { color: '#06B6D4' }]}>
|
|
572
|
+
Toggle Theme
|
|
573
|
+
</Text>
|
|
574
|
+
</TouchableOpacity>
|
|
575
|
+
</View>
|
|
520
576
|
<TouchableOpacity
|
|
521
|
-
style={[styles.fullWidthBtn, { backgroundColor: '#8B5CF6' }]}
|
|
577
|
+
style={[styles.fullWidthBtn, { backgroundColor: '#8B5CF6', marginTop: 8 }]}
|
|
522
578
|
onPress={handleToggleSidebar}
|
|
523
579
|
>
|
|
524
580
|
<Text style={styles.fullWidthBtnText}>
|
package/example/README.md
CHANGED
|
@@ -1,97 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
# React Native In-App Inspector Example App π
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This directory contains a complete, interactive sample application demonstrating all the capabilities of **`react-native-inapp-inspector`**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## π± Features Demonstrated
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- π **Network Interception**: Test Axios (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`) and `fetch` requests with response inspector, headers, and cURL generation.
|
|
10
|
+
- πͺ΅ **Console Logger & Call Stacks**: Test log levels (`log`, `warn`, `error`), multi-argument object logging, error exception stack traces, and Metro source map symbolication.
|
|
11
|
+
- βΈοΈ **Live Stream Pause / Resume**: Test pausing and resuming real-time traffic across API and console streams.
|
|
12
|
+
- π **Redux State Inspection**: Test Redux state tree, live action dispatches, and diff tracking.
|
|
13
|
+
- π **Analytics Tracking**: Test custom analytics events and e-commerce purchase payloads.
|
|
14
|
+
- π‘οΈ **Error Boundary**: Test simulated JavaScript and native error catches.
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
---
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
# Using npm
|
|
15
|
-
npm start
|
|
18
|
+
## π Quick Start
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
yarn start
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Step 2: Build and run your app
|
|
22
|
-
|
|
23
|
-
With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
|
|
24
|
-
|
|
25
|
-
### Android
|
|
20
|
+
### 1. Install Dependencies
|
|
26
21
|
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
npm
|
|
30
|
-
|
|
31
|
-
# OR using Yarn
|
|
32
|
-
yarn android
|
|
22
|
+
```bash
|
|
23
|
+
cd example
|
|
24
|
+
npm install
|
|
33
25
|
```
|
|
34
26
|
|
|
35
|
-
### iOS
|
|
36
|
-
|
|
37
|
-
For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
|
|
27
|
+
### 2. iOS Setup
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```sh
|
|
29
|
+
```bash
|
|
30
|
+
cd ios
|
|
42
31
|
bundle install
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Then, and every time you update your native dependencies, run:
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
32
|
bundle exec pod install
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
|
|
52
|
-
|
|
53
|
-
```sh
|
|
54
|
-
# Using npm
|
|
33
|
+
cd ..
|
|
55
34
|
npm run ios
|
|
56
|
-
|
|
57
|
-
# OR using Yarn
|
|
58
|
-
yarn ios
|
|
59
35
|
```
|
|
60
36
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
This is one way to run your app β you can also build it directly from Android Studio or Xcode.
|
|
64
|
-
|
|
65
|
-
## Step 3: Modify your app
|
|
66
|
-
|
|
67
|
-
Now that you have successfully run the app, let's make changes!
|
|
68
|
-
|
|
69
|
-
Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes βΒ this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh).
|
|
70
|
-
|
|
71
|
-
When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
|
|
72
|
-
|
|
73
|
-
- **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Dev Menu**, accessed via <kbd>Ctrl</kbd> + <kbd>M</kbd> (Windows/Linux) or <kbd>Cmd β</kbd> + <kbd>M</kbd> (macOS).
|
|
74
|
-
- **iOS**: Press <kbd>R</kbd> in iOS Simulator.
|
|
37
|
+
### 3. Android Setup
|
|
75
38
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
### Now what?
|
|
81
|
-
|
|
82
|
-
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
|
|
83
|
-
- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
|
|
84
|
-
|
|
85
|
-
# Troubleshooting
|
|
86
|
-
|
|
87
|
-
If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
|
|
39
|
+
```bash
|
|
40
|
+
npm run android
|
|
41
|
+
```
|
|
88
42
|
|
|
89
|
-
|
|
43
|
+
---
|
|
90
44
|
|
|
91
|
-
|
|
45
|
+
## π§ͺ Interactive Test Controls
|
|
92
46
|
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
47
|
+
The example screen provides one-tap triggers for:
|
|
48
|
+
- **Network Requests**: `Fetch User`, `Failing Request`, `Axios GET`, `Axios POST`, `Axios PUT`, `Axios PATCH`, `Axios DELETE`.
|
|
49
|
+
- **Console Events**: `Trigger Log / Warn / Error`, `Multi-Arg Log`, `Error Stack Log`.
|
|
50
|
+
- **Analytics Events**: `Log Custom Event`, `Log Purchase`.
|
|
51
|
+
- **Redux Actions**: `Toggle Sidebar`, `Toggle Theme`.
|
|
52
|
+
- **Simulate Batch (Flood)**: `Fire Sample All` triggers a simultaneous barrage of requests, logs, analytics events, and state dispatches.
|
|
53
|
+
- **Error Boundary**: `Crash JS Component` triggers a safe Error Boundary catch.
|
package/package.json
CHANGED