reactoradar 1.2.3

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/LICENSE +21 -0
  2. package/README.md +366 -0
  3. package/app.js +2450 -0
  4. package/assets/icon.svg +54 -0
  5. package/bin/cli.js +79 -0
  6. package/bin/open-debugger.sh +9 -0
  7. package/bin/setup.js +473 -0
  8. package/index.html +82 -0
  9. package/main.js +528 -0
  10. package/package.json +76 -0
  11. package/preload.js +31 -0
  12. package/sdk/RNDebugSDK.js +540 -0
  13. package/src/main/main.js +396 -0
  14. package/src/main/preload.js +28 -0
  15. package/src/renderer/app.js +221 -0
  16. package/src/renderer/components/object-tree.js +245 -0
  17. package/src/renderer/index.html +111 -0
  18. package/src/renderer/panels/console.js +248 -0
  19. package/src/renderer/panels/memory.js +60 -0
  20. package/src/renderer/panels/network.js +559 -0
  21. package/src/renderer/panels/performance.js +144 -0
  22. package/src/renderer/panels/react.js +31 -0
  23. package/src/renderer/panels/redux.js +159 -0
  24. package/src/renderer/panels/settings.js +93 -0
  25. package/src/renderer/panels/sources.js +189 -0
  26. package/src/renderer/panels/storage.js +134 -0
  27. package/src/renderer/state.js +132 -0
  28. package/src/renderer/styles/components.css +145 -0
  29. package/src/renderer/styles/console.css +73 -0
  30. package/src/renderer/styles/main.css +229 -0
  31. package/src/renderer/styles/network.css +242 -0
  32. package/src/renderer/styles/performance.css +45 -0
  33. package/src/renderer/styles/redux.css +77 -0
  34. package/src/renderer/styles/settings.css +63 -0
  35. package/src/renderer/styles/sources.css +48 -0
  36. package/src/renderer/styles/storage.css +28 -0
  37. package/src/renderer/styles/theme-light.css +57 -0
  38. package/styles.css +1308 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,366 @@
1
+ # RN Debugger
2
+
3
+ <p align="center">
4
+ <b>A standalone macOS app for debugging React Native apps</b>
5
+ <br/>
6
+ <i>Supports React Native 0.74+ with Hermes, New Architecture, and latest versions</i>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <img src="https://img.shields.io/badge/React%20Native-0.74%2B-blue" alt="React Native 0.74+" />
11
+ <img src="https://img.shields.io/badge/Hermes-Supported-green" alt="Hermes" />
12
+ <img src="https://img.shields.io/badge/New%20Architecture-Supported-green" alt="New Arch" />
13
+ <img src="https://img.shields.io/badge/Platform-macOS-lightgrey" alt="macOS" />
14
+ <img src="https://img.shields.io/badge/License-MIT-yellow" alt="MIT" />
15
+ <img src="https://img.shields.io/npm/v/reactoradar" alt="npm version" />
16
+ </p>
17
+
18
+ ---
19
+
20
+ > The original [React Native Debugger](https://github.com/jhen0409/react-native-debugger) only supports the old Remote Debugger and doesn't work with Hermes / JSI / New Architecture. **This app is the modern replacement** — built from scratch to work with the latest React Native versions.
21
+
22
+ ## Screenshots
23
+
24
+ ### Console — Interactive Log Viewer
25
+ <p align="center">
26
+ <img src="https://raw.githubusercontent.com/sharanagouda/react-native-debugger/main/screenshots/consoleLogs.png" alt="Console Panel" width="800" />
27
+ </p>
28
+
29
+ *Collapsible object trees, level filters (Log/Info/Warn/Error), search, right-click to copy*
30
+
31
+ ### Network — Chrome DevTools-style Inspector
32
+ <p align="center">
33
+ <img src="https://raw.githubusercontent.com/sharanagouda/react-native-debugger/main/screenshots/networkLogs.png" alt="Network Panel" width="800" />
34
+ </p>
35
+
36
+ *Resizable/sortable columns, request/response detail, Copy as cURL, throttling*
37
+
38
+ ## What's included
39
+
40
+ - **Console** — Interactive log viewer with collapsible object trees (Chrome DevTools-like), level filters, caller file:line display
41
+ - **Network Inspector** — Chrome DevTools-style network panel with resizable/sortable columns, search, type filters, throttling (Fast 3G / Slow 3G / Offline), Copy as cURL
42
+ - **Performance** — Live FPS meter, JS Thread timing, UI Thread timing with real-time sparkline graphs
43
+ - **Memory** — JS Heap Used/Total, Native Memory gauges from Hermes runtime
44
+ - **Redux DevTools** — Action list with time travel (Prev/Next), State/Diff/Action tabs with previous/current/next action context
45
+ - **AsyncStorage Inspector** — Live key/value browser with search
46
+ - **React DevTools** — Component tree and props inspector via `react-devtools-core` relay
47
+
48
+ ## Installation
49
+
50
+ ### Option A: Using npx (recommended)
51
+
52
+ No install needed — run directly from your React Native project:
53
+
54
+ ```bash
55
+ npx reactoradar setup # Install SDK into your RN project
56
+ npx reactoradar # Launch the debugger app
57
+ ```
58
+
59
+ ### Option B: Download .dmg
60
+
61
+ 1. Download the `.dmg` from the [Releases](https://github.com/sharanagouda/react-native-debugger/releases) page
62
+ 2. Drag **RN Debugger** to your Applications folder
63
+ 3. **Important:** You still need to install the SDK into your RN project:
64
+
65
+ ```bash
66
+ cd your-react-native-project
67
+ npx reactoradar setup
68
+ ```
69
+
70
+ 4. Launch the app from Applications and run your RN app
71
+
72
+ > **macOS Gatekeeper warning:** Since the app isn't notarized with Apple, you'll see "Apple could not verify" on first launch. To fix: **right-click the app → Open → Open**. Or run: `xattr -cr "/Applications/RN Debugger.app"`
73
+
74
+ ### Option C: Using npm (global)
75
+
76
+ ```bash
77
+ npm install -g reactoradar
78
+ ```
79
+
80
+ ### Option D: Build from source
81
+
82
+ ```bash
83
+ git clone https://github.com/sharanagouda/react-native-debugger.git
84
+ cd react-native-debugger
85
+ npm install
86
+ npm start # run in dev mode
87
+ npm run build # build .dmg
88
+ ```
89
+
90
+ ## React Native Compatibility
91
+
92
+ | RN Debugger | React Native | Engine | Architecture |
93
+ |---|---|---|---|
94
+ | v1.0+ | 0.74 — 0.81+ | Hermes | Old & New Architecture |
95
+
96
+ This app does **not** use the legacy Remote Debugger. It connects via WebSocket bridges and Chrome DevTools Protocol (CDP), which is the standard debugging interface for Hermes.
97
+
98
+ ## Quick Start
99
+
100
+ ### Step 1: Install the SDK (one time, from your RN project)
101
+
102
+ ```bash
103
+ cd your-react-native-project
104
+ npx reactoradar setup
105
+ ```
106
+
107
+ This automatically:
108
+ - Copies `RNDebugSDK.js` into your project (`src/debug/`)
109
+ - Detects your platform (iOS Simulator / Android Emulator / device) and sets the correct HOST
110
+ - Patches `index.js` to load the SDK in `__DEV__` mode
111
+ - Detects Redux (Toolkit or legacy) and wires the debug middleware
112
+ - Runs `adb reverse` for Android (if emulator/device detected)
113
+ - Adds the SDK to `.gitignore`
114
+
115
+ ### Step 2: Launch the debugger
116
+
117
+ ```bash
118
+ # Using npx:
119
+ npx reactoradar
120
+
121
+ # Or if you installed the .dmg:
122
+ open "/Applications/RN Debugger.app"
123
+ ```
124
+
125
+ ### Step 3: Run your React Native app
126
+
127
+ ```bash
128
+ npx react-native run-ios # or run-android
129
+ ```
130
+
131
+ Console logs, network requests, Redux actions, and AsyncStorage data flow into the debugger automatically.
132
+
133
+ ### 4. Uninstall
134
+
135
+ ```bash
136
+ npx reactoradar remove
137
+ ```
138
+
139
+ Clean removal — removes SDK file, patches from `index.js`, Redux wiring, and `.gitignore` entry.
140
+
141
+ ## Add to your project scripts
142
+
143
+ ```json
144
+ {
145
+ "scripts": {
146
+ "debug:setup": "npx reactoradar setup",
147
+ "debug:start": "npx rn-debugger",
148
+ "debug:remove": "npx reactoradar remove"
149
+ }
150
+ }
151
+ ```
152
+
153
+ Then every developer on your team runs:
154
+
155
+ ```bash
156
+ npm run debug:setup # one time
157
+ npm run debug:start # every time
158
+ ```
159
+
160
+ ## Documentation
161
+
162
+ ### Console
163
+
164
+ - Intercepts `console.log`, `console.warn`, `console.error`, etc.
165
+ - Objects render as collapsible trees with syntax highlighting
166
+ - Caller file:line shown at the end of each log row
167
+ - Level filters: All / Log / Info / Warn / Error
168
+ - Click to expand, right-click to copy message/JSON/caller
169
+ - `Cmd+K` clears the active tab
170
+
171
+ ### Network Inspector
172
+
173
+ | Feature | Details |
174
+ |---|---|
175
+ | **Columns** | Name, Status, Type, Initiator, Size, Time, Waterfall — all resizable and sortable |
176
+ | **Search** | Filter by API URL in real time |
177
+ | **Type filters** | All, Fetch/XHR, JS, CSS, Img, Media, Font, Doc, WS |
178
+ | **Throttling** | No throttling, Fast 3G (500ms), Slow 3G (2s), Offline |
179
+ | **Detail view** | Click a row → Headers / Request / Preview / Response tabs overlay on the right |
180
+ | **Copy as cURL** | Right-click any request → Copy as cURL / Copy URL / Copy Response |
181
+ | **Request body** | Rendered as collapsible object tree (not raw JSON) |
182
+ | **Preview** | Response as interactive object tree, right-click to copy |
183
+ | **Capture toggle** | ON/OFF switch to pause/resume network capture |
184
+
185
+ Supports `fetch`, `XMLHttpRequest`, and `axios` (including `axios.create()` instances).
186
+
187
+ ### Redux DevTools
188
+
189
+ - Captures every dispatched action and the resulting state snapshot
190
+ - **Time travel**: Step forward/backward through state history
191
+ - **State tab**: Full state tree with syntax highlighting
192
+ - **Diff tab**: Line-by-line diff against previous state
193
+ - **Action tab**: Previous / Current / Next actions with payloads
194
+
195
+ Wire Redux with one line:
196
+
197
+ ```js
198
+ // Redux Toolkit
199
+ middleware: (getDefault) =>
200
+ __DEV__ ? getDefault().concat(require('./src/debug/RNDebugSDK').reduxMiddleware) : getDefault(),
201
+
202
+ // Legacy Redux
203
+ if (__DEV__) middleware.push(require('./src/debug/RNDebugSDK').reduxMiddleware);
204
+ ```
205
+
206
+ ### AsyncStorage Inspector
207
+
208
+ - Live key/value browser
209
+ - Search keys
210
+ - Values rendered as formatted JSON
211
+ - Auto-updates when your app reads/writes AsyncStorage
212
+
213
+ ### Performance
214
+
215
+ - **FPS** — Frames per second via `requestAnimationFrame` counter
216
+ - **JS Thread** — JavaScript thread frame timing
217
+ - **UI Thread** — Native UI thread timing
218
+ - Real-time sparkline graphs
219
+ - Data sent every 2 seconds from the SDK
220
+
221
+ ### Memory
222
+
223
+ - **JS Heap Used** — Current JavaScript heap usage
224
+ - **JS Heap Total** — Total allocated heap
225
+ - **Native Memory** — Native heap from Hermes runtime
226
+ - Powered by `HermesInternal.getRuntimeProperties()`
227
+
228
+ ### Network Throttling
229
+
230
+ Simulates slow network conditions on the device:
231
+
232
+ | Profile | Behavior |
233
+ |---|---|
234
+ | No throttling | Normal speed |
235
+ | Fast 3G | 500ms artificial delay on every request |
236
+ | Slow 3G | 2000ms delay |
237
+ | Offline | All requests immediately rejected |
238
+
239
+ ### Dark / Light Mode
240
+
241
+ Toggle via Settings tab or `Cmd+Shift+T`. Persists across restarts.
242
+
243
+ ## Keyboard Shortcuts
244
+
245
+ | Shortcut | Action |
246
+ |---|---|
247
+ | `Cmd+K` | Clear all panels |
248
+ | `Cmd+D` | Open JS Debugger (CDP DevTools with breakpoints) |
249
+ | `Cmd+R` | Open React DevTools |
250
+ | `Cmd+Shift+T` | Toggle Dark / Light mode |
251
+ | `Cmd+C` | Copy selected text |
252
+ | `Cmd+V` | Paste into filter/search |
253
+ | `Cmd+A` | Select all |
254
+
255
+ ## Ports
256
+
257
+ | Port | Service |
258
+ |---|---|
259
+ | 9090 | Redux bridge |
260
+ | 9091 | AsyncStorage bridge |
261
+ | 9092 | Console + Network + Performance bridge |
262
+ | 8097 | React DevTools relay |
263
+ | 8081 | Metro bundler (CDP) |
264
+
265
+ Change ports in both `main.js` and `RNDebugSDK.js` if conflicts arise.
266
+
267
+ ## Android Setup
268
+
269
+ For Android emulator, the setup command runs `adb reverse` automatically. For physical devices, ensure your Mac and device are on the same network and set the HOST in `src/debug/RNDebugSDK.js` to your Mac's LAN IP.
270
+
271
+ ```bash
272
+ # Manual adb reverse (if needed)
273
+ adb reverse tcp:9090 tcp:9090
274
+ adb reverse tcp:9091 tcp:9091
275
+ adb reverse tcp:9092 tcp:9092
276
+ adb reverse tcp:8097 tcp:8097
277
+ ```
278
+
279
+ ## Troubleshooting
280
+
281
+ | Problem | Solution |
282
+ |---|---|
283
+ | App won't launch from VS Code terminal | Run: `unset ELECTRON_RUN_AS_NODE && npx rn-debugger` |
284
+ | Device status shows "Waiting..." | Check HOST in `src/debug/RNDebugSDK.js`. iOS sim: `127.0.0.1`, Android emu: `10.0.2.2` |
285
+ | Network tab empty | Run Metro with `--reset-cache`. Ensure Reactotron has `networking: false` |
286
+ | `XHRInterceptor.js does not exist` | Set `networking: false` in ReactotronConfig.js |
287
+ | Metro crashes with WebSocket error | Update to latest version — CDP polling was replaced with on-demand fetching |
288
+ | Console shows `apply (native)` as caller | Update SDK with `npx reactoradar setup` |
289
+
290
+
291
+ ## How it works
292
+
293
+ ```
294
+ ┌─────────────────────────────────────────────────────┐
295
+ │ macOS Electron App │
296
+ │ │
297
+ │ Console │ Network │ Perf │ Memory │
298
+ │ Redux │ App (AsyncStorage) │ React │ Settings │
299
+ │ │
300
+ │ main.js │
301
+ │ ├─ WS Server :9092 ← console + network + perf │
302
+ │ ├─ WS Server :9090 ← redux actions + state │
303
+ │ ├─ WS Server :9091 ← asyncstorage mutations │
304
+ │ ├─ WS Relay :8097 ← react-devtools bridge │
305
+ │ └─ HTTP :8081 → Metro CDP (on-demand) │
306
+ └──────────────────────┬──────────────────────────────┘
307
+ │ WebSocket
308
+ ┌──────────────────────┴──────────────────────────────┐
309
+ │ Your React Native App │
310
+ │ │
311
+ │ RNDebugSDK.js (loaded in __DEV__ only) │
312
+ │ ├─ console.* interceptor │
313
+ │ ├─ XHR constructor wrapper (catches axios + fetch)│
314
+ │ ├─ FPS + memory metrics │
315
+ │ ├─ Network throttle support │
316
+ │ ├─ Redux middleware │
317
+ │ └─ AsyncStorage watcher │
318
+ └─────────────────────────────────────────────────────┘
319
+ ```
320
+
321
+ ## Credits
322
+
323
+ - [Electron](https://www.electronjs.org/) — Desktop app framework
324
+ - [React DevTools](https://github.com/facebook/react/tree/main/packages/react-devtools) — React component inspector
325
+ - [Redux DevTools](https://github.com/reduxjs/redux-devtools) — Inspiration for Redux time travel
326
+ - [React Native Debugger](https://github.com/jhen0409/react-native-debugger) — The original that inspired this project
327
+
328
+ ## Contributing
329
+
330
+ Contributions are welcome! Whether it's bug fixes, new features, documentation improvements, or UI enhancements — all PRs are appreciated.
331
+
332
+ ```bash
333
+ git clone https://github.com/sharanagouda/react-native-debugger.git
334
+ cd react-native-debugger
335
+ npm install
336
+ npm start
337
+ ```
338
+
339
+ ### How to contribute
340
+
341
+ 1. Fork the repository
342
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
343
+ 3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
344
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
345
+ 5. Open a Pull Request
346
+
347
+ ### Ideas for contribution
348
+
349
+ - Windows/Linux support
350
+ - Source file browser with breakpoints
351
+ - React Native New Architecture profiling
352
+ - Flipper plugin compatibility layer
353
+ - Custom themes
354
+ - Keyboard shortcut customization
355
+
356
+ See [STATUS.md](./STATUS.md) for detailed technical documentation and architecture overview.
357
+
358
+ ## Privacy
359
+
360
+ RN Debugger runs entirely on your local machine. It does not collect, transmit, or store any personal data. No analytics, no telemetry, no tracking. All debugging data stays on `localhost`.
361
+
362
+ See [PRIVACY.md](./PRIVACY.md) for the full privacy policy.
363
+
364
+ ## License
365
+
366
+ [MIT](./LICENSE)