Socket
Socket
Sign inDemoInstall

@react-native/dev-middleware

Package Overview
Dependencies
Maintainers
11
Versions
403
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native/dev-middleware - npm Package Compare versions

Comparing version 0.73.3 to 0.73.4

dist/middleware/deprecated_openFlipperMiddleware.d.ts

25

dist/createDevMiddleware.js

@@ -13,2 +13,5 @@ "use strict";

var _serveStatic = _interopRequireDefault(require("serve-static"));
var _deprecated_openFlipperMiddleware = _interopRequireDefault(
require("./middleware/deprecated_openFlipperMiddleware")
);
var _openDebuggerMiddleware = _interopRequireDefault(

@@ -57,10 +60,14 @@ require("./middleware/openDebuggerMiddleware")

"/open-debugger",
(0, _openDebuggerMiddleware.default)({
serverBaseUrl,
inspectorProxy,
browserLauncher: unstable_browserLauncher,
eventReporter: unstable_eventReporter,
experiments,
logger,
})
experiments.enableNewDebugger
? (0, _openDebuggerMiddleware.default)({
serverBaseUrl,
inspectorProxy,
browserLauncher: unstable_browserLauncher,
eventReporter: unstable_eventReporter,
experiments,
logger,
})
: (0, _deprecated_openFlipperMiddleware.default)({
logger,
})
)

@@ -81,5 +88,5 @@ .use(

return {
enableCustomDebuggerFrontend: config.enableCustomDebuggerFrontend ?? false,
enableNewDebugger: config.enableNewDebugger ?? false,
enableOpenDebuggerRedirect: config.enableOpenDebuggerRedirect ?? false,
};
}

@@ -68,8 +68,9 @@ "use strict";

processRequest(request, response, next) {
const pathname = _url.default.parse(request.url).pathname;
if (
request.url === PAGES_LIST_JSON_URL ||
request.url === PAGES_LIST_JSON_URL_2
pathname === PAGES_LIST_JSON_URL ||
pathname === PAGES_LIST_JSON_URL_2
) {
this._sendJsonResponse(response, this.getPageDescriptions());
} else if (request.url === PAGES_LIST_JSON_VERSION_URL) {
} else if (pathname === PAGES_LIST_JSON_VERSION_URL) {
this._sendJsonResponse(response, {

@@ -76,0 +77,0 @@ Browser: "Mobile JavaScript",

@@ -59,3 +59,3 @@ "use strict";

(launchType === "launch" ? "Launching" : "Redirecting to") +
" JS debugger..."
" JS debugger (experimental)..."
);

@@ -93,4 +93,3 @@ target = targets.find((_target) => _target.description === appId);

target.webSocketDebuggerUrl,
serverBaseUrl,
experiments
serverBaseUrl
)

@@ -106,4 +105,3 @@ )

// Use a relative URL.
"",
experiments
""
),

@@ -110,0 +108,0 @@ });

@@ -13,6 +13,7 @@ /**

/**
* Enables the use of the custom debugger frontend (@react-native/debugger-frontend)
* in the /open-debugger endpoint.
* Enables the new JS debugger launch flow and custom debugger frontend
* (@react-native/debugger-frontend). When disabled, /open-debugger will
* trigger the legacy Flipper connection flow.
*/
enableCustomDebuggerFrontend: boolean;
enableNewDebugger: boolean;
/**

@@ -19,0 +20,0 @@ * Enables the handling of GET requests in the /open-debugger endpoint,

@@ -12,11 +12,9 @@ /**

import type { Experiments } from "../types/Experiments";
/**
* Construct the URL to Chrome DevTools connected to a given debugger target.
* Get the DevTools frontend URL to debug a given React Native CDP target.
*/
declare function getDevToolsFrontendUrl(
webSocketDebuggerUrl: string,
devServerUrl: string,
experiments: Experiments
devServerUrl: string
): string;
export default getDevToolsFrontendUrl;

@@ -19,31 +19,10 @@ "use strict";

/**
* The Chrome DevTools frontend revision to use. This should be set to the
* latest version known to be compatible with Hermes.
*
* Revision should be the full identifier from:
* https://chromium.googlesource.com/chromium/src.git
* Get the DevTools frontend URL to debug a given React Native CDP target.
*/
const DEVTOOLS_FRONTEND_REV = "d9568d04d7dd79269c5a655d7ada69650c5a8336"; // Chrome 100.0.4896.75
/**
* Construct the URL to Chrome DevTools connected to a given debugger target.
*/
function getDevToolsFrontendUrl(
webSocketDebuggerUrl,
devServerUrl,
experiments
) {
function getDevToolsFrontendUrl(webSocketDebuggerUrl, devServerUrl) {
const scheme = new URL(webSocketDebuggerUrl).protocol.slice(0, -1);
const webSocketUrlWithoutProtocol = webSocketDebuggerUrl.replace(
/^wss?:\/\//,
""
const webSocketUrlWithoutProtocol = encodeURIComponent(
webSocketDebuggerUrl.replace(/^wss?:\/\//, "")
);
if (experiments.enableCustomDebuggerFrontend) {
return `${`${devServerUrl}/debugger-frontend/rn_inspector.html`}?${scheme}=${encodeURIComponent(
webSocketUrlWithoutProtocol
)}&sources.hide_add_folder=true`;
}
return `${`https://chrome-devtools-frontend.appspot.com/serve_rev/@${DEVTOOLS_FRONTEND_REV}/devtools_app.html`}?panel=console&${scheme}=${encodeURIComponent(
webSocketUrlWithoutProtocol
)}`;
return `${`${devServerUrl}/debugger-frontend/rn_inspector.html`}?${scheme}=${webSocketUrlWithoutProtocol}&sources.hide_add_folder=true`;
}
{
"name": "@react-native/dev-middleware",
"version": "0.73.3",
"version": "0.73.4",
"description": "Dev server middleware for React Native",

@@ -24,2 +24,3 @@ "keywords": ["react-native", "tools"],

"node-fetch": "^2.2.0",
"open": "^7.0.3",
"serve-static": "^1.13.1",

@@ -26,0 +27,0 @@ "temp-dir": "^2.0.0"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc