{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/react-native/pulls/comments/52748518","id":52748518,"diff_hunk":"@@ -324,6 +324,20 @@ - (void)setUp\n                                                  name:event\n                                                object:nil];\n   }\n+\n+  // Inject handler used by HMR\n+  [self addSynchronousHookWithName:@\"nativeInjectHMRUpdate\" usingBlock:^(NSString *sourceCode, NSString *sourceCodeURL) {\n+    RCTJSCExecutor *strongSelf = weakSelf;\n+    if (!strongSelf.valid) {\n+      return;\n+    }\n+\n+    JSStringRef execJSString = JSStringCreateWithUTF8CString(sourceCode.UTF8String);\n+    JSStringRef jsURL = JSStringCreateWithUTF8CString(sourceCodeURL.UTF8String);\n+    JSEvaluateScript(strongSelf->_context.ctx, execJSString, NULL, jsURL, 0, NULL);","path":"React/Executors/RCTJSCExecutor.m","position":14,"original_position":14,"commit_id":"a28d75e168588ed03d06f0c7592ca282461eb008","original_commit_id":"a28d75e168588ed03d06f0c7592ca282461eb008","user":{"login":"martinbigio","id":535661,"avatar_url":"https://avatars.githubusercontent.com/u/535661?v=3","gravatar_id":"","url":"https://api.github.com/users/martinbigio","html_url":"https://github.com/martinbigio","followers_url":"https://api.github.com/users/martinbigio/followers","following_url":"https://api.github.com/users/martinbigio/following{/other_user}","gists_url":"https://api.github.com/users/martinbigio/gists{/gist_id}","starred_url":"https://api.github.com/users/martinbigio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinbigio/subscriptions","organizations_url":"https://api.github.com/users/martinbigio/orgs","repos_url":"https://api.github.com/users/martinbigio/repos","events_url":"https://api.github.com/users/martinbigio/events{/privacy}","received_events_url":"https://api.github.com/users/martinbigio/received_events","type":"User","site_admin":false},"body":"Yeah, when I initially implemented this the code was originally on `executeApplicationScript` because it looked like the context was cleared after running this method. Maybe the problem was that we were assigning the sync function directly to the context. This is the right place and the right way to define the callback :)","created_at":"2016-02-12T14:41:56Z","updated_at":"2016-02-12T14:41:56Z","html_url":"https://github.com/facebook/react-native/pull/5741#discussion_r52748518","pull_request_url":"https://api.github.com/repos/facebook/react-native/pulls/5741","_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments/52748518"},"html":{"href":"https://github.com/facebook/react-native/pull/5741#discussion_r52748518"},"pull_request":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5741"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/5741","id":58187690,"html_url":"https://github.com/facebook/react-native/pull/5741","diff_url":"https://github.com/facebook/react-native/pull/5741.diff","patch_url":"https://github.com/facebook/react-native/pull/5741.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/5741","number":5741,"state":"open","locked":false,"title":"[Android] Enable HMR","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},"body":"This PR does most of the final things to enable HMR on Android, including:\r\n\r\n* Calling `HMRClient.enable` when the option is toggled in the dev menu.\r\n* Injecting a helper function into the JSC Context to deal with SourceMaps\r\n* Make sure RedBox dismisses appropriately when an error is fixed and HMR is enabled.","created_at":"2016-02-03T19:29:10Z","updated_at":"2016-02-12T14:41:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f337b4982f52ba0e1268f444e193a3cdbf9831e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/5741/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/5741/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/5741/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/a28d75e168588ed03d06f0c7592ca282461eb008","head":{"label":"skevy:android-hmr","ref":"android-hmr","sha":"a28d75e168588ed03d06f0c7592ca282461eb008","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},"repo":{"id":35853418,"name":"react-native","full_name":"skevy/react-native","owner":{"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},"private":false,"html_url":"https://github.com/skevy/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/skevy/react-native","forks_url":"https://api.github.com/repos/skevy/react-native/forks","keys_url":"https://api.github.com/repos/skevy/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skevy/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skevy/react-native/teams","hooks_url":"https://api.github.com/repos/skevy/react-native/hooks","issue_events_url":"https://api.github.com/repos/skevy/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/skevy/react-native/events","assignees_url":"https://api.github.com/repos/skevy/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/skevy/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/skevy/react-native/tags","blobs_url":"https://api.github.com/repos/skevy/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skevy/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skevy/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/skevy/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skevy/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/skevy/react-native/languages","stargazers_url":"https://api.github.com/repos/skevy/react-native/stargazers","contributors_url":"https://api.github.com/repos/skevy/react-native/contributors","subscribers_url":"https://api.github.com/repos/skevy/react-native/subscribers","subscription_url":"https://api.github.com/repos/skevy/react-native/subscription","commits_url":"https://api.github.com/repos/skevy/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/skevy/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/skevy/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/skevy/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/skevy/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/skevy/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skevy/react-native/merges","archive_url":"https://api.github.com/repos/skevy/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skevy/react-native/downloads","issues_url":"https://api.github.com/repos/skevy/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/skevy/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/skevy/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/skevy/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skevy/react-native/labels{/name}","releases_url":"https://api.github.com/repos/skevy/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/skevy/react-native/deployments","created_at":"2015-05-19T02:03:01Z","updated_at":"2016-02-01T21:10:27Z","pushed_at":"2016-02-10T00:20:53Z","git_url":"git://github.com/skevy/react-native.git","ssh_url":"git@github.com:skevy/react-native.git","clone_url":"https://github.com/skevy/react-native.git","svn_url":"https://github.com/skevy/react-native","homepage":"http://facebook.github.io/react-native/","size":35804,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":0,"forks":4,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"6ac007b2ba50d5d909f09f5b4632558d1192a570","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.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://avatars.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":"2016-02-12T14:25:26Z","pushed_at":"2016-02-12T14:21:38Z","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":77296,"stargazers_count":27031,"watchers_count":27031,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4880,"mirror_url":null,"open_issues_count":1086,"forks":4880,"open_issues":1086,"watchers":27031,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5741"},"html":{"href":"https://github.com/facebook/react-native/pull/5741"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/5741"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/5741/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5741/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/5741/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/a28d75e168588ed03d06f0c7592ca282461eb008"}}}}