{"action":"created","issue":{"url":"https://api.github.com/repos/moment/moment/issues/2168","labels_url":"https://api.github.com/repos/moment/moment/issues/2168/labels{/name}","comments_url":"https://api.github.com/repos/moment/moment/issues/2168/comments","events_url":"https://api.github.com/repos/moment/moment/issues/2168/events","html_url":"https://github.com/moment/moment/pull/2168","id":54669062,"number":2168,"title":"ES6 Modules","user":{"login":"timrwood","id":643885,"avatar_url":"https://avatars.githubusercontent.com/u/643885?v=3","gravatar_id":"","url":"https://api.github.com/users/timrwood","html_url":"https://github.com/timrwood","followers_url":"https://api.github.com/users/timrwood/followers","following_url":"https://api.github.com/users/timrwood/following{/other_user}","gists_url":"https://api.github.com/users/timrwood/gists{/gist_id}","starred_url":"https://api.github.com/users/timrwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timrwood/subscriptions","organizations_url":"https://api.github.com/users/timrwood/orgs","repos_url":"https://api.github.com/users/timrwood/repos","events_url":"https://api.github.com/users/timrwood/events{/privacy}","received_events_url":"https://api.github.com/users/timrwood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-17T17:49:56Z","updated_at":"2015-02-04T10:56:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/moment/moment/pulls/2168","html_url":"https://github.com/moment/moment/pull/2168","diff_url":"https://github.com/moment/moment/pull/2168.diff","patch_url":"https://github.com/moment/moment/pull/2168.patch"},"body":"This converts the codebase from one 3000 line file to many smaller ES6 modules.\r\n\r\nWe can then create builds using [6to5](https://6to5.org/) to target CommonJS, AMD, and browser globals.\r\n\r\nAs part of the conversion to es6 modules, I also converted the tests to es6 modules. Unfortunately, I couldn't find a great way of getting nodeunit to play well with es6 modules, so I also converted the test framework to QUnit.\r\n\r\nThere are still a few outstanding tasks to get this production ready.\r\n\r\n- [x] Convert locales and tests.\r\n- [x] Build globals and amd bundles with grunt and es6-module-transpiler\r\n- [x] Build commonjs files using grunt-6to5\r\n- [ ] Build single moment + tests for browser (momentjs.com)\r\n- [ ] Build commonjs folder with moment + tests\r\n- [ ] update test task to generate commonjs moment + tests and run tests, make it possible to test a single file\r\n- [x] Build UMD single file version of the library (with all the UMD patches applied currently)\r\n- [ ] Generate minified files for amd, umd and globals\r\n- [ ] ~~Use https://github.com/developit/grunt-esperanto to create amd and browser bundles~~\r\n- [ ] ~~Use https://github.com/6to5/grunt-6to5 to transpile to commonjs~~\r\n- [ ] Comb through the unit test conversion commit, making sure nothing fell through the cracks."},"comment":{"url":"https://api.github.com/repos/moment/moment/issues/comments/72835910","html_url":"https://github.com/moment/moment/pull/2168#issuecomment-72835910","issue_url":"https://api.github.com/repos/moment/moment/issues/2168","id":72835910,"user":{"login":"ichernev","id":757060,"avatar_url":"https://avatars.githubusercontent.com/u/757060?v=3","gravatar_id":"","url":"https://api.github.com/users/ichernev","html_url":"https://github.com/ichernev","followers_url":"https://api.github.com/users/ichernev/followers","following_url":"https://api.github.com/users/ichernev/following{/other_user}","gists_url":"https://api.github.com/users/ichernev/gists{/gist_id}","starred_url":"https://api.github.com/users/ichernev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ichernev/subscriptions","organizations_url":"https://api.github.com/users/ichernev/orgs","repos_url":"https://api.github.com/users/ichernev/repos","events_url":"https://api.github.com/users/ichernev/events{/privacy}","received_events_url":"https://api.github.com/users/ichernev/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T10:56:57Z","updated_at":"2015-02-04T10:56:57Z","body":"OK, almost done. Only unit test combing is left.\r\n\r\n```bash\r\ngrunt transpile # creates transpiled files in build/umd\r\ngrunt qtest # runs all qunit tests\r\n```\r\n\r\nThe current transpiler only outputs UMD (basically the same as we had now). I think we can build the umd and put it in the old location (root/moment.js, root/locale/*.js), so various users of the npm module won't be surprised.\r\n\r\nFor 3.0 we can actually rearange the files in the repo, provide amd, browser global, custom locale bundle etc. I don't have more energy to do this now, and we're blocking the rest of the development while this is unpushed."}}