{"action":"created","issue":{"url":"https://api.github.com/repos/rackt/react-router/issues/2211","labels_url":"https://api.github.com/repos/rackt/react-router/issues/2211/labels{/name}","comments_url":"https://api.github.com/repos/rackt/react-router/issues/2211/comments","events_url":"https://api.github.com/repos/rackt/react-router/issues/2211/events","html_url":"https://github.com/rackt/react-router/issues/2211","id":110547411,"number":2211,"title":"react-router should re-export necessary functions from the `history` project","user":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rackt/react-router/labels/discussion","name":"discussion","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-10-08T21:44:40Z","updated_at":"2015-10-11T11:27:30Z","closed_at":null,"body":"[`history`](https://github.com/rackt/history) is a great project, but if I want to use react-router, I find it surprising that I have to install it as well as a top-level dependency, when it's really just a dependency for react-router. I could understand it if I'm doing something really low-level and internal, but if all I want to do is use a browserHistory instead of hashHistory (which is probably one of the most common use cases) I have to suddenly deal with this other library.\r\n\r\nI suggest that react-router should just re-export the few things necessary from `history` that users need, like `createBrowserHistory`. \r\n\r\nHow do you make sure that I have the right `history` version installed? It's now a peer dependency, essentially.\r\n\r\nFor example, I upgraded to react-router@1.0.0-rc3 and upgrade `history` to the latest version. But then I wanted to downgrade (for no reason of react-router, I was just debugging something). I removed react-router and re-installed 1.0.0-rc2. After I did this, I had two versions of `history`:\r\n\r\n![cq0itizwoaawgpg](https://cloud.githubusercontent.com/assets/17031/10380793/1c44012e-6de4-11e5-82fb-357c8c2d4ec2.png)\r\n\r\nThe top-level one is the more up-to-date one, and npm (rightly) installed the old one for react-router. As expected I got an obscure error when trying to run it.\r\n\r\nHiding the `history` project within react-router would avoid users having to manage two separate projects that are actually dependent.\r\n"},"comment":{"url":"https://api.github.com/repos/rackt/react-router/issues/comments/147184447","html_url":"https://github.com/rackt/react-router/issues/2211#issuecomment-147184447","issue_url":"https://api.github.com/repos/rackt/react-router/issues/2211","id":147184447,"user":{"login":"timdorr","id":17882,"avatar_url":"https://avatars.githubusercontent.com/u/17882?v=3","gravatar_id":"","url":"https://api.github.com/users/timdorr","html_url":"https://github.com/timdorr","followers_url":"https://api.github.com/users/timdorr/followers","following_url":"https://api.github.com/users/timdorr/following{/other_user}","gists_url":"https://api.github.com/users/timdorr/gists{/gist_id}","starred_url":"https://api.github.com/users/timdorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timdorr/subscriptions","organizations_url":"https://api.github.com/users/timdorr/orgs","repos_url":"https://api.github.com/users/timdorr/repos","events_url":"https://api.github.com/users/timdorr/events{/privacy}","received_events_url":"https://api.github.com/users/timdorr/received_events","type":"User","site_admin":false},"created_at":"2015-10-11T11:27:30Z","updated_at":"2015-10-11T11:27:30Z","body":"So, I had proposed exporting our own wrapper for `createMemoryHistory` this week: https://github.com/rackt/react-router/pull/2175#issuecomment-145953269\r\n\r\nWhat if we did that an also exported `createBrowserHistory` and `createHashHistory`? They're the most common use cases for exporting `history`'s API."}}