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

Fix for the issue #5189 #5209

Merged
merged 1 commit into from Oct 27, 2015

Conversation

Projects
None yet
4 participants
@antsmartian
Copy link
Contributor

commented Oct 19, 2015

@jimfb I have written logic for the issue mentioned over here:

#5189

Let me know my thought process is correct; If so I can go and write unit test case for the same.

Thanks for your help.

@@ -213,6 +221,10 @@ var ReactDefaultPerf = {
totalTime,
Array.prototype.slice.call(args, 1)
);

if (fnName === 'putListener') {
ReactDefaultPerf._prevEventListener = typeof isFunction;

This comment has been minimized.

Copy link
@jimfb

jimfb Oct 19, 2015

Contributor

I'm skeptical this would work. I think there is a single ReactDefaultPerf shared for all components; you are setting this field as a static field without regard to the current component.

@jimfb

This comment has been minimized.

Copy link
Contributor

commented Oct 19, 2015

@antoaravinth Looks like there is a failing unit test. Also, we should add a unit test that asserts the intended semantics.

@spicyj is probably the best person to review this PR, since he added the processing of event handlers to printDOM() in the first place.

@sophiebits

This comment has been minimized.

Copy link
Collaborator

commented Oct 19, 2015

I would just not instrument putListener/deleteListener at all.

@antsmartian

This comment has been minimized.

Copy link
Contributor Author

commented Oct 20, 2015

@jimfb: The moment we are going to ignore the "putListener" events, the test case should not count listener update as waste will be failing, which is expecting the other way around. So probably we need to change our test case and also add additional test cases for our new semantics. What say?

@spicyj Will do the same.

@sophiebits

This comment has been minimized.

Copy link
Collaborator

commented Oct 20, 2015

Yes, we can remove that test.

@facebook-github-bot

This comment has been minimized.

Copy link

commented Oct 20, 2015

@antoaravinth updated the pull request.

@facebook-github-bot

This comment has been minimized.

Copy link

commented Oct 20, 2015

@antoaravinth updated the pull request.

@antsmartian

This comment has been minimized.

Copy link
Contributor Author

commented Oct 20, 2015

@jimfb @spicyj Updated. Let me know if everything is fine.

@sophiebits

This comment has been minimized.

Copy link
Collaborator

commented Oct 20, 2015

Just remove the instrumentation from EventPluginHub entirely – we don't need it any more.

@sophiebits

This comment has been minimized.

Copy link
Collaborator

commented Oct 20, 2015

Sorry for the back and forth.

@sophiebits

This comment has been minimized.

Copy link
Collaborator

commented Oct 20, 2015

Can you reference #5189 in your new test case too? It would also be fine to combine them into one test, I think – but two is fine too if you prefer that.

@antsmartian

This comment has been minimized.

Copy link
Contributor Author

commented Oct 21, 2015

@spicyj No need to be sorry, thanks for your help on the PR.

Just removing the instrumentation lines :

ReactPerf.measureMethods(EventPluginHub, 'EventPluginHub' , {
   putListener : 'putListener',
   deleteListener : 'deleteListener'
});

from EventPluginHub means we no need to check in our ReactDefaultPerf's measure method whether the passed on fnName is putListener or deleteListener as now they aren't being monitored. Correct me if I'm wrong here.

But at the same time what about the line

else if ( moduleName === 'EventPluginHub' . . 

I guess we can even safely remove that. Because we removed our instrumentation, the above condition is useless there. Throw your thoughts on this.

@sophiebits

This comment has been minimized.

Copy link
Collaborator

commented Oct 21, 2015

@antoaravinth Yes, that's right – all that code can go away.

Fix for the issue #5189
Fix for lint issues

Added the test cases for the issue 5189

Removing empty space

Removing the Eventplugin instrumentation code

Removing unwanted white space
@facebook-github-bot

This comment has been minimized.

Copy link

commented Oct 27, 2015

@antoaravinth updated the pull request.

@antsmartian

This comment has been minimized.

Copy link
Contributor Author

commented Oct 27, 2015

@spicyj Done. I think the two test cases would be fine but you want me to add the referenced case (#5189) in our test case too? Anyways is fine with me.

sophiebits added a commit that referenced this pull request Oct 27, 2015

Merge pull request #5209 from antoaravinth/5189
Don't instrument listeners for ReactDefaultPerf

@sophiebits sophiebits merged commit 65b9ceb into facebook:master Oct 27, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sophiebits

This comment has been minimized.

Copy link
Collaborator

commented Oct 27, 2015

Thanks!

@renovate renovate bot referenced this pull request Feb 2, 2018

Open

Update dependency react to v0.14.9 #29

0 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.