Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/cdp-proxy/CDPMessageHandlers/CDPAPINames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ export const CDP_API_NAMES = {
RUNTIME_CONSOLE_API_CALLED: "Runtime.consoleAPICalled",
EXECUTION_CONTEXT_CREATED: "Runtime.executionContextCreated",
CLOSE: "close",
DEBUGGER_SCRIPT_PARSED: "Debugger.scriptParsed",
DEBUGGER_SET_BREAKPOINT_BY_URL: "Debugger.setBreakpointByUrl",
};
10 changes: 10 additions & 0 deletions src/cdp-proxy/CDPMessageHandlers/hermesCDPMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ export class HermesCDPMessageHandler extends BaseCDPMessageHandler {
event = this.handleFunctionTypeResult(event);
}

// Handle unused console log in cdp event
if (
event.method === CDP_API_NAMES.RUNTIME_CONSOLE_API_CALLED &&
String(event.params.args[0].value).includes(
"You are using an unsupported debugging client",
)
) {
event.params.args[0].value = "";
}

return {
event,
sendBack,
Expand Down
24 changes: 11 additions & 13 deletions src/extension/commands/enableHermes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Licensed under the MIT license. See LICENSE file in the project root for details.

import * as assert from "assert";
import * as vscode from "vscode";
import * as path from "path";
import * as fs from "fs";
import * as vscode from "vscode";
import { ErrorHelper } from "../../common/error/errorHelper";
import { InternalErrorCode } from "../../common/error/internalErrorCode";
import { Command } from "./util/command";
import { FileSystem } from "../../common/node/fileSystem";
import { OutputChannelLogger } from "../log/OutputChannelLogger";
import { CommandExecutor } from "../../common/commandExecutor";
import { AppLauncher } from "../appLauncher";
import { Command } from "./util/command";

const logger = OutputChannelLogger.getMainChannel();

Expand Down Expand Up @@ -58,19 +58,17 @@ export class EnableHermes extends Command {
);
await this.nodeFileSystem.writeFile(podfilePath, updatedHermes);
await commandExecutor.spawn("pod", ["install"]);
} else {
if (rnMatches) {
let content = rnMatches[1];
const closing = rnMatches[2];
} else if (rnMatches) {
let content = rnMatches[1];
const closing = rnMatches[2];

if (!content.trim().endsWith(",")) {
content += ",";
}
content += `\n :hermes_enabled => ${isHermesEnabled}`;
const newData = podfileContent.replace(regex, content + closing);
await this.nodeFileSystem.writeFile(podfilePath, newData);
await commandExecutor.spawn("pod", ["install"]);
if (!content.trim().endsWith(",")) {
content += ",";
}
content += `\n :hermes_enabled => ${isHermesEnabled}`;
const newData = podfileContent.replace(regex, content + closing);
await this.nodeFileSystem.writeFile(podfilePath, newData);
await commandExecutor.spawn("pod", ["install"]);
}
}
if (type === "Android") {
Expand Down