History: V4 Roadmap

Created on 2 Sep 2016  路  1Comment  路  Source: ReactTraining/history

I have a few goals for v4, and I just wanted to write them down somewhere so everyone can see where we're headed and pitch in if they feel so inclined.

  • [x] Refactor the test suite. The whole describeSomething approach isn't great because we lose the ability to easily zero in on one test (i.e. use it.only) when that code runs for each type of history we want to test. The main idea behind this refactoring is to get all tests out of these big describe* methods and inline them.
  • [x] Easier imports. Right now we ask people to import createHistory from 'history/lib/createBrowserHistory' if that's all they need. Let's get rid of the lib so people can just use e.g. history/createBrowserHistory.
  • [x] Remove "middleware" API (i.e. all use* functions). It's an unnecessary abstraction that only creates complexity. In practical terms, there are only ever going to be a few middlewares, not all of which are applicable to all histories.
  • [x] Move path and query parsing out of core. Our location objects will be { path, state, key } and that's it. Any other parsing can be done outside core.
  • [x] Use strings for location.action (as opposed to constants that need to be imported)
  • [x] Switch to just using window.history.state for browser history. Session storage has too many caveats.
  • [x] Remove location.state from hash history locations. This is a hack that's just not worth maintaining for older browsers.
  • [x] Remove support for basename in memory history.
  • [x] Expose canGo functionality in memory history. Released in v3.2.0.

If you're interested in helping w any of this work please let me know. It's going to be my main focus over the coming week.

Most helpful comment

ok, this work is done and released in v4.0.0-0. If anyone's listening, please give it a shot.

>All comments

ok, this work is done and released in v4.0.0-0. If anyone's listening, please give it a shot.

Was this page helpful?
0 / 5 - 0 ratings