{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-compiler/issues/3146","repository_url":"https://api.github.com/repos/google/closure-compiler","labels_url":"https://api.github.com/repos/google/closure-compiler/issues/3146/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/3146/comments","events_url":"https://api.github.com/repos/google/closure-compiler/issues/3146/events","html_url":"https://github.com/google/closure-compiler/issues/3146","id":381901280,"node_id":"MDU6SXNzdWUzODE5MDEyODA=","number":3146,"title":"Make RescopeGlobalSymbols usable in a node environment","user":{"login":"thheller","id":144930,"node_id":"MDQ6VXNlcjE0NDkzMA==","avatar_url":"https://avatars2.githubusercontent.com/u/144930?v=4","gravatar_id":"","url":"https://api.github.com/users/thheller","html_url":"https://github.com/thheller","followers_url":"https://api.github.com/users/thheller/followers","following_url":"https://api.github.com/users/thheller/following{/other_user}","gists_url":"https://api.github.com/users/thheller/gists{/gist_id}","starred_url":"https://api.github.com/users/thheller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thheller/subscriptions","organizations_url":"https://api.github.com/users/thheller/orgs","repos_url":"https://api.github.com/users/thheller/repos","events_url":"https://api.github.com/users/thheller/events{/privacy}","received_events_url":"https://api.github.com/users/thheller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-17T21:08:54Z","updated_at":"2018-11-24T11:46:31Z","closed_at":null,"author_association":"NONE","body":"I'm using the `RescopeGlobalSymbols` compiler pass via the `options.setRenamePrefixNamespace` compiler option in `shadow-cljs`. This works great for Browser-targetted builds but `node.js` targetted builds break since the compiler is rewriting all of the node \"specials\".\r\n\r\n```\r\nmodule.exports -> window.module.exports\r\nrequire(\"foo\") ->  (0,window.require)(\"foo\")\r\nglobal -> window.global\r\n```\r\n\r\nThis could be fixed by either making `SPECIAL_EXTERNS` configurable or just including the node-specific globals by default.\r\n\r\nhttps://github.com/google/closure-compiler/blob/4c97e69df965da4179b639ea3ee2020c98cc3621/src/com/google/javascript/jscomp/RescopeGlobalSymbols.java#L60-L82\r\n\r\nHappy to open a PR for this just wanted to check in first about the preferred way.\r\n\r\nThe added externs would be `global, process, require, module, exports, __filename, __dirname`."},"comment":{"url":"https://api.github.com/repos/google/closure-compiler/issues/comments/441362135","html_url":"https://github.com/google/closure-compiler/issues/3146#issuecomment-441362135","issue_url":"https://api.github.com/repos/google/closure-compiler/issues/3146","id":441362135,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTM2MjEzNQ==","user":{"login":"thheller","id":144930,"node_id":"MDQ6VXNlcjE0NDkzMA==","avatar_url":"https://avatars2.githubusercontent.com/u/144930?v=4","gravatar_id":"","url":"https://api.github.com/users/thheller","html_url":"https://github.com/thheller","followers_url":"https://api.github.com/users/thheller/followers","following_url":"https://api.github.com/users/thheller/following{/other_user}","gists_url":"https://api.github.com/users/thheller/gists{/gist_id}","starred_url":"https://api.github.com/users/thheller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thheller/subscriptions","organizations_url":"https://api.github.com/users/thheller/orgs","repos_url":"https://api.github.com/users/thheller/repos","events_url":"https://api.github.com/users/thheller/events{/privacy}","received_events_url":"https://api.github.com/users/thheller/received_events","type":"User","site_admin":false},"created_at":"2018-11-24T11:46:31Z","updated_at":"2018-11-24T11:46:31Z","author_association":"NONE","body":"In https://github.com/google/closure-compiler/pull/3154 I opted to make this configurable instead adding another hardcoded fixed set of names."}}
{"actor":{"display_login":"thheller"}}