{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/3625","labels_url":"https://api.github.com/repos/facebook/react-native/issues/3625/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/3625/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/3625/events","html_url":"https://github.com/facebook/react-native/pull/3625","id":112950432,"number":3625,"title":"[Packager] Fix @providesModule not being ignored properly","user":{"login":"skevy","id":131916,"avatar_url":"https://avatars.githubusercontent.com/u/131916?v=3","gravatar_id":"","url":"https://api.github.com/users/skevy","html_url":"https://github.com/skevy","followers_url":"https://api.github.com/users/skevy/followers","following_url":"https://api.github.com/users/skevy/following{/other_user}","gists_url":"https://api.github.com/users/skevy/gists{/gist_id}","starred_url":"https://api.github.com/users/skevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skevy/subscriptions","organizations_url":"https://api.github.com/users/skevy/orgs","repos_url":"https://api.github.com/users/skevy/repos","events_url":"https://api.github.com/users/skevy/events{/privacy}","received_events_url":"https://api.github.com/users/skevy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"},{"url":"https://api.github.com/repos/facebook/react-native/labels/Packager","name":"Packager","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"vjeux","id":197597,"avatar_url":"https://avatars.githubusercontent.com/u/197597?v=3","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"milestone":null,"comments":11,"created_at":"2015-10-23T04:41:11Z","updated_at":"2015-11-10T00:43:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/3625","html_url":"https://github.com/facebook/react-native/pull/3625","diff_url":"https://github.com/facebook/react-native/pull/3625.diff","patch_url":"https://github.com/facebook/react-native/pull/3625.patch"},"body":"There's quite a bit of code scattered around the packager regarding ignoring the `@providesModule` Haste pragma in any file that isn't in `react-native`, `react-tools` or `parse`. There is even a (passing) test case.\r\n\r\nHowever, there's an edge case.\r\n\r\nTake, for example, `fbjs`. It has a module inside of it called `ErrorUtils`. `react-relay` requires this file normally, in Common.JS style, by doing `require('fbjs/libs/ErrorUtils')`. But when `react-native` attempts to require `ErrorUtils` using the HasteModule format (in it's JavaScript initialization), it resolves the `fbjs` `ErrorUtils` module, instead of RN's `ErrorUtils`.\r\n\r\nThis happens, it turns out, because when a module is read (in `Module._read`), it's not caring about whether or not it should pay attention to `@providesModule`, and is just assigning the `@providesModule` value as the id of the module no matter what. Then when `Module.getName` is called, it will always use that `data.id` that was set, thus creating the wrong dependency tree.\r\n\r\nThis PR fixes that. :)"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/155246836","html_url":"https://github.com/facebook/react-native/pull/3625#issuecomment-155246836","issue_url":"https://api.github.com/repos/facebook/react-native/issues/3625","id":155246836,"user":{"login":"facebook-github-bot","id":6422482,"avatar_url":"https://avatars.githubusercontent.com/u/6422482?v=3","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":"2015-11-10T00:43:27Z","updated_at":"2015-11-10T00:43:27Z","body":"Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/417058798495156/int_phab to review."}}