{"action":"closed","number":12899,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/12899","id":110403266,"html_url":"https://github.com/facebook/react-native/pull/12899","diff_url":"https://github.com/facebook/react-native/pull/12899.diff","patch_url":"https://github.com/facebook/react-native/pull/12899.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/12899","number":12899,"state":"closed","locked":false,"title":"Changes reference to RCTBridgeDelegate from weak to strong","user":{"login":"wietsevenema","id":356014,"avatar_url":"https://avatars2.githubusercontent.com/u/356014?v=3","gravatar_id":"","url":"https://api.github.com/users/wietsevenema","html_url":"https://github.com/wietsevenema","followers_url":"https://api.github.com/users/wietsevenema/followers","following_url":"https://api.github.com/users/wietsevenema/following{/other_user}","gists_url":"https://api.github.com/users/wietsevenema/gists{/gist_id}","starred_url":"https://api.github.com/users/wietsevenema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wietsevenema/subscriptions","organizations_url":"https://api.github.com/users/wietsevenema/orgs","repos_url":"https://api.github.com/users/wietsevenema/repos","events_url":"https://api.github.com/users/wietsevenema/events{/privacy}","received_events_url":"https://api.github.com/users/wietsevenema/received_events","type":"User","site_admin":false},"body":"This PR makes sure the bridge delegate is retained. Currently the delegate only survives the initial load. During a `[bridge reload]`, it turns out to be `nil`. \r\n\r\n**Context**\r\nIn my project, I provide a RCTBridgeDelegate to load the bundle in a different way:\r\n\r\n```ObjectiveC\r\n@implementation MyScriptLoader\r\n  - (void)loadSourceForBridge:(RCTBridge *)bridge\r\n                 onProgress:(RCTSourceLoadProgressBlock)onProgress\r\n                 onComplete:(RCTSourceLoadBlock)onComplete\r\n  {    \r\n    // My own way of loading the bundle\r\n  }\r\n\r\n  - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\r\n  {\r\n    return nil;\r\n  }\r\n\r\n@end\r\n```\r\n\r\nIn AppDelegate I use it like this: \r\n```ObjectiveC\r\nMyScriptLoader *scriptLoader = [MyScriptLoader alloc];\r\n  bridge = [[RCTBridge alloc] initWithDelegate:scriptLoader\r\n                                         launchOptions:launchOptions];\r\n```\r\n\r\n**Expected behaviour**\r\nWhen I call `[bridge reload]`, I expect the delegate to be used to load the bundle, but currently it is gone. \r\n\r\n**Proposed fix**\r\nChange the delegate reference in `RCTBridge` from weak to strong.\r\n\r\n**Test plan (required)**\r\nTested the change in my project, delegate was retained and still there when reloading. \r\n","created_at":"2017-03-13T13:28:13Z","updated_at":"2017-03-13T20:55:26Z","closed_at":"2017-03-13T20:55:26Z","merged_at":null,"merge_commit_sha":"bbf6f4ae28b407cf94262cab37de6abc51d11d8c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/12899/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/12899/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/12899/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/87d4e96d46cc7926f21d0c51085afb67f4c503f3","head":{"label":"wietsevenema:adds-strong-reference-to-bridge-delegate","ref":"adds-strong-reference-to-bridge-delegate","sha":"87d4e96d46cc7926f21d0c51085afb67f4c503f3","user":{"login":"wietsevenema","id":356014,"avatar_url":"https://avatars2.githubusercontent.com/u/356014?v=3","gravatar_id":"","url":"https://api.github.com/users/wietsevenema","html_url":"https://github.com/wietsevenema","followers_url":"https://api.github.com/users/wietsevenema/followers","following_url":"https://api.github.com/users/wietsevenema/following{/other_user}","gists_url":"https://api.github.com/users/wietsevenema/gists{/gist_id}","starred_url":"https://api.github.com/users/wietsevenema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wietsevenema/subscriptions","organizations_url":"https://api.github.com/users/wietsevenema/orgs","repos_url":"https://api.github.com/users/wietsevenema/repos","events_url":"https://api.github.com/users/wietsevenema/events{/privacy}","received_events_url":"https://api.github.com/users/wietsevenema/received_events","type":"User","site_admin":false},"repo":{"id":82694139,"name":"react-native","full_name":"wietsevenema/react-native","owner":{"login":"wietsevenema","id":356014,"avatar_url":"https://avatars2.githubusercontent.com/u/356014?v=3","gravatar_id":"","url":"https://api.github.com/users/wietsevenema","html_url":"https://github.com/wietsevenema","followers_url":"https://api.github.com/users/wietsevenema/followers","following_url":"https://api.github.com/users/wietsevenema/following{/other_user}","gists_url":"https://api.github.com/users/wietsevenema/gists{/gist_id}","starred_url":"https://api.github.com/users/wietsevenema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wietsevenema/subscriptions","organizations_url":"https://api.github.com/users/wietsevenema/orgs","repos_url":"https://api.github.com/users/wietsevenema/repos","events_url":"https://api.github.com/users/wietsevenema/events{/privacy}","received_events_url":"https://api.github.com/users/wietsevenema/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wietsevenema/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/wietsevenema/react-native","forks_url":"https://api.github.com/repos/wietsevenema/react-native/forks","keys_url":"https://api.github.com/repos/wietsevenema/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wietsevenema/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wietsevenema/react-native/teams","hooks_url":"https://api.github.com/repos/wietsevenema/react-native/hooks","issue_events_url":"https://api.github.com/repos/wietsevenema/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/wietsevenema/react-native/events","assignees_url":"https://api.github.com/repos/wietsevenema/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/wietsevenema/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/wietsevenema/react-native/tags","blobs_url":"https://api.github.com/repos/wietsevenema/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wietsevenema/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wietsevenema/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/wietsevenema/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wietsevenema/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/wietsevenema/react-native/languages","stargazers_url":"https://api.github.com/repos/wietsevenema/react-native/stargazers","contributors_url":"https://api.github.com/repos/wietsevenema/react-native/contributors","subscribers_url":"https://api.github.com/repos/wietsevenema/react-native/subscribers","subscription_url":"https://api.github.com/repos/wietsevenema/react-native/subscription","commits_url":"https://api.github.com/repos/wietsevenema/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/wietsevenema/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/wietsevenema/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/wietsevenema/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/wietsevenema/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/wietsevenema/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wietsevenema/react-native/merges","archive_url":"https://api.github.com/repos/wietsevenema/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wietsevenema/react-native/downloads","issues_url":"https://api.github.com/repos/wietsevenema/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/wietsevenema/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/wietsevenema/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/wietsevenema/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wietsevenema/react-native/labels{/name}","releases_url":"https://api.github.com/repos/wietsevenema/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/wietsevenema/react-native/deployments","created_at":"2017-02-21T15:14:43Z","updated_at":"2017-02-21T15:14:57Z","pushed_at":"2017-03-13T13:14:51Z","git_url":"git://github.com/wietsevenema/react-native.git","ssh_url":"git@github.com:wietsevenema/react-native.git","clone_url":"https://github.com/wietsevenema/react-native.git","svn_url":"https://github.com/wietsevenema/react-native","homepage":"http://facebook.github.io/react-native/","size":117279,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"ac452c0a173594e40cab1e61e77823be59dd44c6","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars0.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars0.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react-native/deployments","created_at":"2015-01-09T18:10:16Z","updated_at":"2017-03-13T20:46:45Z","pushed_at":"2017-03-13T20:46:29Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":118907,"stargazers_count":45535,"watchers_count":45535,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10485,"mirror_url":null,"open_issues_count":1222,"forks":10485,"open_issues":1222,"watchers":45535,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/12899"},"html":{"href":"https://github.com/facebook/react-native/pull/12899"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/12899"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/12899/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/12899/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/12899/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/87d4e96d46cc7926f21d0c51085afb67f4c503f3"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":2,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":1,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"wietsevenema"}}