{"action":"created","issue":{"url":"https://api.github.com/repos/HipsterBrown/espresso/issues/14","repository_url":"https://api.github.com/repos/HipsterBrown/espresso","labels_url":"https://api.github.com/repos/HipsterBrown/espresso/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/HipsterBrown/espresso/issues/14/comments","events_url":"https://api.github.com/repos/HipsterBrown/espresso/issues/14/events","html_url":"https://github.com/HipsterBrown/espresso/issues/14","id":156812781,"number":14,"title":"Bug - p node omitted in Espresso output","user":{"login":"loudhearted","id":2482212,"avatar_url":"https://avatars.githubusercontent.com/u/2482212?v=3","gravatar_id":"","url":"https://api.github.com/users/loudhearted","html_url":"https://github.com/loudhearted","followers_url":"https://api.github.com/users/loudhearted/followers","following_url":"https://api.github.com/users/loudhearted/following{/other_user}","gists_url":"https://api.github.com/users/loudhearted/gists{/gist_id}","starred_url":"https://api.github.com/users/loudhearted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loudhearted/subscriptions","organizations_url":"https://api.github.com/users/loudhearted/orgs","repos_url":"https://api.github.com/users/loudhearted/repos","events_url":"https://api.github.com/users/loudhearted/events{/privacy}","received_events_url":"https://api.github.com/users/loudhearted/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-25T17:58:28Z","updated_at":"2016-05-25T20:54:28Z","closed_at":null,"body":"This coffee input:\r\n```coffee\r\nrender: ->\r\n    D.div {}, [\r\n\r\n      D.div { className: 'change-request-form-head' },\r\n        D.h2 {}, 'Success!'\r\n        D.p {}, 'Your change request has been submitted.'\r\n\r\n      Actions(\r\n        extraClass: 'btn-container-actions'\r\n        buttonClass: 'btn with-arrow'\r\n        onClick: @submit\r\n        buttonLabel: 'Done'\r\n      )\r\n    ]\r\n```\r\nrenders to this (raw output):\r\n```js\r\nrender() {\r\n     return <div><div className='change-request-form-head'>{D.h2({}, 'Success!')}</div><Actions\r\n         extraClass='btn-container-actions'\r\n         buttonClass='btn with-arrow'\r\n         onClick={this.submit}\r\n         buttonLabel='Done' /></div>;\r\n }\r\n```\r\n\r\nSomehow the `p` node from the coffee file was lost when converting to es6. Do you think this is an Espresso bug, or something that may have happened with the React codemod instead?\r\n\r\nOutput was generated by: \r\n- `espresso app/assets/javascripts/ui/wizards/ --match .coffee --jsx`\r\n- `jscodeshift -t ../react-codemod/transforms/react-to-react-dom.js <your-path-to>/namely/app/assets/javascripts/`\r\n\r\n**Original coffee file:** https://github.com/namely/namely/blob/8826d7f58e46bc6b41cc31ffb3391675bb0f1a57/app/assets/javascripts/ui/workflows/requests/success.coffee\r\n\r\n**Raw espresso & jscodeshift output:** https://github.com/namely/namely/pull/5139/commits/0fc60bc7a6469e9316d25f3662db2e347340e786"},"comment":{"url":"https://api.github.com/repos/HipsterBrown/espresso/issues/comments/221704338","html_url":"https://github.com/HipsterBrown/espresso/issues/14#issuecomment-221704338","issue_url":"https://api.github.com/repos/HipsterBrown/espresso/issues/14","id":221704338,"user":{"login":"HipsterBrown","id":3051193,"avatar_url":"https://avatars.githubusercontent.com/u/3051193?v=3","gravatar_id":"","url":"https://api.github.com/users/HipsterBrown","html_url":"https://github.com/HipsterBrown","followers_url":"https://api.github.com/users/HipsterBrown/followers","following_url":"https://api.github.com/users/HipsterBrown/following{/other_user}","gists_url":"https://api.github.com/users/HipsterBrown/gists{/gist_id}","starred_url":"https://api.github.com/users/HipsterBrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HipsterBrown/subscriptions","organizations_url":"https://api.github.com/users/HipsterBrown/orgs","repos_url":"https://api.github.com/users/HipsterBrown/repos","events_url":"https://api.github.com/users/HipsterBrown/events{/privacy}","received_events_url":"https://api.github.com/users/HipsterBrown/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T20:54:28Z","updated_at":"2016-05-25T20:54:28Z","body":"@loudhearted So I found the problem area but it will take some time to fix. A quick fix on the content side (the source coffeescript) would be to wrap the children in an array:\r\n\r\n```coffeescript\r\nrender: ->\r\n    D.div {}, [\r\n\r\n      D.div { className: 'change-request-form-head' }, [\r\n        D.h2 {}, 'Success!'\r\n        D.p {}, 'Your change request has been submitted.'\r\n      ]\r\n\r\n      Actions(\r\n        extraClass: 'btn-container-actions'\r\n        buttonClass: 'btn with-arrow'\r\n        onClick: @submit\r\n        buttonLabel: 'Done'\r\n      )\r\n    ]\r\n```\r\n\r\nIn the current source, the child components are passed to `D.div` as multiple arguments, rather than an array of children (which is what `espresso` is parsing for). I should have a fix & release today or tomorrow. "}}
{"actor":{"display_login":"HipsterBrown"}}