Skip to content
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

Track source more generically in ReactComponentTreeDevtool #6765

Merged
merged 1 commit into from
May 14, 2016

Conversation

sophiebits
Copy link
Collaborator

Being able to get the source for your parent components seems useful, and ReactComponentTreeDevtool is best poised to be able to do that.

I'm also not sure it makes sense to have separate DOM-specific onMountDOMComponent and onUpdateDOMComponent events, so I removed them for now. Even if we want them, their timing seemed sort of arbitrary.

I also made it so DOM devtools can listen to non-DOM events too. Willing to change that if people think it's ugly though.

Reviewers: @gaearon

@@ -40,9 +41,11 @@ function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {

var ReactDOMDebugTool = {
addDevtool(devtool) {
ReactDebugTool.addDevtool(devtool);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to expose just one of them in the end?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured we would probably expose both – though maybe it makes more sense to only expose each platform-specific one. Open to other suggestions on how to set ReactDOMUnknownPropertyDevtool up so that we can listen to both kinds of events though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it makes more sense to only expose each platform-specific one

Let’s go with this assumption for now. In this case it makes sense to automatically setup forwarding.

Being able to get the source for your parent components seems useful, and ReactComponentTreeDevtool is best poised to be able to do that.

I'm also not sure it makes sense to have separate DOM-specific `onMountDOMComponent` and `onUpdateDOMComponent` events, so I removed them for now. Even if we want them, their timing seemed sort of arbitrary.

I also made it so DOM devtools can listen to non-DOM events too. Willing to change that if people think it's ugly though.
@ghost
Copy link

ghost commented May 14, 2016

@spicyj updated the pull request.

@sophiebits
Copy link
Collaborator Author

Now tracking element, and removed extra debugging code (moved to #6768).

@gaearon
Copy link
Collaborator

gaearon commented May 14, 2016

LGTM

@sophiebits sophiebits merged commit 03f4ba2 into facebook:master May 14, 2016
@zpao zpao modified the milestones: 15.1.0, 15.y.0 May 20, 2016
@troydemonbreun
Copy link
Contributor

Ugh, I guess I totally missed the boat on #6398, I think @gaearon tried to warn me about ReactComponentTreeDevtool landing around that time. :-)

@sophiebits
Copy link
Collaborator Author

@troydemonbreun No worries, your work was still helpful! Thanks for doing most of the work.

@troydemonbreun
Copy link
Contributor

@spicyj You are very generous.

@zpao zpao modified the milestones: 15.y.0, 15-next Jun 1, 2016
zpao pushed a commit to zpao/react that referenced this pull request Jun 8, 2016
…6765)

Being able to get the source for your parent components seems useful, and ReactComponentTreeDevtool is best poised to be able to do that.

I'm also not sure it makes sense to have separate DOM-specific `onMountDOMComponent` and `onUpdateDOMComponent` events, so I removed them for now. Even if we want them, their timing seemed sort of arbitrary.

I also made it so DOM devtools can listen to non-DOM events too. Willing to change that if people think it's ugly though.
(cherry picked from commit 03f4ba2)
zpao pushed a commit that referenced this pull request Jun 14, 2016
Being able to get the source for your parent components seems useful, and ReactComponentTreeDevtool is best poised to be able to do that.

I'm also not sure it makes sense to have separate DOM-specific `onMountDOMComponent` and `onUpdateDOMComponent` events, so I removed them for now. Even if we want them, their timing seemed sort of arbitrary.

I also made it so DOM devtools can listen to non-DOM events too. Willing to change that if people think it's ugly though.
(cherry picked from commit 03f4ba2)
@zpao zpao modified the milestones: 15-next, 15.2.0 Jun 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants