Skip to content

Conversation

@oskosk
Copy link
Contributor

@oskosk oskosk commented Feb 17, 2018

Fixes all eslint warnings about the react/jsx-no-bind rule.

Changes proposed in this Pull Request:

  • Upgrades the react/jsx-no-bind rule to an error.
  • Refactors several components to drop .bind() and onEvent={ () => {} } patterns among jsx code.

Testing instructions:

  • Run npm run lint and expect to see no linting warnings.
  • Build the admin page and confirm it does it properly (yarn build).

Proposed changelog entry for your changes:

  • Removed bind patterns previously used in JSX for the Admin Page

@oskosk oskosk added [Status] In Progress Admin Page React-powered dashboard under the Jetpack menu [Type] Janitorial labels Feb 17, 2018
@oskosk oskosk requested review from a team and jeherve as code owners February 17, 2018 15:19
@oskosk
Copy link
Contributor Author

oskosk commented Feb 17, 2018

Note that this rule is trying to warn the problem that arises when functions are created on the fly while rendering. The current fixes remove the warnings by not binding inline and by not defining arrow functions among jsx, but in some cases we're still creating functions on the fly. Will try to update to no create functions where possible.

@oskosk oskosk force-pushed the remove/bind-pattern branch 2 times, most recently from 8dc870d to f97546c Compare February 17, 2018 17:22
@oskosk oskosk added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Feb 19, 2018
@oskosk
Copy link
Contributor Author

oskosk commented Feb 19, 2018

I've updated some commits to remove the wrong pattern where it made sense.

@oskosk oskosk force-pushed the remove/bind-pattern branch from f97546c to 1879604 Compare February 23, 2018 13:45
@oskosk oskosk added this to the 5.9 milestone Feb 23, 2018
@zinigor zinigor modified the milestones: 5.9, 6.0 Mar 6, 2018
@oskosk oskosk force-pushed the remove/bind-pattern branch from 1879604 to de03440 Compare March 8, 2018 12:29
@ghost ghost assigned oskosk Mar 8, 2018
@oskosk oskosk force-pushed the remove/bind-pattern branch from de03440 to 728e6ee Compare March 12, 2018 13:38
Copy link
Contributor

@dereksmart dereksmart left a comment

Choose a reason for hiding this comment

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

No problems from fresh build. Let's get this in

@dereksmart dereksmart added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Mar 13, 2018
@oskosk
Copy link
Contributor Author

oskosk commented Mar 13, 2018

Thank you!

@oskosk oskosk merged commit 0ac0284 into master Mar 13, 2018
@ghost ghost removed the [Status] Ready to Merge Go ahead, you can push that green button! label Mar 13, 2018
@oskosk oskosk deleted the remove/bind-pattern branch March 13, 2018 20:05
oskosk added a commit that referenced this pull request Mar 16, 2018
dereksmart pushed a commit that referenced this pull request Mar 27, 2018
* Changelog 6.0: create base for changelog.

* Add #8938 to changelog

* Add #8962 to changelog

* Add #8974 to changelog

* Add #8975 to changelog

* Add #8978 to changelog

* Add #8867 to changelog

* Add #8937 to changelog

* Add #8961 to changelog

* Add #8855 to changelog

* Add #8944 to changelog

* Add #8973 to changelog

* Add #8977 to changelog

* Add #8979 to changelog

* Add #8980 to changelog

* Add #8982 to changelog

* Add #8983 to changelog

* Add #8984 to changelog

* Add #8986 to changelog

* Add #9005 to changelog

* Add #9010 to changelog

* Add #9012 to changelog

* Add #9021 to changelog

* Add #9022 to changelog

* Add #9056 to changelog

* Add #9061 to changelog

* Add #9079 to changelog

* Add #9080 to changelog

* Add #9088 to changelog

* Add #9096 to changelog

* Add #9097 to changelog

* Add #9100 to changelog

* Add #9107 to changelog

* Add #8969 to changelog

* Add #8993 to changelog

* Add #9003 to changelog

* Add #9031 to changelog

* Add #8945 to changelog

* Add #9052 to changelog

* Add #9058 to changelog

* Add #9066 to changelog

* Add #9076 to changelog

* Add #9053 to changelog

* Add #9108 to changelog

* Add #9135 to changelog

* Add #9148 to changelog

* Add #9125 to changelog

* Add #9137 to changelog

* Added testing instructions for 6.0.

* Added IS testing instructions, huge props to @tiagonoronha.

* Added #8498 to changelog.

* Added #8954 to changelog.

* Added #8985 to changelog.

* add #9027

* add #9112 to changelog

* add #9136 to changelog

* add #9102 to changelog

* add #9093 to changelog

* add #9062 to changelog

* add #9172 to changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Page React-powered dashboard under the Jetpack menu [Type] Janitorial

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants