{"action":"created","issue":{"url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/504","repository_url":"https://api.github.com/repos/mxenabled/mx-react-components","labels_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/504/labels{/name}","comments_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/504/comments","events_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/504/events","html_url":"https://github.com/mxenabled/mx-react-components/pull/504","id":203932832,"number":504,"title":"Luke/code mod exploration","user":{"login":"lukeschunk","id":13579578,"avatar_url":"https://avatars.githubusercontent.com/u/13579578?v=3","gravatar_id":"","url":"https://api.github.com/users/lukeschunk","html_url":"https://github.com/lukeschunk","followers_url":"https://api.github.com/users/lukeschunk/followers","following_url":"https://api.github.com/users/lukeschunk/following{/other_user}","gists_url":"https://api.github.com/users/lukeschunk/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeschunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeschunk/subscriptions","organizations_url":"https://api.github.com/users/lukeschunk/orgs","repos_url":"https://api.github.com/users/lukeschunk/repos","events_url":"https://api.github.com/users/lukeschunk/events{/privacy}","received_events_url":"https://api.github.com/users/lukeschunk/received_events","type":"User","site_admin":false},"labels":[{"id":362115800,"url":"https://api.github.com/repos/mxenabled/mx-react-components/labels/Needs%20Review","name":"Needs Review","color":"EF7625","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-30T05:56:16Z","updated_at":"2017-01-30T22:55:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mxenabled/mx-react-components/pulls/504","html_url":"https://github.com/mxenabled/mx-react-components/pull/504","diff_url":"https://github.com/mxenabled/mx-react-components/pull/504.diff","patch_url":"https://github.com/mxenabled/mx-react-components/pull/504.patch"},"body":"I used a [react code-mod](https://github.com/reactjs/react-codemod) (specifically the class-transform script) to convert our `createClass` to ES6 classes. \r\n\r\nThe way the script changes the code means I also had to add the babel `stage-0` preset and the `transform-class-properties` which allows us to use the static class properties. \r\n\r\nI think ES6 class components is something we should adopt, and the codemod is a good way to do it. That said, I'm still doing testing and research around this to make sure it's 👌 \r\n\r\n![giphy-29](https://cloud.githubusercontent.com/assets/13579578/22408901/359934c2-e63e-11e6-8230-a59c7f1990ba.gif)\r\n\r\n\r\n### Benefits \r\n* [facebook suggests](https://facebook.github.io/react/blog/2015/03/10/react-v0.13.html) the eventual removal of createClass in favor of ES6 classes\r\n* because of this we can use current and future features of react \r\n* more vanilla JS and less library-specific 'magic'\r\n* This could help us move towards purer components\r\n\r\n### Possible trickiness \r\n* Functions aren't bound to `this` like they were before, from an article I read: \r\n> With createClass, it’s easy: every property that’s a function is automatically bound by React. Refer to them as this.whateverFn wherever you need to, and this will be set correctly whenever they’re called.\r\n\r\n>With ES6 class, it’s trickier: functions are not autobound. \r\n\r\nthis change will mean thinking about things a little differently as/if we move forward. \r\n* The static class properties are really new to me and i'm still wrapping my head around them - not sure if others feel the same way "},"comment":{"url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/comments/276218731","html_url":"https://github.com/mxenabled/mx-react-components/pull/504#issuecomment-276218731","issue_url":"https://api.github.com/repos/mxenabled/mx-react-components/issues/504","id":276218731,"user":{"login":"paniclater","id":1081167,"avatar_url":"https://avatars.githubusercontent.com/u/1081167?v=3","gravatar_id":"","url":"https://api.github.com/users/paniclater","html_url":"https://github.com/paniclater","followers_url":"https://api.github.com/users/paniclater/followers","following_url":"https://api.github.com/users/paniclater/following{/other_user}","gists_url":"https://api.github.com/users/paniclater/gists{/gist_id}","starred_url":"https://api.github.com/users/paniclater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paniclater/subscriptions","organizations_url":"https://api.github.com/users/paniclater/orgs","repos_url":"https://api.github.com/users/paniclater/repos","events_url":"https://api.github.com/users/paniclater/events{/privacy}","received_events_url":"https://api.github.com/users/paniclater/received_events","type":"User","site_admin":false},"created_at":"2017-01-30T22:55:32Z","updated_at":"2017-01-30T22:55:32Z","body":"Looks like docs bundle got updated as well, not sure if that was by intention or not?"}}
{"actor":{"display_login":"paniclater"}}