-
Notifications
You must be signed in to change notification settings - Fork 49.9k
[mcp] Add MCP tool to print out the component tree of the currently open React App #33305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
0e5c79c
Bruteforcing react devtools
jorge-cab 8fa3dfc
Smarter Devtools integration
jorge-cab a75932b
Port relevant logic from react devtools
jorge-cab 76dddd1
Port complete
jorge-cab 94718f1
Add component tree function to devtools and finish adding componentTr…
jorge-cab 2852c9d
Merge remote-tracking branch 'origin/main' into component-tree-tool
jorge-cab 26315d6
Cleanup React Devtools port attempt
jorge-cab d6d929e
More cleanup
jorge-cab 789e5f0
fix url redefinition
jorge-cab a85b0b0
Error handling
jorge-cab 049bfbb
Add IS_INTERNAL build time flag and gate getComponentTree()
jorge-cab c5ab27a
Add IS_INTERNAL build time flag and gate getComponentTree()
jorge-cab 1e4614b
Add IS_INTERNAL flag to eslintrc
jorge-cab ab86a5e
Address comments
jorge-cab 81c3a53
Error handling
jorge-cab 183bd4f
Fix CI
jorge-cab 9cae1ce
Remove getComponentTree() definition gating
jorge-cab 9275c83
Fix naming on react-devtools.js
jorge-cab 6c71a77
Fix tests
jorge-cab df0a663
Remove unused code
jorge-cab a586117
Gate __internal_only_getComponentTree definition
jorge-cab ecb1861
Fix lints
jorge-cab ca1d5e0
Fix flow
jorge-cab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add IS_INTERNAL build time flag and gate getComponentTree()
- Loading branch information
commit 049bfbb169ab9d61b36c12a68b778d582d45e071
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -33,6 +33,8 @@ const IS_FIREFOX = process.env.IS_FIREFOX === 'true'; | |||||
| const IS_EDGE = process.env.IS_EDGE === 'true'; | ||||||
| const IS_INTERNAL_VERSION = process.env.FEATURE_FLAG_TARGET === 'extension-fb'; | ||||||
|
|
||||||
| const IS_INTERNAL = process.env.IS_INTERNAL === 'true'; | ||||||
|
|
||||||
| const featureFlagTarget = process.env.FEATURE_FLAG_TARGET || 'extension-oss'; | ||||||
|
|
||||||
| const babelOptions = { | ||||||
|
|
@@ -113,6 +115,7 @@ module.exports = { | |||||
| __IS_FIREFOX__: IS_FIREFOX, | ||||||
| __IS_EDGE__: IS_EDGE, | ||||||
| __IS_NATIVE__: false, | ||||||
| __IS_INTERNAL__: IS_INTERNAL, | ||||||
|
||||||
| __IS_INTERNAL__: IS_INTERNAL, | |
| __IS_INTERNAL_MCP_BUILD__: IS_INTERNAL_MCP_BUILD, |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your comment here, this should be correct, yeah. Because
installHookentrypoint, which importsfiber/renderer.jsis listed inwebpack.config.js.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix failing jobs on CI, please add
__IS_INTERNAL_MCP_BUILD__: falseto other build scripts, where applicable. You can check where__IS_CHROME__: falseis defined, for example.