{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/69","labels_url":"https://api.github.com/repos/facebook/react-native/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/69/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/69/events","html_url":"https://github.com/facebook/react-native/issues/69","id":57678357,"number":69,"title":"Efficiently load RCTBridgeModule classes and allow lazy, background-thread initialization","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":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-14T02:54:00Z","updated_at":"2015-04-07T05:18:15Z","closed_at":null,"body":"`RCTBridgeModuleClasses` currently scans all(!) of the classes available at runtime to find which are modules. I believe a more explicit approach where modules are loaded only when needed is better for a couple of reasons:\r\n\r\n - No need to loop through all iOS classes\r\n - Fewer side effects from implicitly invoking `+[load]` and `+[initialize]` on otherwise-unused classes\r\n - Modules can be loaded on the JavaScript thread instead of the main thread -- some of the aforementioned side-effect methods in unused classes expect to run on the main thread\r\n - Modules can be lazily loaded as needed"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/90362730","html_url":"https://github.com/facebook/react-native/issues/69#issuecomment-90362730","issue_url":"https://api.github.com/repos/facebook/react-native/issues/69","id":90362730,"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":"2015-04-07T05:18:15Z","updated_at":"2015-04-07T05:18:15Z","body":"One feature I'd like is the ability to enable or disable autoloading for specific bridges. For example one bridge may autoload all linked modules while another bridge would only have modules provided to it. I could work on a PR when you guys complete the new module loader but it would be great if the code you're currently writing anticipated this feature or even implemented it.\r\n\r\nI had a diff about 1/3 complete where the only moderately interesting part is being able to skip autoloading if the module provider is specified: https://github.com/ide/react-native/commit/b8271e9ad167da19a4a92c13d1a7a374eb9d50d9#diff-e15318f48b6447f2d9936c5e047d882fR509"}}