{"action":"opened","number":4,"pull_request":{"url":"https://api.github.com/repos/mairatma/babel-plugin-globals/pulls/4","id":64611885,"html_url":"https://github.com/mairatma/babel-plugin-globals/pull/4","diff_url":"https://github.com/mairatma/babel-plugin-globals/pull/4.diff","patch_url":"https://github.com/mairatma/babel-plugin-globals/pull/4.patch","issue_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/issues/4","number":4,"state":"open","locked":false,"title":"Flexibile module name","user":{"login":"shumphrey","id":1267687,"avatar_url":"https://avatars.githubusercontent.com/u/1267687?v=3","gravatar_id":"","url":"https://api.github.com/users/shumphrey","html_url":"https://github.com/shumphrey","followers_url":"https://api.github.com/users/shumphrey/followers","following_url":"https://api.github.com/users/shumphrey/following{/other_user}","gists_url":"https://api.github.com/users/shumphrey/gists{/gist_id}","starred_url":"https://api.github.com/users/shumphrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shumphrey/subscriptions","organizations_url":"https://api.github.com/users/shumphrey/orgs","repos_url":"https://api.github.com/users/shumphrey/repos","events_url":"https://api.github.com/users/shumphrey/events{/privacy}","received_events_url":"https://api.github.com/users/shumphrey/received_events","type":"User","site_admin":false},"body":"This allows globalName to be a function.\r\n\r\nIf the globalName is a string, the same behaviour happens as now.\r\nIf globalName is a function, it is expected to return the id.\r\n\r\nWith the existing behaviour, I have two conflicting javascript files models/users.js and views/users.js\r\nOne of them overwrites the other.\r\nWith globalName as a function, I can change the way the global is named to include 'models' in the key chain.\r\n\r\nI debated alternate approaches to this but this seemed the most flexible. I am happy to consider alternatives.\r\n\r\nI also added a little documentation on the default 'Named' behaviour.","created_at":"2016-03-30T11:31:58Z","updated_at":"2016-03-30T11:31:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/pulls/4/commits","review_comments_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/pulls/4/comments","review_comment_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/issues/4/comments","statuses_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/statuses/04fae9ebc6eaf3bfc971bd2a4d9a331e435a4835","head":{"label":"shumphrey:flexibile_module_name","ref":"flexibile_module_name","sha":"04fae9ebc6eaf3bfc971bd2a4d9a331e435a4835","user":{"login":"shumphrey","id":1267687,"avatar_url":"https://avatars.githubusercontent.com/u/1267687?v=3","gravatar_id":"","url":"https://api.github.com/users/shumphrey","html_url":"https://github.com/shumphrey","followers_url":"https://api.github.com/users/shumphrey/followers","following_url":"https://api.github.com/users/shumphrey/following{/other_user}","gists_url":"https://api.github.com/users/shumphrey/gists{/gist_id}","starred_url":"https://api.github.com/users/shumphrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shumphrey/subscriptions","organizations_url":"https://api.github.com/users/shumphrey/orgs","repos_url":"https://api.github.com/users/shumphrey/repos","events_url":"https://api.github.com/users/shumphrey/events{/privacy}","received_events_url":"https://api.github.com/users/shumphrey/received_events","type":"User","site_admin":false},"repo":{"id":55051844,"name":"babel-plugin-globals","full_name":"shumphrey/babel-plugin-globals","owner":{"login":"shumphrey","id":1267687,"avatar_url":"https://avatars.githubusercontent.com/u/1267687?v=3","gravatar_id":"","url":"https://api.github.com/users/shumphrey","html_url":"https://github.com/shumphrey","followers_url":"https://api.github.com/users/shumphrey/followers","following_url":"https://api.github.com/users/shumphrey/following{/other_user}","gists_url":"https://api.github.com/users/shumphrey/gists{/gist_id}","starred_url":"https://api.github.com/users/shumphrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shumphrey/subscriptions","organizations_url":"https://api.github.com/users/shumphrey/orgs","repos_url":"https://api.github.com/users/shumphrey/repos","events_url":"https://api.github.com/users/shumphrey/events{/privacy}","received_events_url":"https://api.github.com/users/shumphrey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shumphrey/babel-plugin-globals","description":"A babel plugin that exposes ES6 modules to global variables.","fork":true,"url":"https://api.github.com/repos/shumphrey/babel-plugin-globals","forks_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/forks","keys_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/teams","hooks_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/hooks","issue_events_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/issues/events{/number}","events_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/events","assignees_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/assignees{/user}","branches_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/branches{/branch}","tags_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/tags","blobs_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/git/refs{/sha}","trees_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/statuses/{sha}","languages_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/languages","stargazers_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/stargazers","contributors_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/contributors","subscribers_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/subscribers","subscription_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/subscription","commits_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/commits{/sha}","git_commits_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/git/commits{/sha}","comments_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/comments{/number}","issue_comment_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/issues/comments{/number}","contents_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/contents/{+path}","compare_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/merges","archive_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/downloads","issues_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/issues{/number}","pulls_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/pulls{/number}","milestones_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/milestones{/number}","notifications_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/labels{/name}","releases_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/releases{/id}","deployments_url":"https://api.github.com/repos/shumphrey/babel-plugin-globals/deployments","created_at":"2016-03-30T09:51:03Z","updated_at":"2016-03-30T09:51:04Z","pushed_at":"2016-03-30T11:22:58Z","git_url":"git://github.com/shumphrey/babel-plugin-globals.git","ssh_url":"git@github.com:shumphrey/babel-plugin-globals.git","clone_url":"https://github.com/shumphrey/babel-plugin-globals.git","svn_url":"https://github.com/shumphrey/babel-plugin-globals","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mairatma:master","ref":"master","sha":"ed1cc4221b2908bf63c145ad2ec249664fa286e1","user":{"login":"mairatma","id":5216049,"avatar_url":"https://avatars.githubusercontent.com/u/5216049?v=3","gravatar_id":"","url":"https://api.github.com/users/mairatma","html_url":"https://github.com/mairatma","followers_url":"https://api.github.com/users/mairatma/followers","following_url":"https://api.github.com/users/mairatma/following{/other_user}","gists_url":"https://api.github.com/users/mairatma/gists{/gist_id}","starred_url":"https://api.github.com/users/mairatma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mairatma/subscriptions","organizations_url":"https://api.github.com/users/mairatma/orgs","repos_url":"https://api.github.com/users/mairatma/repos","events_url":"https://api.github.com/users/mairatma/events{/privacy}","received_events_url":"https://api.github.com/users/mairatma/received_events","type":"User","site_admin":false},"repo":{"id":36235317,"name":"babel-plugin-globals","full_name":"mairatma/babel-plugin-globals","owner":{"login":"mairatma","id":5216049,"avatar_url":"https://avatars.githubusercontent.com/u/5216049?v=3","gravatar_id":"","url":"https://api.github.com/users/mairatma","html_url":"https://github.com/mairatma","followers_url":"https://api.github.com/users/mairatma/followers","following_url":"https://api.github.com/users/mairatma/following{/other_user}","gists_url":"https://api.github.com/users/mairatma/gists{/gist_id}","starred_url":"https://api.github.com/users/mairatma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mairatma/subscriptions","organizations_url":"https://api.github.com/users/mairatma/orgs","repos_url":"https://api.github.com/users/mairatma/repos","events_url":"https://api.github.com/users/mairatma/events{/privacy}","received_events_url":"https://api.github.com/users/mairatma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mairatma/babel-plugin-globals","description":"A babel plugin that exposes ES6 modules to global variables.","fork":false,"url":"https://api.github.com/repos/mairatma/babel-plugin-globals","forks_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/forks","keys_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/teams","hooks_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/hooks","issue_events_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/issues/events{/number}","events_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/events","assignees_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/assignees{/user}","branches_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/branches{/branch}","tags_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/tags","blobs_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/git/refs{/sha}","trees_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/statuses/{sha}","languages_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/languages","stargazers_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/stargazers","contributors_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/contributors","subscribers_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/subscribers","subscription_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/subscription","commits_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/commits{/sha}","git_commits_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/git/commits{/sha}","comments_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/comments{/number}","issue_comment_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/issues/comments{/number}","contents_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/contents/{+path}","compare_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/merges","archive_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/downloads","issues_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/issues{/number}","pulls_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/pulls{/number}","milestones_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/milestones{/number}","notifications_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/labels{/name}","releases_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/releases{/id}","deployments_url":"https://api.github.com/repos/mairatma/babel-plugin-globals/deployments","created_at":"2015-05-25T14:22:06Z","updated_at":"2016-03-29T16:06:36Z","pushed_at":"2016-03-30T11:31:58Z","git_url":"git://github.com/mairatma/babel-plugin-globals.git","ssh_url":"git@github.com:mairatma/babel-plugin-globals.git","clone_url":"https://github.com/mairatma/babel-plugin-globals.git","svn_url":"https://github.com/mairatma/babel-plugin-globals","homepage":null,"size":157,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mairatma/babel-plugin-globals/pulls/4"},"html":{"href":"https://github.com/mairatma/babel-plugin-globals/pull/4"},"issue":{"href":"https://api.github.com/repos/mairatma/babel-plugin-globals/issues/4"},"comments":{"href":"https://api.github.com/repos/mairatma/babel-plugin-globals/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/mairatma/babel-plugin-globals/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/mairatma/babel-plugin-globals/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mairatma/babel-plugin-globals/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/mairatma/babel-plugin-globals/statuses/04fae9ebc6eaf3bfc971bd2a4d9a331e435a4835"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":20,"deletions":7,"changed_files":2}}