{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/metro/issues/226","repository_url":"https://api.github.com/repos/facebook/metro","labels_url":"https://api.github.com/repos/facebook/metro/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/facebook/metro/issues/226/comments","events_url":"https://api.github.com/repos/facebook/metro/issues/226/events","html_url":"https://github.com/facebook/metro/pull/226","id":352385123,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5NzA4MDYw","number":226,"title":"Process locally scoped requires when they are likely part of a UMD module","user":{"login":"adamchel","id":1976694,"node_id":"MDQ6VXNlcjE5NzY2OTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1976694?v=4","gravatar_id":"","url":"https://api.github.com/users/adamchel","html_url":"https://github.com/adamchel","followers_url":"https://api.github.com/users/adamchel/followers","following_url":"https://api.github.com/users/adamchel/following{/other_user}","gists_url":"https://api.github.com/users/adamchel/gists{/gist_id}","starred_url":"https://api.github.com/users/adamchel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamchel/subscriptions","organizations_url":"https://api.github.com/users/adamchel/orgs","repos_url":"https://api.github.com/users/adamchel/repos","events_url":"https://api.github.com/users/adamchel/events{/privacy}","received_events_url":"https://api.github.com/users/adamchel/received_events","type":"User","site_admin":false},"labels":[{"id":500981201,"node_id":"MDU6TGFiZWw1MDA5ODEyMDE=","url":"https://api.github.com/repos/facebook/metro/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-21T04:52:36Z","updated_at":"2018-08-21T17:58:45Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/facebook/metro/pulls/226","html_url":"https://github.com/facebook/metro/pull/226","diff_url":"https://github.com/facebook/metro/pull/226.diff","patch_url":"https://github.com/facebook/metro/pull/226.patch"},"body":"<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->\r\n\r\n**Summary**\r\n\r\n<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->\r\nPer the discussion in https://github.com/facebook/metro/issues/225, this would fix the dependency collection worker script so that it would properly interpret require calls in UMD modules. Even if a `require` is bound to a local variable, if it exists with an `exports` local variable binding in the same scope, it is likely to be a normal `require` call in a UMD module.\r\n\r\n**Test plan**\r\n\r\n<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->\r\nI've updated the test for collecting dependencies to add a require call in a scope similar to one that would exist in a UMD module. I ran `lerna bootstrap` and `npm test` and everything passes for me locally. I also tested a similar change in the environment in which I reproduced the bug discussed in the  linked issue (this was an older version of Metro), and it allowed the UMD module to be properly bundled and executed without any other issues."},"comment":{"url":"https://api.github.com/repos/facebook/metro/issues/comments/414765878","html_url":"https://github.com/facebook/metro/pull/226#issuecomment-414765878","issue_url":"https://api.github.com/repos/facebook/metro/issues/226","id":414765878,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDc2NTg3OA==","user":{"login":"facebook-github-bot","id":6422482,"node_id":"MDQ6VXNlcjY0MjI0ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/6422482?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook-github-bot","html_url":"https://github.com/facebook-github-bot","followers_url":"https://api.github.com/users/facebook-github-bot/followers","following_url":"https://api.github.com/users/facebook-github-bot/following{/other_user}","gists_url":"https://api.github.com/users/facebook-github-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook-github-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook-github-bot/subscriptions","organizations_url":"https://api.github.com/users/facebook-github-bot/orgs","repos_url":"https://api.github.com/users/facebook-github-bot/repos","events_url":"https://api.github.com/users/facebook-github-bot/events{/privacy}","received_events_url":"https://api.github.com/users/facebook-github-bot/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T17:58:45Z","updated_at":"2018-08-21T17:58:45Z","author_association":"NONE","body":"Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!"}}
{"actor":{"display_login":"facebook-github-bot"}}