-
Notifications
You must be signed in to change notification settings - Fork 47.8k
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][State Tooltip] Added a stack of of component owners #24589
Conversation
Hey! This is a great first draft of the PR. 😍 It's great to see that you have an end to end implementation of this working! A few comments/questions:
|
I love these ideas. Let me come back to you with something. |
a1323de
to
c7f9c4f
Compare
@lunaruan updated the video to show how it looks. There's plenty of room for small tweaks with the styling, and some of the UX (enabling / disabling built in components). |
@@ -69,6 +69,7 @@ module.exports = { | |||
new DefinePlugin({ | |||
__DEV__: true, | |||
__PROFILE__: false, | |||
__EXPERIMENTAL__: true, |
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.
This was causing failures when trying to build devtools-extension for local on Chrome.
b42f6db
to
cacbe0e
Compare
Should the stack be in the reverse order? So that you see the component itself at the top. |
Yayy! Glad you got the source working! 😊 One concern I have with this implementation is that you can only view the source when the fiber ID maps are accurate. These maps are only populated on render, which means that this implementation will only work if your'e profiling the active window and the fibers haven't been deleted from the map. Fibers are deleted from the map when they are removed from the fiber tree, and this is not an uncommon occurrence. We also support uploading traces to React DevTools if you want Chrome performance data on top of your React Timeline data. We are working with Chrome on a better integrate method, but until then, you can only get screenshots, Chrome flamegraph chats, performance marks, etc. if you profile first in chrome and then upload to the React Profiler. This implementation will also not work in this case, because the IDs will be associated with the wrong fiber (or not present at all) Going back up to my previous comment, I think jumping to source is a great idea if the source is available and it's possible to implement, but if it isn't, what do you think about storing the location instead of the parent ID and allowing for some sort of "go to editor" method instead? |
You now get some idea of the context of a component that causes a state change, with a sidebar listing the component's hierarchy. This additionally allows user to click on components to link to their source code. resolves facebook#24170
@lunaruan yea, sorry you did make this point earlier. I've still got that code lying around in the reflog. |
Closing this in favour of #24805 |
Summary
demo.mp4
Added a side panel that:
We can filter out built in components. Maybe as a follow up someone could add a checkbox that toggles this?
resolves #24170
How did you test this change?
Ran the change in the inline-devtools in the devtools-shell + as an extension in Chrome.