@react-native/debugger-shell 0.82.0-nightly-20250822-646945c2f → 0.82.0-nightly-20250824-bf12e30cb

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.
@@ -18,37 +18,31 @@ function handleLaunchArgs(argv) {
18
18
  },
19
19
  args: argv,
20
20
  });
21
- const existingWindow = BrowserWindow.getAllWindows().find((window) => {
21
+ let frontendWindow = BrowserWindow.getAllWindows().find((window) => {
22
22
  const metadata = windowMetadata.get(window);
23
23
  if (!metadata) {
24
24
  return false;
25
25
  }
26
26
  return metadata.windowKey === windowKey;
27
27
  });
28
- if (existingWindow) {
29
- if (existingWindow.isVisible()) {
30
- existingWindow.flashFrame(true);
28
+ if (frontendWindow) {
29
+ if (frontendWindow.isVisible()) {
30
+ frontendWindow.flashFrame(true);
31
31
  setTimeout(() => {
32
- existingWindow.flashFrame(false);
32
+ frontendWindow.flashFrame(false);
33
33
  }, 1000);
34
34
  }
35
- if (process.platform === "darwin") {
36
- app.focus({
37
- steal: true,
38
- });
39
- }
40
- existingWindow.focus();
41
- return;
35
+ } else {
36
+ frontendWindow = new BrowserWindow({
37
+ width: 1200,
38
+ height: 600,
39
+ webPreferences: {
40
+ partition: "persist:react-native-devtools",
41
+ preload: require.resolve("./preload.js"),
42
+ },
43
+ icon: path.join(__dirname, "resources", "icon.png"),
44
+ });
42
45
  }
43
- const frontendWindow = new BrowserWindow({
44
- width: 1200,
45
- height: 600,
46
- webPreferences: {
47
- partition: "persist:react-native-devtools",
48
- preload: require.resolve("./preload.js"),
49
- },
50
- icon: path.join(__dirname, "resources", "icon.png"),
51
- });
52
46
  frontendWindow.webContents.setWindowOpenHandler(({ url }) => {
53
47
  shell.openExternal(url);
54
48
  return {
@@ -64,6 +58,7 @@ function handleLaunchArgs(argv) {
64
58
  steal: true,
65
59
  });
66
60
  }
61
+ frontendWindow.focus();
67
62
  }
68
63
  app.whenReady().then(() => {
69
64
  handleLaunchArgs(process.argv.slice(app.isPackaged ? 1 : 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/debugger-shell",
3
- "version": "0.82.0-nightly-20250822-646945c2f",
3
+ "version": "0.82.0-nightly-20250824-bf12e30cb",
4
4
  "description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
5
5
  "keywords": [
6
6
  "react-native",
@@ -36,7 +36,7 @@ function handleLaunchArgs(argv: string[]) {
36
36
  });
37
37
 
38
38
  // Find an existing window for this app and launch configuration.
39
- const existingWindow = BrowserWindow.getAllWindows().find(window => {
39
+ let frontendWindow = BrowserWindow.getAllWindows().find(window => {
40
40
  const metadata = windowMetadata.get(window);
41
41
  if (!metadata) {
42
42
  return false;
@@ -44,41 +44,37 @@ function handleLaunchArgs(argv: string[]) {
44
44
  return metadata.windowKey === windowKey;
45
45
  });
46
46
 
47
- if (existingWindow) {
47
+ if (frontendWindow) {
48
48
  // If the window is already visible, flash it.
49
- if (existingWindow.isVisible()) {
50
- existingWindow.flashFrame(true);
49
+ if (frontendWindow.isVisible()) {
50
+ frontendWindow.flashFrame(true);
51
51
  setTimeout(() => {
52
- existingWindow.flashFrame(false);
52
+ frontendWindow.flashFrame(false);
53
53
  }, 1000);
54
54
  }
55
- if (process.platform === 'darwin') {
56
- app.focus({
57
- steal: true,
58
- });
59
- }
60
- existingWindow.focus();
61
- return;
55
+ } else {
56
+ // Create the browser window.
57
+ frontendWindow = new BrowserWindow({
58
+ width: 1200,
59
+ height: 600,
60
+ webPreferences: {
61
+ partition: 'persist:react-native-devtools',
62
+ preload: require.resolve('./preload.js'),
63
+ },
64
+ // Icon for Linux
65
+ icon: path.join(__dirname, 'resources', 'icon.png'),
66
+ });
62
67
  }
63
68
 
64
- // Create the browser window.
65
- const frontendWindow = new BrowserWindow({
66
- width: 1200,
67
- height: 600,
68
- webPreferences: {
69
- partition: 'persist:react-native-devtools',
70
- preload: require.resolve('./preload.js'),
71
- },
72
- // Icon for Linux
73
- icon: path.join(__dirname, 'resources', 'icon.png'),
74
- });
75
-
76
69
  // Open links in the default browser instead of in new Electron windows.
77
70
  frontendWindow.webContents.setWindowOpenHandler(({url}) => {
78
71
  shell.openExternal(url);
79
72
  return {action: 'deny'};
80
73
  });
81
74
 
75
+ // TODO: If the window contains a live, working frontend instance with a valid connection to the backend,
76
+ // we should avoid this reload and instead send the frontend a message to handle the launch arguments
77
+ // dynamically (e.g. update the launch ID for telemetry purposes, handle deeplinking to a specific CDT panel, etc).
82
78
  frontendWindow.loadURL(frontendUrl);
83
79
 
84
80
  windowMetadata.set(frontendWindow, {
@@ -90,6 +86,7 @@ function handleLaunchArgs(argv: string[]) {
90
86
  steal: true,
91
87
  });
92
88
  }
89
+ frontendWindow.focus();
93
90
  }
94
91
 
95
92
  app.whenReady().then(() => {