@react-native/dev-middleware
Advanced tools
Comparing version 0.74.0-nightly-20231206-eb661df2a to 0.74.0-nightly-20231207-80812658e
@@ -88,3 +88,4 @@ "use strict"; | ||
enableOpenDebuggerRedirect: config.enableOpenDebuggerRedirect ?? false, | ||
enableNetworkInspector: config.enableNetworkInspector ?? false, | ||
}; | ||
} |
@@ -102,2 +102,3 @@ "use strict"; | ||
(0, _getDevToolsFrontendUrl.default)( | ||
experiments, | ||
target.webSocketDebuggerUrl, | ||
@@ -113,2 +114,3 @@ serverBaseUrl | ||
Location: (0, _getDevToolsFrontendUrl.default)( | ||
experiments, | ||
target.webSocketDebuggerUrl, | ||
@@ -115,0 +117,0 @@ // Use a relative URL. |
@@ -25,3 +25,7 @@ /** | ||
enableOpenDebuggerRedirect: boolean; | ||
/** | ||
* Enables the Network panel when launching the custom debugger frontend. | ||
*/ | ||
enableNetworkInspector: boolean; | ||
}>; | ||
export type ExperimentsConfig = Partial<Experiments>; |
@@ -12,2 +12,3 @@ /** | ||
import type { Experiments } from "../types/Experiments"; | ||
/** | ||
@@ -17,2 +18,3 @@ * Get the DevTools frontend URL to debug a given React Native CDP target. | ||
declare function getDevToolsFrontendUrl( | ||
experiments: Experiments, | ||
webSocketDebuggerUrl: string, | ||
@@ -19,0 +21,0 @@ devServerUrl: string |
@@ -21,3 +21,7 @@ "use strict"; | ||
*/ | ||
function getDevToolsFrontendUrl(webSocketDebuggerUrl, devServerUrl) { | ||
function getDevToolsFrontendUrl( | ||
experiments, | ||
webSocketDebuggerUrl, | ||
devServerUrl | ||
) { | ||
const scheme = new URL(webSocketDebuggerUrl).protocol.slice(0, -1); | ||
@@ -27,3 +31,6 @@ const webSocketUrlWithoutProtocol = encodeURIComponent( | ||
); | ||
return `${`${devServerUrl}/debugger-frontend/rn_inspector.html`}?${scheme}=${webSocketUrlWithoutProtocol}&sources.hide_add_folder=true`; | ||
const devToolsUrl = `${`${devServerUrl}/debugger-frontend/rn_inspector.html`}?${scheme}=${webSocketUrlWithoutProtocol}&sources.hide_add_folder=true`; | ||
return experiments.enableNetworkInspector | ||
? `${devToolsUrl}&unstable_enableNetworkPanel=true` | ||
: devToolsUrl; | ||
} |
{ | ||
"name": "@react-native/dev-middleware", | ||
"version": "0.74.0-nightly-20231206-eb661df2a", | ||
"version": "0.74.0-nightly-20231207-80812658e", | ||
"description": "Dev server middleware for React Native", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
"@isaacs/ttlcache": "^1.4.1", | ||
"@react-native/debugger-frontend": "0.74.0-nightly-20231206-eb661df2a", | ||
"@react-native/debugger-frontend": "0.74.0-nightly-20231207-80812658e", | ||
"@rnx-kit/chromium-edge-launcher": "^1.0.0", | ||
@@ -29,0 +29,0 @@ "chrome-launcher": "^0.15.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93805
2113