{"action":"created","issue":{"url":"https://api.github.com/repos/alexreardon/memoize-one/issues/37","repository_url":"https://api.github.com/repos/alexreardon/memoize-one","labels_url":"https://api.github.com/repos/alexreardon/memoize-one/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/alexreardon/memoize-one/issues/37/comments","events_url":"https://api.github.com/repos/alexreardon/memoize-one/issues/37/events","html_url":"https://github.com/alexreardon/memoize-one/issues/37","id":368336868,"node_id":"MDU6SXNzdWUzNjgzMzY4Njg=","number":37,"title":"Not working for typescript","user":{"login":"theKashey","id":582410,"node_id":"MDQ6VXNlcjU4MjQxMA==","avatar_url":"https://avatars0.githubusercontent.com/u/582410?v=4","gravatar_id":"","url":"https://api.github.com/users/theKashey","html_url":"https://github.com/theKashey","followers_url":"https://api.github.com/users/theKashey/followers","following_url":"https://api.github.com/users/theKashey/following{/other_user}","gists_url":"https://api.github.com/users/theKashey/gists{/gist_id}","starred_url":"https://api.github.com/users/theKashey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theKashey/subscriptions","organizations_url":"https://api.github.com/users/theKashey/orgs","repos_url":"https://api.github.com/users/theKashey/repos","events_url":"https://api.github.com/users/theKashey/events{/privacy}","received_events_url":"https://api.github.com/users/theKashey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2018-10-09T18:22:45Z","updated_at":"2018-10-30T16:46:56Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Actually the problem is not with typescript - the problem is with rollup.\r\n\r\nhttps://unpkg.com/memoize-one@4.0.2/dist/memoize-one.cjs.js contains\r\n```js\r\nmodule.exports = index;\r\n```\r\nwhich should be imported as `import * as memoizeOne`\r\n\r\n\r\nwhile https://unpkg.com/memoize-one@4.0.2/dist/memoize-one.esm.js contains\r\n```js\r\nexport default index;\r\n```\r\nwhich should be imported as `import memoizeOne`\r\n\r\nResult - the code for nodejs (~jest) require one behaviour, while the code for webpack(uses esm bundle) requires another.\r\n\r\nIt is not a problem for js/flow, as long babel is doing some around magic default imports, but typescript is quite strict about it.\r\n\r\nThe cjs bundle should match esm bundle.\r\n\r\n(and fixing this would introduce a breaking change)"},"comment":{"url":"https://api.github.com/repos/alexreardon/memoize-one/issues/comments/434379776","html_url":"https://github.com/alexreardon/memoize-one/issues/37#issuecomment-434379776","issue_url":"https://api.github.com/repos/alexreardon/memoize-one/issues/37","id":434379776,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDM3OTc3Ng==","user":{"login":"wmhilton","id":587740,"node_id":"MDQ6VXNlcjU4Nzc0MA==","avatar_url":"https://avatars2.githubusercontent.com/u/587740?v=4","gravatar_id":"","url":"https://api.github.com/users/wmhilton","html_url":"https://github.com/wmhilton","followers_url":"https://api.github.com/users/wmhilton/followers","following_url":"https://api.github.com/users/wmhilton/following{/other_user}","gists_url":"https://api.github.com/users/wmhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/wmhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmhilton/subscriptions","organizations_url":"https://api.github.com/users/wmhilton/orgs","repos_url":"https://api.github.com/users/wmhilton/repos","events_url":"https://api.github.com/users/wmhilton/events{/privacy}","received_events_url":"https://api.github.com/users/wmhilton/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T16:46:56Z","updated_at":"2018-10-30T16:46:56Z","author_association":"NONE","body":"Just tried. Can't be done. (Seriously `rollup`?) Default exports were such a fuckup. :(\r\n\r\nI think the only way out is to release a new major version that breaks the way CJS currently works and forces it to use `require('memoize').default`. I'll make a PR."}}
{"actor":{"display_login":"wmhilton"}}