Skip to content

Commit

Permalink
Support Hermes debugging for Expo SDK 48
Browse files Browse the repository at this point in the history
  • Loading branch information
EzioLi01 committed Mar 3, 2023
1 parent f8d9bc7 commit 9888ce2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -899,10 +899,21 @@
"android",
"ios",
"macos",
"windows"
"windows",
"exponent"
],
"description": "%reactNative.launch.direct.platform.description%"
},
"expoHostType": {
"type": "string",
"enum": [
"tunnel",
"lan",
"local"
],
"default": "lan",
"description": "%reactNative.launch.expoHostType.description%"
},
"useHermesEngine": {
"type": "boolean",
"description": "%reactNative.direct.attach.useHermesEngine.description%",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export class DebugConfigProvider extends BaseConfigProvider {
}
};
} else if (state.config.platform === PlatformType.Exponent) {
return () => this.configureExpoHostType(input, state.config);
return async () => {
await this.configureApplicationType(input, state.config);
await this.configureExpoHostType(input, state.config);
};
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const platformTypeDirectPickConfig: DebugConfigurationQuickPickItem[] = [

export const appTypePickConfig: DebugConfigurationQuickPickItem[] = [
{
label: "Application in direct mode",
label: "Application in direct mode(Hermes)",
type: DEBUG_TYPES.REACT_NATIVE_DIRECT,
},
{
Expand Down Expand Up @@ -139,6 +139,7 @@ export const DEBUG_CONFIGURATION_NAMES = {
RUN_ANDROID_HERMES_EXPERIMENTAL: "Run Android Hermes - Experimental",
RUN_IOS_HERMES_EXPERIMENTAL: "Run iOS Hermes - Experimental",
RUN_DIRECT_IOS_EXPERIMENTAL: "Run Direct iOS - Experimental",
DEBUG_IN_EXPONENT_HERMES_EXPERIMENTAL: "Debug in Hermes Exponent - Experimental",
};

export const debugConfigurations: Record<string, vscode.DebugConfiguration> = {
Expand Down Expand Up @@ -278,4 +279,11 @@ export const debugConfigurations: Record<string, vscode.DebugConfiguration> = {
useHermesEngine: false,
target: "device",
},
[DEBUG_CONFIGURATION_NAMES.DEBUG_IN_EXPONENT_HERMES_EXPERIMENTAL]: {
name: DEBUG_CONFIGURATION_NAMES.DEBUG_IN_EXPONENT_HERMES_EXPERIMENTAL,
cwd: "${workspaceFolder}",
type: DEBUG_TYPES.REACT_NATIVE_DIRECT,
request: "launch",
platform: PlatformType.Exponent,
},
};

0 comments on commit 9888ce2

Please sign in to comment.