{"action":"created","comment":{"url":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/comments/61689262","id":61689262,"diff_hunk":"@@ -0,0 +1,109 @@\n+'use strict';\n+\n+const React = require('react');\n+const deepForceUpdate = require('react-deep-force-update');\n+const Redbox = require('redbox-react');\n+const { Component } = React;\n+\n+// Feature check for the createElement() patch.\n+// If createElement() was patched, types with\n+// the same __source will resolve to the same type.\n+let wasCreateElementPatched = false;\n+const A = () => {};\n+A.__source = { fileName: 'fake', localName: 'fake' }\n+const B = () => {};\n+B.__source = { fileName: 'fake', localName: 'fake' }\n+if (<A />.type === <B />.type) {\n+  wasCreateElementPatched = true;\n+}\n+\n+class AppContainer extends Component {\n+  constructor(props) {\n+    super(props);\n+    this.state = { error: null };\n+  }\n+\n+  componentDidMount() {\n+    if (!wasCreateElementPatched) {\n+      console.error(\n+        'React Hot Loader: It appears that \"react-hot-loader/patch\" ' +\n+        'did not run immediately before the app started. Make sure that it ' +\n+        'runs before any other code. For example, if you use Webpack, ' +\n+        'you can add \"react-hot-loader/patch\" as the very first item to the ' +\n+        '\"entry\" array in its config. Alternatively, you can add ' +\n+        'require(\"react-hot-loader/patch\") as the very first line ' +\n+        'in the application code, before any other imports.'\n+      );\n+    }\n+  }\n+\n+  componentWillReceiveProps(nextProps) {\n+    // Hot reload is happening.\n+    // Retry rendering!\n+    this.setState({\n+      error: null\n+    });\n+  }\n+\n+  componentDidUpdate(prevProps) {\n+    // Hot reload has finished.\n+    // Force-update the whole tree, including\n+    // components that refuse to update.\n+    if (prevProps !== this.props) {\n+      deepForceUpdate(this);","path":"src/AppContainer.dev.js","position":53,"original_position":53,"commit_id":"2a1e384d54e1919117f70f75dd20ad2490b1d9f5","original_commit_id":"2a1e384d54e1919117f70f75dd20ad2490b1d9f5","user":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"body":"@gaearon calling `deepForceUpdate` in `componentWillUpdate` makes the children component re-render twice every time it changes, one due to the regular react lifecycle, another due to the `deepForceUpdate`. If we moved `deepForceUpdate` to `componentWillReceiveProps` it would re-render only once. Do you see any downside?","created_at":"2016-05-01T16:22:34Z","updated_at":"2016-05-01T16:22:34Z","html_url":"https://github.com/gaearon/react-hot-loader/pull/240#discussion_r61689262","pull_request_url":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/240","_links":{"self":{"href":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/comments/61689262"},"html":{"href":"https://github.com/gaearon/react-hot-loader/pull/240#discussion_r61689262"},"pull_request":{"href":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/240"}}},"pull_request":{"url":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/240","id":66778455,"html_url":"https://github.com/gaearon/react-hot-loader/pull/240","diff_url":"https://github.com/gaearon/react-hot-loader/pull/240.diff","patch_url":"https://github.com/gaearon/react-hot-loader/pull/240.patch","issue_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/240","number":240,"state":"open","locked":false,"title":"React Hot Loader 3","user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"body":"Work in progress.\r\n(We are skipping 2 because the approach is way too different from 2 alpha which went nowhere).\r\n\r\nSome info here: https://github.com/gaearon/react-hot-boilerplate/pull/61","created_at":"2016-04-17T19:34:32Z","updated_at":"2016-05-01T16:22:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"991b325aa5f443accde9fa26706f2bbf745db0d7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/240/commits","review_comments_url":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/240/comments","review_comment_url":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/240/comments","statuses_url":"https://api.github.com/repos/gaearon/react-hot-loader/statuses/2a1e384d54e1919117f70f75dd20ad2490b1d9f5","head":{"label":"gaearon:next","ref":"next","sha":"2a1e384d54e1919117f70f75dd20ad2490b1d9f5","user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"repo":{"id":21779020,"name":"react-hot-loader","full_name":"gaearon/react-hot-loader","owner":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gaearon/react-hot-loader","description":"Tweak React components in real time.","fork":false,"url":"https://api.github.com/repos/gaearon/react-hot-loader","forks_url":"https://api.github.com/repos/gaearon/react-hot-loader/forks","keys_url":"https://api.github.com/repos/gaearon/react-hot-loader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaearon/react-hot-loader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaearon/react-hot-loader/teams","hooks_url":"https://api.github.com/repos/gaearon/react-hot-loader/hooks","issue_events_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/events{/number}","events_url":"https://api.github.com/repos/gaearon/react-hot-loader/events","assignees_url":"https://api.github.com/repos/gaearon/react-hot-loader/assignees{/user}","branches_url":"https://api.github.com/repos/gaearon/react-hot-loader/branches{/branch}","tags_url":"https://api.github.com/repos/gaearon/react-hot-loader/tags","blobs_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaearon/react-hot-loader/statuses/{sha}","languages_url":"https://api.github.com/repos/gaearon/react-hot-loader/languages","stargazers_url":"https://api.github.com/repos/gaearon/react-hot-loader/stargazers","contributors_url":"https://api.github.com/repos/gaearon/react-hot-loader/contributors","subscribers_url":"https://api.github.com/repos/gaearon/react-hot-loader/subscribers","subscription_url":"https://api.github.com/repos/gaearon/react-hot-loader/subscription","commits_url":"https://api.github.com/repos/gaearon/react-hot-loader/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaearon/react-hot-loader/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaearon/react-hot-loader/contents/{+path}","compare_url":"https://api.github.com/repos/gaearon/react-hot-loader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaearon/react-hot-loader/merges","archive_url":"https://api.github.com/repos/gaearon/react-hot-loader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaearon/react-hot-loader/downloads","issues_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues{/number}","pulls_url":"https://api.github.com/repos/gaearon/react-hot-loader/pulls{/number}","milestones_url":"https://api.github.com/repos/gaearon/react-hot-loader/milestones{/number}","notifications_url":"https://api.github.com/repos/gaearon/react-hot-loader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaearon/react-hot-loader/labels{/name}","releases_url":"https://api.github.com/repos/gaearon/react-hot-loader/releases{/id}","deployments_url":"https://api.github.com/repos/gaearon/react-hot-loader/deployments","created_at":"2014-07-12T23:49:43Z","updated_at":"2016-05-01T16:22:31Z","pushed_at":"2016-05-01T16:13:11Z","git_url":"git://github.com/gaearon/react-hot-loader.git","ssh_url":"git@github.com:gaearon/react-hot-loader.git","clone_url":"https://github.com/gaearon/react-hot-loader.git","svn_url":"https://github.com/gaearon/react-hot-loader","homepage":"http://gaearon.github.io/react-hot-loader/","size":770,"stargazers_count":4233,"watchers_count":4233,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":209,"mirror_url":null,"open_issues_count":14,"forks":209,"open_issues":14,"watchers":4233,"default_branch":"master"}},"base":{"label":"gaearon:master","ref":"master","sha":"fb4f3e636b79b51a9fa9a278d3941f913481e52b","user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"repo":{"id":21779020,"name":"react-hot-loader","full_name":"gaearon/react-hot-loader","owner":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gaearon/react-hot-loader","description":"Tweak React components in real time.","fork":false,"url":"https://api.github.com/repos/gaearon/react-hot-loader","forks_url":"https://api.github.com/repos/gaearon/react-hot-loader/forks","keys_url":"https://api.github.com/repos/gaearon/react-hot-loader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaearon/react-hot-loader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaearon/react-hot-loader/teams","hooks_url":"https://api.github.com/repos/gaearon/react-hot-loader/hooks","issue_events_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/events{/number}","events_url":"https://api.github.com/repos/gaearon/react-hot-loader/events","assignees_url":"https://api.github.com/repos/gaearon/react-hot-loader/assignees{/user}","branches_url":"https://api.github.com/repos/gaearon/react-hot-loader/branches{/branch}","tags_url":"https://api.github.com/repos/gaearon/react-hot-loader/tags","blobs_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaearon/react-hot-loader/statuses/{sha}","languages_url":"https://api.github.com/repos/gaearon/react-hot-loader/languages","stargazers_url":"https://api.github.com/repos/gaearon/react-hot-loader/stargazers","contributors_url":"https://api.github.com/repos/gaearon/react-hot-loader/contributors","subscribers_url":"https://api.github.com/repos/gaearon/react-hot-loader/subscribers","subscription_url":"https://api.github.com/repos/gaearon/react-hot-loader/subscription","commits_url":"https://api.github.com/repos/gaearon/react-hot-loader/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaearon/react-hot-loader/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaearon/react-hot-loader/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaearon/react-hot-loader/contents/{+path}","compare_url":"https://api.github.com/repos/gaearon/react-hot-loader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaearon/react-hot-loader/merges","archive_url":"https://api.github.com/repos/gaearon/react-hot-loader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaearon/react-hot-loader/downloads","issues_url":"https://api.github.com/repos/gaearon/react-hot-loader/issues{/number}","pulls_url":"https://api.github.com/repos/gaearon/react-hot-loader/pulls{/number}","milestones_url":"https://api.github.com/repos/gaearon/react-hot-loader/milestones{/number}","notifications_url":"https://api.github.com/repos/gaearon/react-hot-loader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaearon/react-hot-loader/labels{/name}","releases_url":"https://api.github.com/repos/gaearon/react-hot-loader/releases{/id}","deployments_url":"https://api.github.com/repos/gaearon/react-hot-loader/deployments","created_at":"2014-07-12T23:49:43Z","updated_at":"2016-05-01T16:22:31Z","pushed_at":"2016-05-01T16:13:11Z","git_url":"git://github.com/gaearon/react-hot-loader.git","ssh_url":"git@github.com:gaearon/react-hot-loader.git","clone_url":"https://github.com/gaearon/react-hot-loader.git","svn_url":"https://github.com/gaearon/react-hot-loader","homepage":"http://gaearon.github.io/react-hot-loader/","size":770,"stargazers_count":4233,"watchers_count":4233,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":209,"mirror_url":null,"open_issues_count":14,"forks":209,"open_issues":14,"watchers":4233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/240"},"html":{"href":"https://github.com/gaearon/react-hot-loader/pull/240"},"issue":{"href":"https://api.github.com/repos/gaearon/react-hot-loader/issues/240"},"comments":{"href":"https://api.github.com/repos/gaearon/react-hot-loader/issues/240/comments"},"review_comments":{"href":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/240/comments"},"review_comment":{"href":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gaearon/react-hot-loader/pulls/240/commits"},"statuses":{"href":"https://api.github.com/repos/gaearon/react-hot-loader/statuses/2a1e384d54e1919117f70f75dd20ad2490b1d9f5"}}}}