{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-library/issues/938","repository_url":"https://api.github.com/repos/google/closure-library","labels_url":"https://api.github.com/repos/google/closure-library/issues/938/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-library/issues/938/comments","events_url":"https://api.github.com/repos/google/closure-library/issues/938/events","html_url":"https://github.com/google/closure-library/issues/938","id":377578957,"node_id":"MDU6SXNzdWUzNzc1Nzg5NTc=","number":938,"title":"What is the current recommended module system for developing applications with closure library?","user":{"login":"jimbojetlag","id":11205806,"node_id":"MDQ6VXNlcjExMjA1ODA2","avatar_url":"https://avatars1.githubusercontent.com/u/11205806?v=4","gravatar_id":"","url":"https://api.github.com/users/jimbojetlag","html_url":"https://github.com/jimbojetlag","followers_url":"https://api.github.com/users/jimbojetlag/followers","following_url":"https://api.github.com/users/jimbojetlag/following{/other_user}","gists_url":"https://api.github.com/users/jimbojetlag/gists{/gist_id}","starred_url":"https://api.github.com/users/jimbojetlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimbojetlag/subscriptions","organizations_url":"https://api.github.com/users/jimbojetlag/orgs","repos_url":"https://api.github.com/users/jimbojetlag/repos","events_url":"https://api.github.com/users/jimbojetlag/events{/privacy}","received_events_url":"https://api.github.com/users/jimbojetlag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-11-05T20:56:23Z","updated_at":"2018-11-07T22:35:23Z","closed_at":null,"author_association":"NONE","body":"As of now closure compiler is able to to handle [a few different js modules](https://github.com/google/closure-compiler/wiki/JS-Modules), including:\r\n\r\n1. `goog.prodive`/`goog.require`\r\n2. `goog.module`\r\n3. ES6 modules\r\n4. Common JS\r\n\r\nBut when it comes to developing with closure library, only the first 2 are supported. Recently, the javascript implementation of dependency maker, [closure-deps](https://github.com/google/closure-library/tree/master/closure-deps) made the 3rd option possible.\r\n\r\nIt is not clearly documented that which approach should a greenfield project that depends on closure library take when it comes to modules. Is ES6 modules the future of applications built with closure library?\r\n\r\nAre there any reasons to use `goog.provide` for new projects, including any performance/optimization gains?"},"comment":{"url":"https://api.github.com/repos/google/closure-library/issues/comments/436803058","html_url":"https://github.com/google/closure-library/issues/938#issuecomment-436803058","issue_url":"https://api.github.com/repos/google/closure-library/issues/938","id":436803058,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjgwMzA1OA==","user":{"login":"jplaisted","id":1565017,"node_id":"MDQ6VXNlcjE1NjUwMTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1565017?v=4","gravatar_id":"","url":"https://api.github.com/users/jplaisted","html_url":"https://github.com/jplaisted","followers_url":"https://api.github.com/users/jplaisted/followers","following_url":"https://api.github.com/users/jplaisted/following{/other_user}","gists_url":"https://api.github.com/users/jplaisted/gists{/gist_id}","starred_url":"https://api.github.com/users/jplaisted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jplaisted/subscriptions","organizations_url":"https://api.github.com/users/jplaisted/orgs","repos_url":"https://api.github.com/users/jplaisted/repos","events_url":"https://api.github.com/users/jplaisted/events{/privacy}","received_events_url":"https://api.github.com/users/jplaisted/received_events","type":"User","site_admin":false},"created_at":"2018-11-07T22:35:23Z","updated_at":"2018-11-07T22:35:23Z","author_association":"CONTRIBUTOR","body":"So stemming from #937, I took a look at JsAction. They publish some pre-built code you could use. If that's all that you need, and don't want to use the Closure Compiler or Library, I'd recommend using those files.\r\n\r\nIf you want to use the Closure Compiler then you should probably write ES modules or `goog.module`s (`goog.provide` is super old and is in the global scope). You could try using TypeScript with the Closure Compiler via `tsickle` and `clutz`, though I don't think we have a well worn path around this for small external projects yet (like having a super fast edit / refresh dev flow). If you want to use TypeScript but not the Closure Library/Compiler, then there's no reason to use `clutz` or `tsickle`, just use the minifed / prebuilt JsAction files. They should be super simple to write some `.d.ts` files for, if they don't already exist.\r\n\r\nSo fundamentally this all depends on your use case. What combinations Closure Library, the Closure Compiler, JsAction, and TypeScript did you want to use?"}}
{"actor":{"display_login":"jplaisted"}}