{"action":"created","issue":{"url":"https://api.github.com/repos/jridgewell/babel-plugin-incremental-dom/issues/69","repository_url":"https://api.github.com/repos/jridgewell/babel-plugin-incremental-dom","labels_url":"https://api.github.com/repos/jridgewell/babel-plugin-incremental-dom/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/jridgewell/babel-plugin-incremental-dom/issues/69/comments","events_url":"https://api.github.com/repos/jridgewell/babel-plugin-incremental-dom/issues/69/events","html_url":"https://github.com/jridgewell/babel-plugin-incremental-dom/issues/69","id":190488687,"number":69,"title":"different results with return","user":{"login":"edoardocavazza","id":3907295,"avatar_url":"https://avatars.githubusercontent.com/u/3907295?v=3","gravatar_id":"","url":"https://api.github.com/users/edoardocavazza","html_url":"https://github.com/edoardocavazza","followers_url":"https://api.github.com/users/edoardocavazza/followers","following_url":"https://api.github.com/users/edoardocavazza/following{/other_user}","gists_url":"https://api.github.com/users/edoardocavazza/gists{/gist_id}","starred_url":"https://api.github.com/users/edoardocavazza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edoardocavazza/subscriptions","organizations_url":"https://api.github.com/users/edoardocavazza/orgs","repos_url":"https://api.github.com/users/edoardocavazza/repos","events_url":"https://api.github.com/users/edoardocavazza/events{/privacy}","received_events_url":"https://api.github.com/users/edoardocavazza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-19T10:15:19Z","updated_at":"2016-11-23T23:30:25Z","closed_at":null,"body":"Hi,\r\n\r\nI am playing with your plugin and it works very nicely, so a big thank you for your work.\r\n\r\nI am reporting a case which generates a little confusion, at least in my mind :)\r\n\r\nIf I define a getter with JSX:\r\n```js\r\nget template() {\r\n    <span>Hello</span>;\r\n}\r\n```\r\nit becomes:\r\n```js\r\nget template() {\r\n    _jsxWrapper(...);\r\n}\r\n```\r\nbut if I put a return, it changes completly:\r\n```\r\nget template() {\r\n    return <span>Hello</span>;\r\n}\r\n```\r\nit becomes:\r\n```\r\nget template() {\r\n    elementOpen('span');\r\n    text('Hello');\r\n    return elementClose('span');\r\n}\r\n```\r\n\r\nIn the first case, the template getter returns `undefined` and IDOM helpers are not triggered, while in the second it returns the result of `elementClose`, so helpers are triggered.\r\n\r\nIs there a way to always return the `jsxWrapper` result?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/jridgewell/babel-plugin-incremental-dom/issues/comments/262655185","html_url":"https://github.com/jridgewell/babel-plugin-incremental-dom/issues/69#issuecomment-262655185","issue_url":"https://api.github.com/repos/jridgewell/babel-plugin-incremental-dom/issues/69","id":262655185,"user":{"login":"jridgewell","id":112982,"avatar_url":"https://avatars.githubusercontent.com/u/112982?v=3","gravatar_id":"","url":"https://api.github.com/users/jridgewell","html_url":"https://github.com/jridgewell","followers_url":"https://api.github.com/users/jridgewell/followers","following_url":"https://api.github.com/users/jridgewell/following{/other_user}","gists_url":"https://api.github.com/users/jridgewell/gists{/gist_id}","starred_url":"https://api.github.com/users/jridgewell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jridgewell/subscriptions","organizations_url":"https://api.github.com/users/jridgewell/orgs","repos_url":"https://api.github.com/users/jridgewell/repos","events_url":"https://api.github.com/users/jridgewell/events{/privacy}","received_events_url":"https://api.github.com/users/jridgewell/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T23:30:25Z","updated_at":"2016-11-23T23:30:25Z","body":"How are you calling the function returned from template? Or, if you want a function that you can control yourself, why don't you return a function?\r\n\r\n```js\r\nget template() {\r\n  return function() {\r\n    return <span>Hello</span>;\r\n  }\r\n}\r\n```\r\n\r\nThis is definitely not the common case, though it may be something we need to add support for. What I expect (and what the transform follows) is:\r\n\r\n```js\r\nclass Component {\r\n  //...\r\n\r\n  template() {\r\n  }\r\n\r\n  render() {\r\n    iDOM.patch(this.element, this.template, this.data);\r\n  }\r\n}"}}
{"actor":{"display_login":"jridgewell"}}