Support modern React Native inspector#257
Merged
Merged
Conversation
Saadnajmi
approved these changes
Nov 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces support for the modern React Native inspector (CDP-based debugger) to the
hermes-windowsproject. It adds a new C-based API to enable an ABI-stable implementation for the new inspector.The PR is built on top of the code that was originally created by @iamAbhi-916.
Changes:
New C-based Inspector API (
hermes_api.h,hermes_api.cpp)hermes_inspector_vtablestruct, which is retrieved using the newhermes_get_inspector_vtablefunction.create_cdp_debug_api).add_console_message). To pass console arguments from the client, this function retrieves them from a temporary property on the JavaScript global object, which is then immediately cleared.create_cdp_agent), handling commands (cdp_agent_handle_command), and enabling runtime and debugger domains.enable_sampling_profiler), disabling (disable_sampling_profiler), and collecting profiling data (collect_sampling_profile) with detailed callbacks for samples and stack frames.Debugger Client Switching (
InspectorProxy.cpp)hermes.dllto support both the legacy and modern debugger clients, a new global variableg_isOldInspectorInitializedhas been added.RuntimeWrapperconstructor to determine whether to initialize the legacy inspector, ensuring that only one inspector is active at a time.Code Refinements
HermesApi.cpp: Resolved a non-standard layout warning related to the use ofoffsetofand applied code formatting for improved readability.NodeApiJsiRuntime.cpp: Fixed a compiler issue. This change is noted to be temporary and should be moved to thenode-api-jsirepository.Microsoft Reviewers: Open in CodeFlow