{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-codemod/issues/54","repository_url":"https://api.github.com/repos/reactjs/react-codemod","labels_url":"https://api.github.com/repos/reactjs/react-codemod/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-codemod/issues/54/comments","events_url":"https://api.github.com/repos/reactjs/react-codemod/issues/54/events","html_url":"https://github.com/reactjs/react-codemod/pull/54","id":160066472,"number":54,"title":"WIP: Class transform with property initializer","user":{"login":"keyanzhang","id":2268452,"avatar_url":"https://avatars.githubusercontent.com/u/2268452?v=3","gravatar_id":"","url":"https://api.github.com/users/keyanzhang","html_url":"https://github.com/keyanzhang","followers_url":"https://api.github.com/users/keyanzhang/followers","following_url":"https://api.github.com/users/keyanzhang/following{/other_user}","gists_url":"https://api.github.com/users/keyanzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/keyanzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keyanzhang/subscriptions","organizations_url":"https://api.github.com/users/keyanzhang/orgs","repos_url":"https://api.github.com/users/keyanzhang/repos","events_url":"https://api.github.com/users/keyanzhang/events{/privacy}","received_events_url":"https://api.github.com/users/keyanzhang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2016-06-13T23:25:21Z","updated_at":"2016-06-21T22:58:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/reactjs/react-codemod/pulls/54","html_url":"https://github.com/reactjs/react-codemod/pull/54","diff_url":"https://github.com/reactjs/react-codemod/pull/54.diff","patch_url":"https://github.com/reactjs/react-codemod/pull/54.patch"},"body":"~~I added a new codemod file (`property-initializer.js`) but I wasn't sure if it'd be better to overwrite the existing `class` one instead -- feel free to let me know if you want me to change it. I think the diff would be easier to read in that case.~~\r\n\r\nA few steps left:\r\n- [x] no `--no-super-class` option\r\n  - [x] Fix readme\r\n- [x] Support `react-addons-pure-render-mixin`\r\n- [x] Fix flow annotations (the return type of arrow functions is missing for now)\r\n  - See benjamn/recast#289\r\n- [x] Remove `var ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin')` when transformation happens\r\n  - [x] Check the scope before removing it (for cases where there are multiple components in a single file)\r\n\r\nUpdate: discussed with @spicyj in person and here are the changes/required steps to finish before shipping this:\r\n- [ ] Transform `propTypes` to Flow annotations (`props: ...`)\r\n  - We want to keep both propTypes and flow annotations so we only makes it stricter\r\n  - also transforms properties like `count: (12: number),` to `count: number = 12;`\r\n- [x] Support primitives as properties\r\n- [x] Do not sort properties/methods so that the diff stays clean\r\n- [x] Transform every method except lifecycle methods to arrow functions to make sure we don't break anything\r\n  - [ ] Introduce a lint rule after this to prevent from over-binding\r\n- [x] Drop `context` and/or `props` in `constructor(props, context)` whenever possible\r\n- [ ] Add and fix `no-use-before-define` linter rule"},"comment":{"url":"https://api.github.com/repos/reactjs/react-codemod/issues/comments/227597210","html_url":"https://github.com/reactjs/react-codemod/pull/54#issuecomment-227597210","issue_url":"https://api.github.com/repos/reactjs/react-codemod/issues/54","id":227597210,"user":{"login":"spicyj","id":6820,"avatar_url":"https://avatars.githubusercontent.com/u/6820?v=3","gravatar_id":"","url":"https://api.github.com/users/spicyj","html_url":"https://github.com/spicyj","followers_url":"https://api.github.com/users/spicyj/followers","following_url":"https://api.github.com/users/spicyj/following{/other_user}","gists_url":"https://api.github.com/users/spicyj/gists{/gist_id}","starred_url":"https://api.github.com/users/spicyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spicyj/subscriptions","organizations_url":"https://api.github.com/users/spicyj/orgs","repos_url":"https://api.github.com/users/spicyj/repos","events_url":"https://api.github.com/users/spicyj/events{/privacy}","received_events_url":"https://api.github.com/users/spicyj/received_events","type":"User","site_admin":false},"created_at":"2016-06-21T22:58:14Z","updated_at":"2016-06-21T22:58:14Z","body":"Yeah, I'm fine with writing super(props); whenever we're a little unsure or even just for all components regardless."}}
{"actor":{"display_login":"spicyj"}}