reactoradar 1.6.0 → 1.6.1

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 (2) hide show
  1. package/main.js +26 -11
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -417,17 +417,32 @@ function setupIPC() {
417
417
  ipcMain.on('open-react-devtools', () => {
418
418
  // Start the relay server if not already running
419
419
  if (!reactDTServer) startReactDevToolsServer();
420
- // Open standalone react-devtools window
421
- const rdtWin = new BrowserWindow({
422
- width: 1100,
423
- height: 700,
424
- titleBarStyle: 'hiddenInset',
425
- backgroundColor: '#0a0b0e',
426
- title: 'React DevTools',
427
- webPreferences: { nodeIntegration: false, contextIsolation: true, sandbox: true },
428
- });
429
- // Metro serves the React DevTools frontend at /debugger-ui
430
- rdtWin.loadURL(`http://localhost:${PORTS.METRO}/debugger-ui`);
420
+ // Launch standalone react-devtools via npx in a background process
421
+ try {
422
+ const { spawn } = require('child_process');
423
+ const env = { ...process.env };
424
+ // Remove ELECTRON_RUN_AS_NODE to prevent npx from running in Electron's Node
425
+ delete env.ELECTRON_RUN_AS_NODE;
426
+ const child = spawn('npx', ['react-devtools'], {
427
+ stdio: 'ignore',
428
+ detached: true,
429
+ env,
430
+ });
431
+ child.unref();
432
+ console.log('[ReactDevTools] Launched standalone react-devtools');
433
+ _send('react-dt-status', 'launched');
434
+ } catch (e) {
435
+ console.error('[ReactDevTools] Failed to launch:', e.message);
436
+ // Fallback: show instructions in a dialog
437
+ const { dialog } = require('electron');
438
+ dialog.showMessageBox(mainWindow, {
439
+ type: 'info',
440
+ title: 'React DevTools',
441
+ message: 'Could not launch React DevTools automatically.',
442
+ detail: 'Run this command in your terminal:\n\nnpx react-devtools\n\nIt will connect to your app on port 8097.',
443
+ buttons: ['OK'],
444
+ });
445
+ }
431
446
  });
432
447
 
433
448
  // clear-all is handled by renderer via clear-all-ui IPC from menu
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reactoradar",
3
3
  "productName": "ReactoRadar",
4
- "version": "1.6.0",
4
+ "version": "1.6.1",
5
5
  "description": "macOS debugger for React Native — Console, Sources, Network, Performance, Memory, Redux, AsyncStorage, React tree. Supports RN 0.74+ with Hermes and New Architecture.",
6
6
  "main": "main.js",
7
7
  "bin": {