{"action":"created","issue":{"url":"https://api.github.com/repos/regl-project/regl/issues/364","repository_url":"https://api.github.com/repos/regl-project/regl","labels_url":"https://api.github.com/repos/regl-project/regl/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/regl-project/regl/issues/364/comments","events_url":"https://api.github.com/repos/regl-project/regl/issues/364/events","html_url":"https://github.com/regl-project/regl/pull/364","id":181856405,"number":364,"title":"Convert to ES modules","user":{"login":"Rich-Harris","id":1162160,"avatar_url":"https://avatars.githubusercontent.com/u/1162160?v=3","gravatar_id":"","url":"https://api.github.com/users/Rich-Harris","html_url":"https://github.com/Rich-Harris","followers_url":"https://api.github.com/users/Rich-Harris/followers","following_url":"https://api.github.com/users/Rich-Harris/following{/other_user}","gists_url":"https://api.github.com/users/Rich-Harris/gists{/gist_id}","starred_url":"https://api.github.com/users/Rich-Harris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rich-Harris/subscriptions","organizations_url":"https://api.github.com/users/Rich-Harris/orgs","repos_url":"https://api.github.com/users/Rich-Harris/repos","events_url":"https://api.github.com/users/Rich-Harris/events{/privacy}","received_events_url":"https://api.github.com/users/Rich-Harris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-09T00:26:33Z","updated_at":"2016-10-09T00:44:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/regl-project/regl/pulls/364","html_url":"https://github.com/regl-project/regl/pull/364","diff_url":"https://github.com/regl-project/regl/pull/364.diff","patch_url":"https://github.com/regl-project/regl/pull/364.patch"},"body":"Follow-up to https://github.com/regl-project/regl/issues/118#issuecomment-252243484. Will no doubt require some finessing, but I thought I'd share what progress I've made to open it to discussion.\r\n\r\nThe headlines: `regl.min.js` is 5.8% smaller (25,093 bytes zipped, down from 26,641), and initialization time, measured like so...\r\n\r\n```js\r\nconsole.time('parse')\r\n/* contents of regl.min.js */\r\nconsole.timeEnd('parse')\r\n```\r\n\r\n...is reliably a decent amount faster in all the browsers I've tested (on this machine, drops from ~14ms to ~5ms on Chrome). The tests all pass and as far as I can tell all the gallery examples work as before. No changes required to the code beyond swapping `require` and `module.exports` for `import` and `export`.\r\n\r\nAs far as consumers of the library are concerned this shouldn't change anything – it's still creating a UMD bundle that behaves exactly as before. Deep imports (e.g. `require('regl/util/raf')`) wouldn't work without transpilation but I don't imagine that's a supported use case?\r\n\r\nLet me know if you have any thoughts/questions about this approach.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/regl-project/regl/364)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/regl-project/regl/issues/comments/252456599","html_url":"https://github.com/regl-project/regl/pull/364#issuecomment-252456599","issue_url":"https://api.github.com/repos/regl-project/regl/issues/364","id":252456599,"user":{"login":"Rich-Harris","id":1162160,"avatar_url":"https://avatars.githubusercontent.com/u/1162160?v=3","gravatar_id":"","url":"https://api.github.com/users/Rich-Harris","html_url":"https://github.com/Rich-Harris","followers_url":"https://api.github.com/users/Rich-Harris/followers","following_url":"https://api.github.com/users/Rich-Harris/following{/other_user}","gists_url":"https://api.github.com/users/Rich-Harris/gists{/gist_id}","starred_url":"https://api.github.com/users/Rich-Harris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rich-Harris/subscriptions","organizations_url":"https://api.github.com/users/Rich-Harris/orgs","repos_url":"https://api.github.com/users/Rich-Harris/repos","events_url":"https://api.github.com/users/Rich-Harris/events{/privacy}","received_events_url":"https://api.github.com/users/Rich-Harris/received_events","type":"User","site_admin":false},"created_at":"2016-10-09T00:44:11Z","updated_at":"2016-10-09T00:44:11Z","body":"Oh – a couple of things I forgot to mention. The `check-dependencies` script doesn't work with `import` declarations AFAICT, so I had to disable it. I don't know of an equivalent of `discify` for ES modules, so I disabled that too, but it was only generating a donut chart with one data point anyway.\r\n\r\nAlso, this turned into a series of slightly messy commits by the end, sorry about that – can rebase etc if nec!\r\n\r\nAm looking into the CircleCI failure."}}
{"actor":{"display_login":"Rich-Harris"}}