{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/5084","labels_url":"https://api.github.com/repos/facebook/react-native/issues/5084/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/5084/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/5084/events","html_url":"https://github.com/facebook/react-native/pull/5084","id":124623101,"number":5084,"title":"[RFC] Remove knowledge of fbjs from the packager","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/Cleanup","name":"Cleanup","color":"fef2c0"},{"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/Size/L","name":"Size/L","color":"eb6420"}],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":1,"created_at":"2016-01-03T01:50:12Z","updated_at":"2016-01-03T01:50:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/5084","html_url":"https://github.com/facebook/react-native/pull/5084","diff_url":"https://github.com/facebook/react-native/pull/5084.diff","patch_url":"https://github.com/facebook/react-native/pull/5084.patch"},"body":"As @spicyj mentioned in commit 6a838a4, the ideal state of affairs when it comes to consuming `react` and `fbjs` from NPM is for the packager not to have knowledge of either package. This PR addresses the `fbjs` part of that, and relies on https://github.com/facebook/fbjs/pull/95. **DO NOT MERGE** until #95 (or a variation) is in `fbjs` and is released to npm.\r\n\r\nThis PR does several things:\r\n\r\n1. Adds stub modules within RN that expose `fbjs` modules to be required using Haste. After discussing a few ideas with @spicyj, this seemed like a good option to keep internal FB devs happy (and not make them change the way they write JS), but allow for removing packager complexity and fit in better with the NPM ecosystem. Note -- it skips stubbing `fetch`, `ExecutionEnvironment`, and `ErrorUtils`, due to the fact that these need to have Native specific implementations, and there's no reason for those implementations to exist in `fbjs`.\r\n2. Removes the modules that were previously being used in lieu of their `fbjs` equivalent modules, but didn't really need to be. These include: `Map`, `isEmpty`, `crc32`, and `Promise`. `Promise` is a special case - it has been moved to `Promise.native.js` in `fbjs`, so that a package such as Relay can `require('fbjs/lib/Promise')`, and not cause problems.\r\n3. Removes the `fbjs` modules from the packager blacklist (yay!), and removes `fbjs` from the list of packages that the RN packager consumes Haste modules from. I left in the `downstream` modules, but I think those should really live within an FB-specific blacklist that you keep in your internal codebase. Let me know your thoughts there. \r\n4. Adds `fbjs` to `unmockedModulePathPatterns` for Jest, to allow tests to not behave weirdly. This matches FB's internal Jest config.\r\n5. Remove everything except `fetch`, `ExecutionEnvironment`, and `ErrorUtils` from the `flowconfig` ignore list.\r\n6. Fix InteractionManager-test to make sure ErrorUtils is mocked. Quite honestly, I'm not sure why this was working before.\r\n\r\nThis, combined with https://github.com/facebook/fbjs/pull/95 and a yet to be submitted Relay PR, allow for Relay to be used OOTB with React Native. Woo!\r\n\r\nLooking forward to your comments :)\r\n\r\n/cc @vjeux @spicyj "},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/168449568","html_url":"https://github.com/facebook/react-native/pull/5084#issuecomment-168449568","issue_url":"https://api.github.com/repos/facebook/react-native/issues/5084","id":168449568,"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":"2016-01-03T01:50:33Z","updated_at":"2016-01-03T01:50:33Z","body":"By analyzing the blame information on this pull request, we identified @spicyj, @cpojer and @none to be potential reviewers."}}