{"action":"created","issue":{"url":"https://api.github.com/repos/gcanti/fp-ts/issues/863","repository_url":"https://api.github.com/repos/gcanti/fp-ts","labels_url":"https://api.github.com/repos/gcanti/fp-ts/issues/863/labels{/name}","comments_url":"https://api.github.com/repos/gcanti/fp-ts/issues/863/comments","events_url":"https://api.github.com/repos/gcanti/fp-ts/issues/863/events","html_url":"https://github.com/gcanti/fp-ts/issues/863","id":442187370,"node_id":"MDU6SXNzdWU0NDIxODczNzA=","number":863,"title":"Broken in browsers that don't support ES6 syntax natively","user":{"login":"butchler","id":73473,"node_id":"MDQ6VXNlcjczNDcz","avatar_url":"https://avatars3.githubusercontent.com/u/73473?v=4","gravatar_id":"","url":"https://api.github.com/users/butchler","html_url":"https://github.com/butchler","followers_url":"https://api.github.com/users/butchler/followers","following_url":"https://api.github.com/users/butchler/following{/other_user}","gists_url":"https://api.github.com/users/butchler/gists{/gist_id}","starred_url":"https://api.github.com/users/butchler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/butchler/subscriptions","organizations_url":"https://api.github.com/users/butchler/orgs","repos_url":"https://api.github.com/users/butchler/repos","events_url":"https://api.github.com/users/butchler/events{/privacy}","received_events_url":"https://api.github.com/users/butchler/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2019-05-09T11:25:45Z","updated_at":"2019-10-22T08:39:55Z","closed_at":"2019-05-10T06:59:01Z","author_association":"NONE","body":"**Do you want to request a _feature_ or report a _bug_?**\r\n\r\nBug\r\n\r\n**What is the current behavior?**\r\n\r\nThe `module` field in `package.json` points to a file that uses ES6 syntax, not just ES Module syntax. This causes syntax errors when trying to run the code in a browser that does not support ES6, such as IE11.\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://codesandbox.io/ or similar.**\r\n\r\n1. Bundle `fp-ts` with a bundler such as Webpack or Rollup (it is possible to configure bundlers to ignore the `module` field in `package.json`, but the default configuration gives it preference over the `main` field)\r\n2. Try to run the resulting bundle in a browser that does not support ES6 syntax natively, such as IE11\r\n3. Should result in a syntax error\r\n\r\n**What is the expected behavior?**\r\n\r\nAccording to https://github.com/rollup/rollup/wiki/pkg.module:\r\n\r\n> pkg.module will point to a module that has ES2015 module syntax but otherwise only syntax features that the target environments support.\r\n\r\nThe `module` field should point a file that uses `import`/`export` syntax, but no other ES6 features.\r\n\r\nMore details here: https://github.com/rollup/rollup/wiki/pkg.module#wait-it-just-means-import-and-export--not-other-future-javascript-features\r\n\r\n> If you're using things like arrow functions and classes (or more exotic features like decorators and object spread), you should transpile them if you want your library to work in environments that don't support those features. Otherwise, whoever uses your library will have to transpile it themselves, including configuring their transpiler to handle your code, which might involve esoteric transforms and conflicting versions of Babel.\r\n\r\n**Which versions of fp-ts, and which browser and OS are affected by this issue? Did this work in previous versions of fp-ts?**\r\n\r\nBrowsers: IE11 and any other browser that don't support ES6 syntax natively\r\nPrevious version: It worked in previous versions of `fp-ts` that did not expose an ES6 version (i.e. before this issue was resolved: https://github.com/gcanti/fp-ts/issues/813)"},"comment":{"url":"https://api.github.com/repos/gcanti/fp-ts/issues/comments/544861630","html_url":"https://github.com/gcanti/fp-ts/issues/863#issuecomment-544861630","issue_url":"https://api.github.com/repos/gcanti/fp-ts/issues/863","id":544861630,"node_id":"MDEyOklzc3VlQ29tbWVudDU0NDg2MTYzMA==","user":{"login":"butchler","id":73473,"node_id":"MDQ6VXNlcjczNDcz","avatar_url":"https://avatars3.githubusercontent.com/u/73473?v=4","gravatar_id":"","url":"https://api.github.com/users/butchler","html_url":"https://github.com/butchler","followers_url":"https://api.github.com/users/butchler/followers","following_url":"https://api.github.com/users/butchler/following{/other_user}","gists_url":"https://api.github.com/users/butchler/gists{/gist_id}","starred_url":"https://api.github.com/users/butchler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/butchler/subscriptions","organizations_url":"https://api.github.com/users/butchler/orgs","repos_url":"https://api.github.com/users/butchler/repos","events_url":"https://api.github.com/users/butchler/events{/privacy}","received_events_url":"https://api.github.com/users/butchler/received_events","type":"User","site_admin":false},"created_at":"2019-10-22T08:39:55Z","updated_at":"2019-10-22T08:39:55Z","author_association":"NONE","body":"I guess the main problem with the `esnext` approach is that it creates extra work for package authors, who would have to configure transpiling and expose two different versions of the code.\r\n\r\nI'm not opposed to package authors not going out of their way to support older browsers, but that should probably be considered a breaking change as far as semver :)"}}
{"actor":{"display_login":"butchler"}}