{"action":"created","issue":{"url":"https://api.github.com/repos/brigade/react-waypoint/issues/246","repository_url":"https://api.github.com/repos/brigade/react-waypoint","labels_url":"https://api.github.com/repos/brigade/react-waypoint/issues/246/labels{/name}","comments_url":"https://api.github.com/repos/brigade/react-waypoint/issues/246/comments","events_url":"https://api.github.com/repos/brigade/react-waypoint/issues/246/events","html_url":"https://github.com/brigade/react-waypoint/issues/246","id":302598863,"number":246,"title":"Can't use v8 in Jest unit tests","user":{"login":"screendriver","id":149248,"avatar_url":"https://avatars0.githubusercontent.com/u/149248?v=4","gravatar_id":"","url":"https://api.github.com/users/screendriver","html_url":"https://github.com/screendriver","followers_url":"https://api.github.com/users/screendriver/followers","following_url":"https://api.github.com/users/screendriver/following{/other_user}","gists_url":"https://api.github.com/users/screendriver/gists{/gist_id}","starred_url":"https://api.github.com/users/screendriver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screendriver/subscriptions","organizations_url":"https://api.github.com/users/screendriver/orgs","repos_url":"https://api.github.com/users/screendriver/repos","events_url":"https://api.github.com/users/screendriver/events{/privacy}","received_events_url":"https://api.github.com/users/screendriver/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-06T07:59:56Z","updated_at":"2018-03-06T16:25:03Z","closed_at":null,"author_association":"NONE","body":"I am using TypeScript, Jest and Webpack in my project. I upgraded to v8 and now I can't use `react-waypoint` in my unit tests anymore.\r\n\r\nWith v7 I imported this library with\r\n\r\n```ts\r\nimport * as Waypoint from 'react-waypoint';\r\n```\r\n\r\nNow with v8 I have to import it like\r\n\r\n```ts\r\nimport Waypoint from 'react-waypoint';\r\n```\r\n\r\nWith that default import it runs with TypeScript and Webpack as expected but not in my unit tests that run with Jest. If I change the import to the v7 `import * as Waypoint` syntax TypeScript and Webpack fails, but Jest runs fine.\r\n\r\nI believe it has something to do how this library is exported in the package because in Jest I transpile everything to CommonJS (because Node only understands CommonJS) but then there is a `.default` import which doesn't exist. In Webpack I transpile everything to ESM import syntax and TypeScript take the default export and Webpack can handle that.\r\n\r\nMy Workaround at the moment is to use v7 instead of v8 because there everything works out of the box.\r\n\r\nMaybe this is related to #238? 🤔 "},"comment":{"url":"https://api.github.com/repos/brigade/react-waypoint/issues/comments/370839341","html_url":"https://github.com/brigade/react-waypoint/issues/246#issuecomment-370839341","issue_url":"https://api.github.com/repos/brigade/react-waypoint/issues/246","id":370839341,"user":{"login":"screendriver","id":149248,"avatar_url":"https://avatars0.githubusercontent.com/u/149248?v=4","gravatar_id":"","url":"https://api.github.com/users/screendriver","html_url":"https://github.com/screendriver","followers_url":"https://api.github.com/users/screendriver/followers","following_url":"https://api.github.com/users/screendriver/following{/other_user}","gists_url":"https://api.github.com/users/screendriver/gists{/gist_id}","starred_url":"https://api.github.com/users/screendriver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screendriver/subscriptions","organizations_url":"https://api.github.com/users/screendriver/orgs","repos_url":"https://api.github.com/users/screendriver/repos","events_url":"https://api.github.com/users/screendriver/events{/privacy}","received_events_url":"https://api.github.com/users/screendriver/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T16:25:03Z","updated_at":"2018-03-06T16:25:03Z","author_association":"NONE","body":"Default exports are doomed :wink: In our project default exports are forbidden because of different reasons 😊\r\n\r\nWould it be a good idea to change your exports to named exports and get rid of default exports completely? "}}
{"actor":{"display_login":"screendriver"}}