{"action":"created","issue":{"url":"https://api.github.com/repos/scalvert/ember-es6-class-codemod/issues/1","repository_url":"https://api.github.com/repos/scalvert/ember-es6-class-codemod","labels_url":"https://api.github.com/repos/scalvert/ember-es6-class-codemod/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/scalvert/ember-es6-class-codemod/issues/1/comments","events_url":"https://api.github.com/repos/scalvert/ember-es6-class-codemod/issues/1/events","html_url":"https://github.com/scalvert/ember-es6-class-codemod/issues/1","id":336432658,"node_id":"MDU6SXNzdWUzMzY0MzI2NTg=","number":1,"title":"Transforms","user":{"login":"pzuraq","id":685518,"node_id":"MDQ6VXNlcjY4NTUxOA==","avatar_url":"https://avatars3.githubusercontent.com/u/685518?v=4","gravatar_id":"","url":"https://api.github.com/users/pzuraq","html_url":"https://github.com/pzuraq","followers_url":"https://api.github.com/users/pzuraq/followers","following_url":"https://api.github.com/users/pzuraq/following{/other_user}","gists_url":"https://api.github.com/users/pzuraq/gists{/gist_id}","starred_url":"https://api.github.com/users/pzuraq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzuraq/subscriptions","organizations_url":"https://api.github.com/users/pzuraq/orgs","repos_url":"https://api.github.com/users/pzuraq/repos","events_url":"https://api.github.com/users/pzuraq/events{/privacy}","received_events_url":"https://api.github.com/users/pzuraq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2018-06-28T00:27:42Z","updated_at":"2018-08-09T18:45:47Z","closed_at":null,"author_association":"COLLABORATOR","body":"Opening this issue to start tracking the various inputs and outputs of this transform. I think the list I have here is pretty comprehensive so far, let me know if you know any other edge cases or features.\r\n\r\n### Base\r\n\r\n```js\r\n// Input\r\nconst Foo = EmberObject.extend({\r\n  prop: 'defaultValue',\r\n  \r\n  method() {\r\n    // do things\r\n  },\r\n\r\n  otherMethod: function() {\r\n\r\n  },\r\n\r\n  get accessor() {\r\n    return this._value;\r\n  },\r\n\r\n  set accessor(value) {\r\n    this._value = value;\r\n  },\r\n});\r\n\r\n// Output\r\nclass Foo extends EmberObject {\r\n  prop = 'defaultValue';\r\n\r\n  method() {\r\n    // do things\r\n  }\r\n\r\n  otherMethod() {\r\n\r\n  }\r\n\r\n  get accessor() {\r\n    return this._value;\r\n  }\r\n\r\n  set accessor(value) {\r\n    this._value = value;\r\n  }\r\n}\r\n\r\n\r\n// Input\r\nconst Foo = EmberObject.extend(MyMixin, {\r\n  // ...\r\n});\r\n\r\n// Output\r\nclass Foo extends EmberObject.extend(MyMixin) {\r\n  // ...\r\n}\r\n\r\n\r\n// Throws error\r\nconst Foo = EmberObject.extend({\r\n  boundMethod: () => {} // This is likely a bug, it would bind to module context\r\n});\r\n```\r\n\r\n### Stage 1\r\n\r\n```js\r\n// Throws error\r\nconst Foo = EmberObject.extend({\r\n  computed: computed({\r\n    get() {},\r\n    set() {},\r\n  })\r\n});\r\n\r\n// Throws error\r\nconst Foo = EmberObject.extend({\r\n  statefulObject: {},\r\n  statefulArray: [],\r\n});\r\n\r\n// Throws error\r\nconst Foo = Component.extend({\r\n  tagName: 'div',\r\n});\r\n\r\n// Throws error\r\nconst Foo = Component.extend({\r\n  classNames: [],\r\n});\r\n\r\n// Throws error\r\nconst Foo = Component.extend({\r\n  classNameBindings: ['foo'],\r\n  foo: 'val',\r\n});\r\n\r\n// Throws error\r\nconst Foo = Component.extend({\r\n  attributeBindings: ['foo'],\r\n  foo: 'val',\r\n});\r\n\r\n// Throws error\r\nconst Foo = EmberObject.extend({\r\n  actions: {\r\n    bar() {}\r\n  },\r\n});\r\n\r\n// Throws error\r\nconst Foo = EmberObject.extend({\r\n  observer: observer(...)\r\n});\r\n\r\n// Throws error\r\nconst Foo = EmberObject.extend({\r\n  event: on(...)\r\n});\r\n\r\n// Throws error\r\nconst Foo = EmberObject.extend({\r\n  event: service(...)\r\n});\r\n\r\n// Throws error\r\nconst Foo = Controller.extend({\r\n  event: controller(...)\r\n});\r\n\r\n// Shows dialog\r\n// a. primitive value\r\n// b. stateful object\r\n// c. computed\r\n// d. observer\r\n// e. eventhandler\r\n// Throws error if not a primitive value\r\nconst Foo = EmberObject.extend({\r\n  macroValue: macro()\r\n});\r\n```\r\n\r\n### Stage 2\r\n\r\n```js\r\n// Input\r\nconst Foo = EmberObject.extend({\r\n  computed: computed({\r\n    get() {},\r\n    set() {},\r\n  })\r\n});\r\n\r\n// Output\r\nclass Foo extends EmberObject {\r\n  @computed\r\n  get computed() {}\r\n\r\n  set computed() {}\r\n}\r\n\r\n\r\n// Throws error\r\nconst Foo = EmberObject.extend({\r\n  statefulObject: {},\r\n  statefulArray: [],\r\n});\r\n\r\n\r\n// Input \r\nconst Foo = Component.extend({\r\n  tagName: 'div',\r\n});\r\n\r\n// Output\r\n@tagName('div')\r\nclass Foo extends Component {}\r\n\r\n\r\n// Input\r\nconst Foo = Component.extend({\r\n  classNames: ['foo'],\r\n});\r\n\r\n// Output\r\n@classNames('foo')\r\nclass Foo extends Component {\r\n}\r\n\r\n\r\n// Input\r\nconst Foo = Component.extend({\r\n  classNameBindings: ['foo'],\r\n  foo: 'val',\r\n});\r\n\r\n// Output\r\nclass Foo extends Component {\r\n  @className foo = 'val';\r\n}\r\n\r\n\r\n// Input\r\nconst Foo = Component.extend({\r\n  attributeBindings: ['foo'],\r\n  foo: 'val',\r\n});\r\n\r\n// Output\r\nclass Foo extends Component {\r\n  @attribute foo = 'val';\r\n}\r\n\r\n\r\n// Input\r\nconst Foo = EmberObject.extend({\r\n  actions: {\r\n    bar() {}\r\n  },\r\n});\r\n\r\n// Output\r\nclass Foo extends EmberObject {\r\n  @action\r\n  bar() {}\r\n}\r\n\r\n\r\n// Input\r\nconst Foo = EmberObject.extend({\r\n  observer: observer(...)\r\n});\r\n\r\n// Output (throws warning about @off)\r\nclass Foo extends EmberObject {\r\n  @observes(...)\r\n  observer() {}\r\n}\r\n\r\n// Input\r\nconst Foo = EmberObject.extend({\r\n  event: on(...)\r\n});\r\n\r\n// Output (throws warning about @off)\r\nclass Foo extends EmberObject {\r\n  @on(...)\r\n  event() {}\r\n}\r\n\r\n// Input\r\nconst Foo = EmberObject.extend({\r\n  myService: service(...)\r\n});\r\n\r\n// Output\r\nclass Foo extends EmberObject {\r\n  @service(...) myService;\r\n}\r\n\r\n\r\n// Input\r\nconst Foo = Controller.extend({\r\n  myController: controller(...)\r\n});\r\n\r\n// Output\r\nclass Foo extends Controller {\r\n  @controller(...) myController;\r\n}\r\n\r\n\r\n// Shows dialog\r\n// a. primitive value\r\n// b. stateful object\r\n// c. computed\r\n// d. observer\r\n// e. eventhandler\r\n// Follows behavior based on user input\r\nconst Foo = EmberObject.extend({\r\n  macroValue: macro()\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/scalvert/ember-es6-class-codemod/issues/comments/411858026","html_url":"https://github.com/scalvert/ember-es6-class-codemod/issues/1#issuecomment-411858026","issue_url":"https://api.github.com/repos/scalvert/ember-es6-class-codemod/issues/1","id":411858026,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTg1ODAyNg==","user":{"login":"ssutar","id":3048945,"node_id":"MDQ6VXNlcjMwNDg5NDU=","avatar_url":"https://avatars2.githubusercontent.com/u/3048945?v=4","gravatar_id":"","url":"https://api.github.com/users/ssutar","html_url":"https://github.com/ssutar","followers_url":"https://api.github.com/users/ssutar/followers","following_url":"https://api.github.com/users/ssutar/following{/other_user}","gists_url":"https://api.github.com/users/ssutar/gists{/gist_id}","starred_url":"https://api.github.com/users/ssutar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssutar/subscriptions","organizations_url":"https://api.github.com/users/ssutar/orgs","repos_url":"https://api.github.com/users/ssutar/repos","events_url":"https://api.github.com/users/ssutar/events{/privacy}","received_events_url":"https://api.github.com/users/ssutar/received_events","type":"User","site_admin":false},"created_at":"2018-08-09T18:45:47Z","updated_at":"2018-08-09T18:45:47Z","author_association":"NONE","body":"What are the module names from which the decorators should be imported? Are those under `@ember-decorators/` or they will be under `@ember` itself? \r\n\r\nAlso looking from the examples in the `@ember-decorators` - Is it possible to have multiple decorators for a single property? The latest PR does not handle that case, but it should be fairly easy to modify"}}
{"actor":{"display_login":"ssutar"}}