{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/2238","labels_url":"https://api.github.com/repos/facebook/react-native/issues/2238/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/2238/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/2238/events","html_url":"https://github.com/facebook/react-native/issues/2238","id":99320411,"number":2238,"title":"Feature request: Support for patching global apis","user":{"login":"uber5001","id":3348363,"avatar_url":"https://avatars.githubusercontent.com/u/3348363?v=3","gravatar_id":"","url":"https://api.github.com/users/uber5001","html_url":"https://github.com/uber5001","followers_url":"https://api.github.com/users/uber5001/followers","following_url":"https://api.github.com/users/uber5001/following{/other_user}","gists_url":"https://api.github.com/users/uber5001/gists{/gist_id}","starred_url":"https://api.github.com/users/uber5001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber5001/subscriptions","organizations_url":"https://api.github.com/users/uber5001/orgs","repos_url":"https://api.github.com/users/uber5001/repos","events_url":"https://api.github.com/users/uber5001/events{/privacy}","received_events_url":"https://api.github.com/users/uber5001/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-05T23:23:14Z","updated_at":"2015-08-06T17:02:38Z","closed_at":null,"body":"It would be convenient to be able to fill in any gaps in the JavaScriptCore environment with custom patches, so that any dependencies that expect to be running in v8 with node.js APIs can function properly.\r\n\r\n`url` is one of the modules exposed by the Node.js APIs. `require('url')` doesn't seem to work within React Native. There's also a module on npm called `url` that is meant to be a browserify replacement for node's `url`. I want to be able to use this as a replacement for Node's `url`.\r\n\r\nFor most cases, just `npm install url` will fix the problem. This even fixes my issue directly, which is that one of my sub-dependencies is `url`. This falls apart when my dependency that depends of `url` gets de-duped by npm when the module I'm working on gets installed by someone else. (Let me know if I need to explain this in detail)\r\n\r\nI'm not sure how this would be exposed. Perhaps something along the lines of\r\n\r\n    require('react-native').patchModule('url', require('url'));\r\n\r\nwhich would cause all `require('url')` to use the globally patched version provided."},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/128444391","html_url":"https://github.com/facebook/react-native/issues/2238#issuecomment-128444391","issue_url":"https://api.github.com/repos/facebook/react-native/issues/2238","id":128444391,"user":{"login":"uber5001","id":3348363,"avatar_url":"https://avatars.githubusercontent.com/u/3348363?v=3","gravatar_id":"","url":"https://api.github.com/users/uber5001","html_url":"https://github.com/uber5001","followers_url":"https://api.github.com/users/uber5001/followers","following_url":"https://api.github.com/users/uber5001/following{/other_user}","gists_url":"https://api.github.com/users/uber5001/gists{/gist_id}","starred_url":"https://api.github.com/users/uber5001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber5001/subscriptions","organizations_url":"https://api.github.com/users/uber5001/orgs","repos_url":"https://api.github.com/users/uber5001/repos","events_url":"https://api.github.com/users/uber5001/events{/privacy}","received_events_url":"https://api.github.com/users/uber5001/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T17:02:38Z","updated_at":"2015-08-06T17:02:38Z","body":"@browniefed, do you have a link to the proposal? I can't seem to find it."}}