{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/2487","labels_url":"https://api.github.com/repos/facebook/react-native/issues/2487/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/2487/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/2487/events","html_url":"https://github.com/facebook/react-native/pull/2487","id":103807033,"number":2487,"title":"[Bridge] RFC: Declare module w/out auto exporting it with RCT_DECLARE_MODULE","user":{"login":"ide","id":379606,"avatar_url":"https://avatars.githubusercontent.com/u/379606?v=3","gravatar_id":"","url":"https://api.github.com/users/ide","html_url":"https://github.com/ide","followers_url":"https://api.github.com/users/ide/followers","following_url":"https://api.github.com/users/ide/following{/other_user}","gists_url":"https://api.github.com/users/ide/gists{/gist_id}","starred_url":"https://api.github.com/users/ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ide/subscriptions","organizations_url":"https://api.github.com/users/ide/orgs","repos_url":"https://api.github.com/users/ide/repos","events_url":"https://api.github.com/users/ide/events{/privacy}","received_events_url":"https://api.github.com/users/ide/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:%20needs-revision","name":"GH Review: needs-revision","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"tadeuzagallo","id":764414,"avatar_url":"https://avatars.githubusercontent.com/u/764414?v=3","gravatar_id":"","url":"https://api.github.com/users/tadeuzagallo","html_url":"https://github.com/tadeuzagallo","followers_url":"https://api.github.com/users/tadeuzagallo/followers","following_url":"https://api.github.com/users/tadeuzagallo/following{/other_user}","gists_url":"https://api.github.com/users/tadeuzagallo/gists{/gist_id}","starred_url":"https://api.github.com/users/tadeuzagallo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tadeuzagallo/subscriptions","organizations_url":"https://api.github.com/users/tadeuzagallo/orgs","repos_url":"https://api.github.com/users/tadeuzagallo/repos","events_url":"https://api.github.com/users/tadeuzagallo/events{/privacy}","received_events_url":"https://api.github.com/users/tadeuzagallo/received_events","type":"User","site_admin":false},"milestone":null,"comments":13,"created_at":"2015-08-28T22:39:06Z","updated_at":"2016-01-06T20:56:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/2487","html_url":"https://github.com/facebook/react-native/pull/2487","diff_url":"https://github.com/facebook/react-native/pull/2487.diff","patch_url":"https://github.com/facebook/react-native/pull/2487.patch"},"body":"The motivation for this is to define bridge modules that aren't automatically exported and need to be manually provided to the bridge. Usage looks like this:\r\n\r\n```objc\r\n@interface XXModule : NSObject <RCTBridgeModule>\r\n@end\r\n\r\n@implementation XXModule\r\nRCT_DECLARE_MODULE(OptionalName)\r\nRCT_EXPORT_METHOD(...)\r\n@end\r\n```\r\n\r\nAnd by default it is not exported to JS and does not show up under `require('react-native').NativeModules`'.\r\n\r\nTest Plan: Use the new macro to declare a module and see that it is not auto-exported. See that it is exported to JS when explicitly provided to the bridge."},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/169458400","html_url":"https://github.com/facebook/react-native/pull/2487#issuecomment-169458400","issue_url":"https://api.github.com/repos/facebook/react-native/issues/2487","id":169458400,"user":{"login":"ide","id":379606,"avatar_url":"https://avatars.githubusercontent.com/u/379606?v=3","gravatar_id":"","url":"https://api.github.com/users/ide","html_url":"https://github.com/ide","followers_url":"https://api.github.com/users/ide/followers","following_url":"https://api.github.com/users/ide/following{/other_user}","gists_url":"https://api.github.com/users/ide/gists{/gist_id}","starred_url":"https://api.github.com/users/ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ide/subscriptions","organizations_url":"https://api.github.com/users/ide/orgs","repos_url":"https://api.github.com/users/ide/repos","events_url":"https://api.github.com/users/ide/events{/privacy}","received_events_url":"https://api.github.com/users/ide/received_events","type":"User","site_admin":false},"created_at":"2016-01-06T20:56:05Z","updated_at":"2016-01-06T20:56:05Z","body":"With `extraModulesForBridge:` I was able to override native module instances -- that is, creating a custom instance of an existing native module class -- but when defining a completely new class, the bridge throws an error because it sees two module classes with the same name."}}