[DevTools] Remove experimental __IS_INTERNAL_MCP_BUILD__ flag and related code#498
[DevTools] Remove experimental __IS_INTERNAL_MCP_BUILD__ flag and related code#498everettbu wants to merge 1 commit into
Conversation
…ated code Remove the unused internal MCP build flag infrastructure that was added for experimental MCP integration. This removes the flag declaration, build configuration, and the __internal_only_getComponentTree function from the DevTools renderer.
Greptile OverviewGreptile SummaryThis PR removes the experimental Most changes are straightforward cleanup, but removing the renderer interface method appears to break the MCP server tool under Confidence Score: 2/5
Important Files Changed
|
| return unresolvedSource; | ||
| } | ||
|
|
There was a problem hiding this comment.
Breaks MCP component tree tool
This PR removes the __internal_only_getComponentTree function from the renderer interface (it used to be conditionally injected behind __IS_INTERNAL_MCP_BUILD__). However compiler/packages/react-mcp-server/src/tools/componentTree.ts still calls .get(1).__internal_only_getComponentTree(), so this will now throw at runtime (method is undefined). Either update/remove the MCP server tool, or keep exposing a supported API for extracting the component tree.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/react-devtools-shared/src/backend/fiber/renderer.js
Line: 8817:8819
Comment:
**Breaks MCP component tree tool**
This PR removes the `__internal_only_getComponentTree` function from the renderer interface (it used to be conditionally injected behind `__IS_INTERNAL_MCP_BUILD__`). However `compiler/packages/react-mcp-server/src/tools/componentTree.ts` still calls `.get(1).__internal_only_getComponentTree()`, so this will now throw at runtime (method is `undefined`). Either update/remove the MCP server tool, or keep exposing a supported API for extracting the component tree.
How can I resolve this? If you propose a fix, please make it concise.|
Upstream PR was closed or merged. Code is synced via branch mirror. |
Mirror of facebook/react#35755
Original author: hoxyq
This is unused.