{"action":"created","issue":{"url":"https://api.github.com/repos/felixgirault/pure-render-decorator/issues/3","repository_url":"https://api.github.com/repos/felixgirault/pure-render-decorator","labels_url":"https://api.github.com/repos/felixgirault/pure-render-decorator/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/felixgirault/pure-render-decorator/issues/3/comments","events_url":"https://api.github.com/repos/felixgirault/pure-render-decorator/issues/3/events","html_url":"https://github.com/felixgirault/pure-render-decorator/pull/3","id":148572141,"number":3,"title":"Replace react-addons-shallow-compare with fbjs.","user":{"login":"seansfkelley","id":2101409,"avatar_url":"https://avatars.githubusercontent.com/u/2101409?v=3","gravatar_id":"","url":"https://api.github.com/users/seansfkelley","html_url":"https://github.com/seansfkelley","followers_url":"https://api.github.com/users/seansfkelley/followers","following_url":"https://api.github.com/users/seansfkelley/following{/other_user}","gists_url":"https://api.github.com/users/seansfkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/seansfkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seansfkelley/subscriptions","organizations_url":"https://api.github.com/users/seansfkelley/orgs","repos_url":"https://api.github.com/users/seansfkelley/repos","events_url":"https://api.github.com/users/seansfkelley/events{/privacy}","received_events_url":"https://api.github.com/users/seansfkelley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-15T06:56:43Z","updated_at":"2016-04-15T06:57:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/felixgirault/pure-render-decorator/pulls/3","html_url":"https://github.com/felixgirault/pure-render-decorator/pull/3","diff_url":"https://github.com/felixgirault/pure-render-decorator/pull/3.diff","patch_url":"https://github.com/felixgirault/pure-render-decorator/pull/3.patch"},"body":"This library had a hard dependency on react-addons-shallow-compare, which as it turns out is a bad idea:\r\n\r\n1. This library accepts React 15 and 14 (as it should; indeed, it could take many lower versions as well).\r\n2. It depends on react-addons-shallow-compare, which has a peer dependency on React of the version matching its own.\r\n3. npm will bias towards the higher version, so depending on react-addons-shallow-compare for either 14 or 15 means just 15. It's not a peer dependency, so npm has no obligation to do anything but exactly this.\r\n4. If I consume this library from an application that uses React 14, npm will still install react-addons-shallow-compare 15, which has a peer dependency on React 15 (again, because we depend on it normally, not as a peer).\r\n5. npm will yield a very confusing error message, claiming that I have a peer dependency on React 15, and React 14 doesn't qualify. As a bonus, it  won't tell me that the provenance of the conflicting requirement is this:\r\n  (root) -> pure-render-decorator -> react-addons-shallow-compare -> react\r\n\r\nSo instead of dealing with all that, just implement React's shallowCompare with fbjs's shallowEqual, which is how it's done anyway. This line is copy- pasted straight from react-addons-shallow-compare. fbjs doesn't have any weird dependencies. It should be noted that fbjs says they will \"do their best\" to adhere to semver, but given the simplicity of this requirement, it should be just fine.\r\n\r\nFor more color, see:\r\n  - facebook/react#6498 (problems with peer dependencies)\r\n  - facebook/react#2909 (not shallow-compare, but a similar intent)"},"comment":{"url":"https://api.github.com/repos/felixgirault/pure-render-decorator/issues/comments/210315254","html_url":"https://github.com/felixgirault/pure-render-decorator/pull/3#issuecomment-210315254","issue_url":"https://api.github.com/repos/felixgirault/pure-render-decorator/issues/3","id":210315254,"user":{"login":"seansfkelley","id":2101409,"avatar_url":"https://avatars.githubusercontent.com/u/2101409?v=3","gravatar_id":"","url":"https://api.github.com/users/seansfkelley","html_url":"https://github.com/seansfkelley","followers_url":"https://api.github.com/users/seansfkelley/followers","following_url":"https://api.github.com/users/seansfkelley/following{/other_user}","gists_url":"https://api.github.com/users/seansfkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/seansfkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seansfkelley/subscriptions","organizations_url":"https://api.github.com/users/seansfkelley/orgs","repos_url":"https://api.github.com/users/seansfkelley/repos","events_url":"https://api.github.com/users/seansfkelley/events{/privacy}","received_events_url":"https://api.github.com/users/seansfkelley/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T06:57:32Z","updated_at":"2016-04-15T06:57:32Z","body":"Also since this doesn't change the outward facing behavior at all you can just make a patch version so everyone will get it for free. I'm already seeing errors of the nature described above by a couple libraries using react-addons-*, this one included."}}