{"action":"created","comment":{"url":"https://api.github.com/repos/google/protobuf/pulls/comments/180932143","pull_request_review_id":111442362,"id":180932143,"diff_hunk":"@@ -1675,8 +1676,18 @@ void Generator::GenerateProvides(const GeneratorOptions& options,\n       //\n       //   // Later generated code expects foo.bar = {} to exist:\n       //   foo.bar.Baz = function() { /* ... */ }\n-      printer->Print(\"goog.exportSymbol('$name$', null, global);\\n\", \"name\",\n-                     *it);\n+\n+      // Do not use global scope in strict mode\n+      if (options.import_style == GeneratorOptions::kImportCommonJsStrict) {\n+        string namespaceObject = *it;\n+        // Remove \"proto.\" from the namespace object","path":"src/google/protobuf/compiler/js/js_generator.cc","position":20,"original_position":20,"commit_id":"6b7471a967a4a64e3b23867c54ddedbb8d118a96","original_commit_id":"6b7471a967a4a64e3b23867c54ddedbb8d118a96","user":{"login":"hekike","id":1764512,"avatar_url":"https://avatars0.githubusercontent.com/u/1764512?v=4","gravatar_id":"","url":"https://api.github.com/users/hekike","html_url":"https://github.com/hekike","followers_url":"https://api.github.com/users/hekike/followers","following_url":"https://api.github.com/users/hekike/following{/other_user}","gists_url":"https://api.github.com/users/hekike/gists{/gist_id}","starred_url":"https://api.github.com/users/hekike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hekike/subscriptions","organizations_url":"https://api.github.com/users/hekike/orgs","repos_url":"https://api.github.com/users/hekike/repos","events_url":"https://api.github.com/users/hekike/events{/privacy}","received_events_url":"https://api.github.com/users/hekike/received_events","type":"User","site_admin":false},"body":"Added","created_at":"2018-04-11T23:58:53Z","updated_at":"2018-04-11T23:58:54Z","html_url":"https://github.com/google/protobuf/pull/4299#discussion_r180932143","pull_request_url":"https://api.github.com/repos/google/protobuf/pulls/4299","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments/180932143"},"html":{"href":"https://github.com/google/protobuf/pull/4299#discussion_r180932143"},"pull_request":{"href":"https://api.github.com/repos/google/protobuf/pulls/4299"}},"in_reply_to_id":180229161},"pull_request":{"url":"https://api.github.com/repos/google/protobuf/pulls/4299","id":168101101,"html_url":"https://github.com/google/protobuf/pull/4299","diff_url":"https://github.com/google/protobuf/pull/4299.diff","patch_url":"https://github.com/google/protobuf/pull/4299.patch","issue_url":"https://api.github.com/repos/google/protobuf/issues/4299","number":4299,"state":"open","locked":false,"title":"Feat: add import-style=commonjs_strict option to the compiler","user":{"login":"hekike","id":1764512,"avatar_url":"https://avatars0.githubusercontent.com/u/1764512?v=4","gravatar_id":"","url":"https://api.github.com/users/hekike","html_url":"https://github.com/hekike","followers_url":"https://api.github.com/users/hekike/followers","following_url":"https://api.github.com/users/hekike/following{/other_user}","gists_url":"https://api.github.com/users/hekike/gists{/gist_id}","starred_url":"https://api.github.com/users/hekike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hekike/subscriptions","organizations_url":"https://api.github.com/users/hekike/orgs","repos_url":"https://api.github.com/users/hekike/repos","events_url":"https://api.github.com/users/hekike/events{/privacy}","received_events_url":"https://api.github.com/users/hekike/received_events","type":"User","site_admin":false},"body":"The `protoc` output pollutes the global scope by attaching the messages to the global object per namespaces. It works fine while the process doesn't require multiple version of the generated output.\r\n\r\nTo avoid conflicts but keep backward compatibility I added the `import_style=commonjs_strict` mode that doesn't use the global scope.\r\n\r\n**Related issues:**\r\n\r\n- https://github.com/google/protobuf/issues/4271\r\n","created_at":"2018-02-08T22:10:57Z","updated_at":"2018-04-11T23:58:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e894500e2e41cc3102b8e431bef6f77ef4fbfa6d","assignee":{"login":"haberman","id":1270,"avatar_url":"https://avatars2.githubusercontent.com/u/1270?v=4","gravatar_id":"","url":"https://api.github.com/users/haberman","html_url":"https://github.com/haberman","followers_url":"https://api.github.com/users/haberman/followers","following_url":"https://api.github.com/users/haberman/following{/other_user}","gists_url":"https://api.github.com/users/haberman/gists{/gist_id}","starred_url":"https://api.github.com/users/haberman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haberman/subscriptions","organizations_url":"https://api.github.com/users/haberman/orgs","repos_url":"https://api.github.com/users/haberman/repos","events_url":"https://api.github.com/users/haberman/events{/privacy}","received_events_url":"https://api.github.com/users/haberman/received_events","type":"User","site_admin":false},"assignees":[{"login":"haberman","id":1270,"avatar_url":"https://avatars2.githubusercontent.com/u/1270?v=4","gravatar_id":"","url":"https://api.github.com/users/haberman","html_url":"https://github.com/haberman","followers_url":"https://api.github.com/users/haberman/followers","following_url":"https://api.github.com/users/haberman/following{/other_user}","gists_url":"https://api.github.com/users/haberman/gists{/gist_id}","starred_url":"https://api.github.com/users/haberman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haberman/subscriptions","organizations_url":"https://api.github.com/users/haberman/orgs","repos_url":"https://api.github.com/users/haberman/repos","events_url":"https://api.github.com/users/haberman/events{/privacy}","received_events_url":"https://api.github.com/users/haberman/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"TeBoring","id":5195749,"avatar_url":"https://avatars1.githubusercontent.com/u/5195749?v=4","gravatar_id":"","url":"https://api.github.com/users/TeBoring","html_url":"https://github.com/TeBoring","followers_url":"https://api.github.com/users/TeBoring/followers","following_url":"https://api.github.com/users/TeBoring/following{/other_user}","gists_url":"https://api.github.com/users/TeBoring/gists{/gist_id}","starred_url":"https://api.github.com/users/TeBoring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeBoring/subscriptions","organizations_url":"https://api.github.com/users/TeBoring/orgs","repos_url":"https://api.github.com/users/TeBoring/repos","events_url":"https://api.github.com/users/TeBoring/events{/privacy}","received_events_url":"https://api.github.com/users/TeBoring/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":151794609,"url":"https://api.github.com/repos/google/protobuf/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/google/protobuf/pulls/4299/commits","review_comments_url":"https://api.github.com/repos/google/protobuf/pulls/4299/comments","review_comment_url":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/protobuf/issues/4299/comments","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/6b7471a967a4a64e3b23867c54ddedbb8d118a96","head":{"label":"hekike:feat/add-commonjs-strict-import-style","ref":"feat/add-commonjs-strict-import-style","sha":"6b7471a967a4a64e3b23867c54ddedbb8d118a96","user":{"login":"hekike","id":1764512,"avatar_url":"https://avatars0.githubusercontent.com/u/1764512?v=4","gravatar_id":"","url":"https://api.github.com/users/hekike","html_url":"https://github.com/hekike","followers_url":"https://api.github.com/users/hekike/followers","following_url":"https://api.github.com/users/hekike/following{/other_user}","gists_url":"https://api.github.com/users/hekike/gists{/gist_id}","starred_url":"https://api.github.com/users/hekike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hekike/subscriptions","organizations_url":"https://api.github.com/users/hekike/orgs","repos_url":"https://api.github.com/users/hekike/repos","events_url":"https://api.github.com/users/hekike/events{/privacy}","received_events_url":"https://api.github.com/users/hekike/received_events","type":"User","site_admin":false},"repo":{"id":120817153,"name":"protobuf","full_name":"hekike/protobuf","owner":{"login":"hekike","id":1764512,"avatar_url":"https://avatars0.githubusercontent.com/u/1764512?v=4","gravatar_id":"","url":"https://api.github.com/users/hekike","html_url":"https://github.com/hekike","followers_url":"https://api.github.com/users/hekike/followers","following_url":"https://api.github.com/users/hekike/following{/other_user}","gists_url":"https://api.github.com/users/hekike/gists{/gist_id}","starred_url":"https://api.github.com/users/hekike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hekike/subscriptions","organizations_url":"https://api.github.com/users/hekike/orgs","repos_url":"https://api.github.com/users/hekike/repos","events_url":"https://api.github.com/users/hekike/events{/privacy}","received_events_url":"https://api.github.com/users/hekike/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hekike/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":true,"url":"https://api.github.com/repos/hekike/protobuf","forks_url":"https://api.github.com/repos/hekike/protobuf/forks","keys_url":"https://api.github.com/repos/hekike/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hekike/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hekike/protobuf/teams","hooks_url":"https://api.github.com/repos/hekike/protobuf/hooks","issue_events_url":"https://api.github.com/repos/hekike/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/hekike/protobuf/events","assignees_url":"https://api.github.com/repos/hekike/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/hekike/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/hekike/protobuf/tags","blobs_url":"https://api.github.com/repos/hekike/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hekike/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hekike/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/hekike/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hekike/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/hekike/protobuf/languages","stargazers_url":"https://api.github.com/repos/hekike/protobuf/stargazers","contributors_url":"https://api.github.com/repos/hekike/protobuf/contributors","subscribers_url":"https://api.github.com/repos/hekike/protobuf/subscribers","subscription_url":"https://api.github.com/repos/hekike/protobuf/subscription","commits_url":"https://api.github.com/repos/hekike/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/hekike/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/hekike/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/hekike/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/hekike/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/hekike/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hekike/protobuf/merges","archive_url":"https://api.github.com/repos/hekike/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hekike/protobuf/downloads","issues_url":"https://api.github.com/repos/hekike/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/hekike/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/hekike/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/hekike/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hekike/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/hekike/protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/hekike/protobuf/deployments","created_at":"2018-02-08T20:57:51Z","updated_at":"2018-02-08T20:58:00Z","pushed_at":"2018-03-26T23:44:46Z","git_url":"git://github.com/hekike/protobuf.git","ssh_url":"git@github.com:hekike/protobuf.git","clone_url":"https://github.com/hekike/protobuf.git","svn_url":"https://github.com/hekike/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":45622,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"ed4321d1cb33199984118d801956822842771e7e","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":23357588,"name":"protobuf","full_name":"google/protobuf","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":false,"url":"https://api.github.com/repos/google/protobuf","forks_url":"https://api.github.com/repos/google/protobuf/forks","keys_url":"https://api.github.com/repos/google/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/protobuf/teams","hooks_url":"https://api.github.com/repos/google/protobuf/hooks","issue_events_url":"https://api.github.com/repos/google/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/google/protobuf/events","assignees_url":"https://api.github.com/repos/google/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/google/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/google/protobuf/tags","blobs_url":"https://api.github.com/repos/google/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/google/protobuf/languages","stargazers_url":"https://api.github.com/repos/google/protobuf/stargazers","contributors_url":"https://api.github.com/repos/google/protobuf/contributors","subscribers_url":"https://api.github.com/repos/google/protobuf/subscribers","subscription_url":"https://api.github.com/repos/google/protobuf/subscription","commits_url":"https://api.github.com/repos/google/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/google/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/protobuf/merges","archive_url":"https://api.github.com/repos/google/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/protobuf/downloads","issues_url":"https://api.github.com/repos/google/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/google/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/google/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/google/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/google/protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/google/protobuf/deployments","created_at":"2014-08-26T15:52:15Z","updated_at":"2018-04-11T23:56:04Z","pushed_at":"2018-04-10T22:56:12Z","git_url":"git://github.com/google/protobuf.git","ssh_url":"git@github.com:google/protobuf.git","clone_url":"https://github.com/google/protobuf.git","svn_url":"https://github.com/google/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":46279,"stargazers_count":25143,"watchers_count":25143,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7185,"mirror_url":null,"archived":false,"open_issues_count":648,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":7185,"open_issues":648,"watchers":25143,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/4299"},"html":{"href":"https://github.com/google/protobuf/pull/4299"},"issue":{"href":"https://api.github.com/repos/google/protobuf/issues/4299"},"comments":{"href":"https://api.github.com/repos/google/protobuf/issues/4299/comments"},"review_comments":{"href":"https://api.github.com/repos/google/protobuf/pulls/4299/comments"},"review_comment":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/protobuf/pulls/4299/commits"},"statuses":{"href":"https://api.github.com/repos/google/protobuf/statuses/6b7471a967a4a64e3b23867c54ddedbb8d118a96"}},"author_association":"NONE"}}
{"actor":{"display_login":"hekike"}}