From 6c148aa297565999c56f81983f877f0eb67e848d Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Mon, 30 Sep 2024 18:16:22 +0100 Subject: [PATCH] fix[react-devtools]: request hook initialization inside http server response script --- packages/react-devtools-core/src/standalone.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-devtools-core/src/standalone.js b/packages/react-devtools-core/src/standalone.js index bfd05cf5227ee..d65b41b478fa2 100644 --- a/packages/react-devtools-core/src/standalone.js +++ b/packages/react-devtools-core/src/standalone.js @@ -17,7 +17,6 @@ import {registerDevToolsEventLogger} from 'react-devtools-shared/src/registerDev import {Server} from 'ws'; import {join} from 'path'; import {readFileSync} from 'fs'; -import {installHook} from 'react-devtools-shared/src/hook'; import DevTools from 'react-devtools-shared/src/devtools/views/DevTools'; import {doesFilePathExist, launchEditor} from './editor'; import { @@ -29,8 +28,6 @@ import {localStorageSetItem} from 'react-devtools-shared/src/storage'; import type {FrontendBridge} from 'react-devtools-shared/src/bridge'; import type {Source} from 'react-devtools-shared/src/shared/types'; -installHook(window); - export type StatusTypes = 'server-connected' | 'devtools-connected' | 'error'; export type StatusListener = (message: string, status: StatusTypes) => void; export type OnDisconnectedCallback = () => void; @@ -371,9 +368,12 @@ function startServer( '\n;' + backendFile.toString() + '\n;' + + 'ReactDevToolsBackend.initialize();' + + '\n' + `ReactDevToolsBackend.connectToDevTools({port: ${port}, host: '${host}', useHttps: ${ useHttps ? 'true' : 'false' - }});`, + }}); + `, ); });