Skip to content

Releases: remix-run/react-router

v0.10.0

10 Nov 17:06
Compare
Choose a tag to compare
v0.10.0 Pre-release
Pre-release

Nothing changed, this was simply React 0.12.0 compatibility. Note,
your code needs to use the React 0.11.x API for things to work, there
will be lots of warnings in the console.

Changes

  • 70b442a [added] React 0.12 compatibility

v0.9.5

10 Nov 17:05
Compare
Choose a tag to compare
v0.9.5 Pre-release
Pre-release
  • 6192285 [added] to opt out of scroll behavior for itself and descendants

v0.9.4

10 Nov 17:05
Compare
Choose a tag to compare
v0.9.4 Pre-release
Pre-release
  • e571c27 [fixed] Add .active class to <Link>s with absolute hrefs
  • ea5a380 [fixed] Make sure onChange is fired at synchronous first render
  • dee374f [fixed] Listen to path changes caused by initial redirect, fixes #360
  • d47d7dd [fixed] potential infinite loop during transitions
  • 1b1a62b [added] Server-side rendering
  • c7ca87e [added] <Routes onError>

v0.9.3

10 Nov 17:05
Compare
Choose a tag to compare
v0.9.3 Pre-release
Pre-release
  • caf3a2b [fixed] scrollBehavior='none' on path update

v0.9.2

10 Nov 17:05
Compare
Choose a tag to compare
v0.9.2 Pre-release
Pre-release
  • d57f830 [changed] Public interface for Location objects
  • 6723dc5 [added] ability to set params/query in Redirect
  • 60f9eb4 [fixed] encoded ampersands in query params
  • 668773c [fixed] transitioning to paths with .

v0.9.1

10 Nov 17:05
Compare
Choose a tag to compare
v0.9.1 Pre-release
Pre-release

v0.9.0

10 Nov 17:04
Compare
Choose a tag to compare
v0.9.0 Pre-release
Pre-release

ActiveState mixin isActive

isActive is now an instance method.

// 0.7.x
var SomethingActive = React.createClass({
  mixins: [ActiveState],

  render: function () {
    var isActive = SomethingActive.isActive(...);
  }
});

// 0.9.x
var SomethingActive = React.createClass({
  mixins: [ActiveState],

  render: function () {
    var isActive = this.isActive(...);
  }
});

<Routes onActiveStateChange/> -> <Routes onChange />

// 0.7.x
<Routes onActiveStateChange={fn} />

function fn(nextState) {}

// 0.9.x
<Routes onChange={fn} />

function fn() {
  // no arguments
  // `this` is the routes instance
  // here are some useful methods to get at the data you probably need
  this.getCurrentPath();
  this.getActiveRoutes();
  this.getActiveParams();
  this.getActiveQuery();
}

. in params support

. used to be a delimiter like /, but now its a valid character in
your params.

transition.retry()

transition.retry() used to use transitionTo, creating a new history
entry, it now uses replaceWith.

// 0.7.x
React.createClass({
  login: function () {
    // ...
    transition.retry();
  }
});

// 0.9.x
React.createClass({
  mixins: [Navigation],
  login: function () {
    // ...
    this.transitionTo(transition.path);
  }
});

Returning promises from transition hooks

Transition hooks are now sync, unless you opt-in to async with
transition.wait(promise).

// 0.7.x
React.createClass({
  statics: {
    willTransitionTo: function (transition) {
      return somePromise();
    }
  }
});

// 0.9.x
React.createClass({
  statics: {
    willTransitionTo: function (transition) {
      transition.wait(somePromise());
    }
  }
});

preserveScrollPosition -> scrollBehavior

preserveScrollPosition was totally broken and should have been named
perverseScrollPosition.

There are now three scroll behaviors you can use:

  • 'browser'
  • 'scrollToTop'
  • 'none'

browser is the default, and imitates what browsers do in a typical
page reload scenario (preserves scroll positions when using the back
button, scrolls up when you come to a new page, etc.) Also, you can no
longer specify scroll behavior per <Route/> anymore, only <Routes/>

<Routes scrollBehavior="scrollToTop"/>

RouteStore

This was not a public module, but we know some people were using it.
It's gone now. We have made getting at the current routes incredibly
convenient now with additions to the ActiveState mixin.

Router.transitionTo, replaceWith, goBack

These methods have been moved to mixins.

var Router = require('react-router');

// 0.7.x
React.createClass({
  whenever: function () {
    Router.transitionTo('something');
    Router.replaceWith('something');
    Router.goBack();
  }
});

// 0.9.x
var Navigation = Router.Navigation;

React.createClass({
  mixins: [Navigation],
  whenever: function () {
    this.transitionTo('something');
    this.replaceWith('something');
    this.goBack();
  }
});

<Routes onTransitionError onAbortedTransition/>

These were removed, there is no upgrade path in 0.9.0 but we will have
something soon. These weren't intended to be used.

ActiveState lifecycle method updateActiveState removed

We didn't actually need this. Just use this.isActive(to, params, query).

AsyncState mixin removed

There is no upgrade path. Just use comoponentDidMount to request
state. This was some groundwork for server-side rendering but we are
going a different direction now (using props passed in to route
handlers) so we've removed it.

Changes

  • 5aae2a8 [added] onChange event to Routes
  • ba65269 [removed] AsyncState
  • 4d8c7a1 [removed] <Routes onTransitionError>
  • 4d8c7a1 [removed] <Routes onAbortedTransition>
  • ed0cf62 [added] Navigation mixin for components that need to modify the URL
  • ed0cf62 [added] CurrentPath mixin for components that need to know the current URL path
  • ed0cf62 [added] getActiveRoutes, getActiveParams, and getActiveQuery methods to ActiveState mixin
  • ed0cf62 [removed] Awkward updateActiveState callback from ActiveState mixin
  • ed0cf62 [removed] Router.PathState (use Router.CurrentPath instead)
  • ed0cf62 [removed] Router.Transitions (use Router.Navigation instead)
  • ed0cf62 [removed] Router.RouteLookup (because it was useless)
  • ed0cf62 [added] <Routes scrollBehavior="browser"> alias of "imitateBrowser"
  • ed0cf62 [changed] <Routes fixedPath> => <Routes initialPath> will be useful for SSR

v0.8.0

10 Nov 17:03
Compare
Choose a tag to compare
v0.8.0 Pre-release
Pre-release

Please don't upgrade to 0.8.0, just skip to 0.9.x.

0.8.0 had some transient mixins we didn't intend to document, but had
some miscommunication :( If you were one of three people who used some
of these mixins and need help upgrading from 0.8.0 -> 0.9.x find us on
freenode in #rackt or open a ticket. Thanks!

Changes

  • d2aa7cb [added] <Routes location="none">
  • 637c0ac [added] <Routes fixedPath>
  • f2bf4bd [removed] RouteStore
  • f2bf4bd [added] Router.PathState for keeping track of the current URL path
  • f2bf4bd [added] Router.RouteLookup for looking up routes
  • f2bf4bd [added] Router.Transitions for transitioning to other routes
  • f2bf4bd [added] Pluggable scroll behaviors
  • f2bf4bd [changed] <Routes preserveScrollPosition> => <Routes scrollBehavior>
  • f2bf4bd [removed] <Route preserveScrollPosition>
  • f2bf4bd [removed] Router.transitionTo, Router.replaceWith, Router.goBack
  • 97dbf2d [added] transition.wait(promise)
  • 3787179 [changed] Transition retry now uses replaceWith.
  • e0b708f [added] Ability to transitionTo absolute URLs
  • c1493b5 [changed] #259 support dots in named params
  • a4ce7c8 [changed] isActive is an instance method
  • a4ce7c8 [removed] <Routes onActiveStateChange>

v0.7.0

10 Nov 17:02
Compare
Choose a tag to compare
v0.7.0 Pre-release
Pre-release

The package root modules were removed. Please import modules from the
Router default export.

// 0.6.x
var Link = require('react-router/Link');

// 0.7.x
var Router = require('react-router');
var Link = Router.Link;

Changes

  • 3796371 [changed] Use Browserify to run specs
  • 0e649be [changed] Use Browserify to build examples
  • bb7b666 [removed] .js files from repo root
  • 96122dd [fixed] undefined Buffer in query strings

v0.6.1

10 Nov 17:02
Compare
Choose a tag to compare
v0.6.1 Pre-release
Pre-release
  • 7536d96 [fixed] warning on links w/o params