New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@react-native/dev-middleware

Package Overview
Dependencies
Maintainers
2
Versions
547
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.75.0-nightly-20240225-12f2c3cd2 to 0.75.0-nightly-20240226-fcabb2ad2

6

dist/middleware/openDebuggerMiddleware.js

@@ -116,4 +116,6 @@ "use strict";

target.webSocketDebuggerUrl,
// Use a relative URL.
""
serverBaseUrl,
{
relative: true,
}
),

@@ -120,0 +122,0 @@ });

@@ -19,4 +19,5 @@ /**

webSocketDebuggerUrl: string,
devServerUrl: string
devServerUrl: string,
options?: Readonly<{ relative?: boolean }>
): string;
export default getDevToolsFrontendUrl;

@@ -24,11 +24,14 @@ "use strict";

webSocketDebuggerUrl,
devServerUrl
devServerUrl,
options
) {
const scheme = new URL(webSocketDebuggerUrl).protocol.slice(0, -1);
const webSocketUrlWithoutProtocol = webSocketDebuggerUrl.replace(
/^wss?:\/\//,
""
);
const wsParam = getWsParam({
webSocketDebuggerUrl,
devServerUrl,
});
const appUrl =
(options?.relative === true ? "" : devServerUrl) +
"/debugger-frontend/rn_inspector.html";
const searchParams = new URLSearchParams([
[scheme, webSocketUrlWithoutProtocol],
[wsParam.key, wsParam.value],
["sources.hide_add_folder", "true"],

@@ -39,7 +42,21 @@ ]);

}
return (
`${devServerUrl}/debugger-frontend/rn_inspector.html` +
"?" +
searchParams.toString()
);
return appUrl + "?" + searchParams.toString();
}
function getWsParam({ webSocketDebuggerUrl, devServerUrl }) {
const wsUrl = new URL(webSocketDebuggerUrl);
const serverHost = new URL(devServerUrl).host;
let value;
if (wsUrl.host === serverHost) {
// Use a path-absolute (host-relative) URL
// Depends on https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/4
value = wsUrl.pathname + wsUrl.search + wsUrl.hash;
} else {
// Standard URL format accepted by the DevTools frontend
value = wsUrl.host + wsUrl.pathname + wsUrl.search + wsUrl.hash;
}
const key = wsUrl.protocol.slice(0, -1);
return {
key,
value,
};
}
{
"name": "@react-native/dev-middleware",
"version": "0.75.0-nightly-20240225-12f2c3cd2",
"version": "0.75.0-nightly-20240226-fcabb2ad2",
"description": "Dev server middleware for React Native",

@@ -26,3 +26,3 @@ "keywords": [

"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "0.75.0-nightly-20240225-12f2c3cd2",
"@react-native/debugger-frontend": "0.75.0-nightly-20240226-fcabb2ad2",
"@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

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