-
Notifications
You must be signed in to change notification settings - Fork 47k
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
[DevTools] Rename NativeElement to HostInstance in the Bridge #30491
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c78b88c
Rename NativeNode to HostInstance in the RendererInterface
sebmarkbage ef3d256
Rename NativeElement to HostInstance in the Bridgd
sebmarkbage f7a0adb
Rename start/stopInspectingNative to InspectingHost in the Bridge
sebmarkbage b3508a7
Rename NativeElementsPanel to BuiltinElementsPanel
sebmarkbage e2dd54a
Clarify types when they're React Native vs HTMLElement
sebmarkbage 2eec856
Rename Native in legacy renderer
sebmarkbage 5cf264a
supportsNativeConsoleTasks -> supportsConsoleTasks
sebmarkbage 09068c3
Rename NativeElement terms to HostInstance in the frontend
sebmarkbage 18f44c6
Fiber renderer
sebmarkbage 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
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
I find it a bit confusing, because Host is essentially React DevTools backend, and this is HostInstance, which is not about React DevTools backend, but element instance.
Maybe something like
InstanceForHost
orElementInstanceForHost
?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.
Well I think of Host is the environment that the backend is running inside. E.g. the DOM. Not the backend itself.
It's also what we call this elsewhere in Fiber. It gets shortened into the name
Instance
inside the "Host Config" but the long name we refer it by is Host Instance. We could potentially rename it toHostInstance
even in the Configs and then it would have the same name everywhere.This name already shows up even in the DevTools interface too e.g. through the injected
findFiberByHostInstance
.Also, not all Elements in the React DevTools refer to anything that has a Host Instance. Only a subset of DevTools Elements are represented by a Host Instance. HostText/HostComponent/HostSingleton/HostHoistable.
I have a follow up draft PR where I'm introducing an Instance to back stuff for the DevTools specifically which I'm calling a
DevtoolsInstance
which is more 1:1 with the Elements tab instances.Although I think we should probably rename Element to Component in the Elements tab because in React an Element is what you return from JSX but a Component instance is the stateful thing you get as a result of rendering an Element.
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.
Unrelated but ReactComponentInfo started out as an idea of being more like an instance of a Server Component but it's not actually a stateful thing and I wonder if it shouldn't just be modeled as a ReactElement. It already has mostly the same fields. It should have props too. ReactElement is missing
env
but technically it should have it:react/packages/react-client/src/ReactFlightClient.js
Lines 699 to 703 in ec98d36
In this case DevTools would have to deal with React Elements too which makes the Element naming even more confusing.