{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12473","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12473/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12473/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12473/events","html_url":"https://github.com/Microsoft/TypeScript/issues/12473","id":191370328,"number":12473,"title":"Guidance on migrating away from global namespaces to file modules","user":{"login":"brphelps","id":10023676,"avatar_url":"https://avatars.githubusercontent.com/u/10023676?v=3","gravatar_id":"","url":"https://api.github.com/users/brphelps","html_url":"https://github.com/brphelps","followers_url":"https://api.github.com/users/brphelps/followers","following_url":"https://api.github.com/users/brphelps/following{/other_user}","gists_url":"https://api.github.com/users/brphelps/gists{/gist_id}","starred_url":"https://api.github.com/users/brphelps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brphelps/subscriptions","organizations_url":"https://api.github.com/users/brphelps/orgs","repos_url":"https://api.github.com/users/brphelps/repos","events_url":"https://api.github.com/users/brphelps/events{/privacy}","received_events_url":"https://api.github.com/users/brphelps/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-11-23T20:15:05Z","updated_at":"2016-11-29T00:02:12Z","closed_at":null,"body":"Currently, the documentation section seems somewhat anemic on the best way to migrate out of global namespaces and into file modules. From what I can tell, that whole process is a not-well-supported there-be-dragons-here type of experience that seems to involve wholly converting your codebase and dependencies on your codebase in one fell swoop.\r\n\r\nI'm writing this issue up as someone trying to do it, and struggling to find an incremental approach. If there is a known incremental approach, can that be shared and added to the documentation (I would be glad to get a PR with the doc changes)? If there isn't an incremental approach, is that something that could be treated as a missing feature?"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/263434616","html_url":"https://github.com/Microsoft/TypeScript/issues/12473#issuecomment-263434616","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12473","id":263434616,"user":{"login":"TheLarkInn","id":3408176,"avatar_url":"https://avatars.githubusercontent.com/u/3408176?v=3","gravatar_id":"","url":"https://api.github.com/users/TheLarkInn","html_url":"https://github.com/TheLarkInn","followers_url":"https://api.github.com/users/TheLarkInn/followers","following_url":"https://api.github.com/users/TheLarkInn/following{/other_user}","gists_url":"https://api.github.com/users/TheLarkInn/gists{/gist_id}","starred_url":"https://api.github.com/users/TheLarkInn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheLarkInn/subscriptions","organizations_url":"https://api.github.com/users/TheLarkInn/orgs","repos_url":"https://api.github.com/users/TheLarkInn/repos","events_url":"https://api.github.com/users/TheLarkInn/events{/privacy}","received_events_url":"https://api.github.com/users/TheLarkInn/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T00:02:12Z","updated_at":"2016-11-29T00:02:12Z","body":">don't know if Webpack has an easy way of concatenating global files with your output's bundle. @TheLarkInn would know better than I do. 😄\r\n\r\nI always take the break-it-till-you-make-it-(work) approach with webpack and globals. Ideally you want to bundle as much lib source as possible. So I start out by just ripping off the bandaid at once: remove all script tags from your html page, then try and download locally as many npm deps to replace those scripts as possible so they can be bundled together the right way. This would involve additional [shimming](https://medium.com/webpack/how-to-cope-with-broken-modules-in-webpack-4c0427fb23a) for \"broken modules\" like jquery, as well as downloading any typings for libs that you are using in your src. \r\n\r\nExternals is an okay choice but the more you bundle src locally the more powerful/optimized your builds will be. \r\n\r\nI know this doesn't cover the entire migration process but this is usually a great start to freeing yourselves from the global namespaces. "}}
{"actor":{"display_login":"TheLarkInn"}}