{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6359","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6359/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6359/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6359/events","html_url":"https://github.com/Microsoft/TypeScript/issues/6359","id":124959425,"number":6359,"title":"System.register module name update","user":{"login":"guybedford","id":598730,"avatar_url":"https://avatars.githubusercontent.com/u/598730?v=3","gravatar_id":"","url":"https://api.github.com/users/guybedford","html_url":"https://github.com/guybedford","followers_url":"https://api.github.com/users/guybedford/followers","following_url":"https://api.github.com/users/guybedford/following{/other_user}","gists_url":"https://api.github.com/users/guybedford/gists{/gist_id}","starred_url":"https://api.github.com/users/guybedford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guybedford/subscriptions","organizations_url":"https://api.github.com/users/guybedford/orgs","repos_url":"https://api.github.com/users/guybedford/repos","events_url":"https://api.github.com/users/guybedford/events{/privacy}","received_events_url":"https://api.github.com/users/guybedford/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Accepting%20PRs","name":"Accepting PRs","color":"009800"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Breaking%20Change","name":"Breaking Change","color":"eb6420"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-05T12:36:47Z","updated_at":"2016-01-25T18:07:20Z","closed_at":null,"body":"Since posting https://github.com/Microsoft/TypeScript/issues/6097, we've decided to alter the format of `System.register` (while we still can!), to rather use a module context object as the second argument:\r\n\r\nSo that:\r\n\r\n```javascript\r\nexport let name = __moduleName;\r\n```\r\n\r\nBecomes:\r\n\r\n```javascript\r\nSystem.register([], function($export, $moduleContext) {\r\n  return {\r\n    setters: [],\r\n    execute: function() {\r\n      $export('name', $moduleContext);\r\n    }\r\n  };\r\n});\r\n```\r\n\r\ninstead of:\r\n\r\n```javascript\r\nSystem.register([], function($export, __moduleName) {\r\n  return {\r\n    setters: [],\r\n    execute: function() {\r\n      $export('name', __moduleName);\r\n    }\r\n  };\r\n});\r\n```\r\n\r\nThis is so that this context argument can potentially be amended in future with additional metadata if and when this is specified at any point in future in the language.\r\n\r\nMy knowledge of TypeScript internals is quite limited, so I wasn't able to quickly get together a transformer to replace `__moduleName` with `$moduleContext.id`, but this should be relatively straightforward to do.\r\n\r\nIn the mean time, it may be worth reverting https://github.com/Microsoft/TypeScript/issues/6097 to avoid unnecessary breaking changes here.\r\n\r\nThis corresponds to Traceur PR https://github.com/google/traceur-compiler/pull/2051 and Babel PR https://github.com/babel/babel/pull/3166.\r\n\r\nApologies for any confusion here!"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/174605986","html_url":"https://github.com/Microsoft/TypeScript/issues/6359#issuecomment-174605986","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6359","id":174605986,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T18:07:19Z","updated_at":"2016-01-25T18:07:19Z","body":"@guybedford any news about this?"}}