Skip to content

Releases: colinmeinke/universal-redux-router

v2.2.0

20 Sep 15:33
Compare
Choose a tag to compare

<a name"2.2.0">

2.2.0 (2016-09-20)

Features

  • getState: allow optional intialState argument (44edb847)

v2.1.0

03 Apr 02:21
Compare
Choose a tag to compare

<a name"2.1.0">

2.1.0 (2016-04-03)

Features

v2.0.0

12 Feb 22:52
Compare
Choose a tag to compare

<a name"2.0.0">

2.0.0 (2016-02-12)

Features

  • core: allow async action creators (038fde10)

Breaking Changes

  • getState now returns a promise

Before:

const state = getState( url, routes, reducer );
const store = createStore( reducer, state, middleware );

After:

getState( url, routes, reducer ).then( state => {
  const store = createStore( reducer, state, middleware );
})

(038fde10)

v1.2.0

10 Feb 00:38
Compare
Choose a tag to compare

<a name"1.2.0">

1.2.0 (2016-02-10)

Features

  • reducer: allow routes after action creators (40dfa146)

v1.1.1

06 Feb 20:22
Compare
Choose a tag to compare

<a name"1.1.1">

1.1.1 (2016-02-06)

Bug Fixes

  • getlocation: dont add empty string or object to query string (bec06796)

v1.1.0

06 Feb 19:50
Compare
Choose a tag to compare

<a name"1.1.0">

1.1.0 (2016-02-06)

Features

  • move scroll to top from link to middleware (723d5f53)

v1.0.1

06 Feb 05:11
Compare
Choose a tag to compare

<a name"1.0.1">

1.0.1 (2016-02-06)

Bug Fixes

  • middleware: do not get options props when options does not exist (a588128b)

v1.0.0

05 Feb 20:52
Compare
Choose a tag to compare

<a name"1.0.0">

1.0.0 (2016-02-05)

Features

  • core: allow attaching action creators to routes, and more... (7ad5ffa9)

Breaking Changes

structure of routes has changed from a function to an array.

Before:

const routes = url => {
  const path = url.split( '?' )[ 0 ];
  const query = qs.parse( qs.extract( url ));

  switch ( path ) {
    case '/about':
      return <About />;
    case '/hello':
      return <Hello name={ query.name } />;
    case '/':
      return <Home />;
    default:
      return <NotFound />;
  }
};

After:

const routes = [
  [ 'about', <About /> ],
  [ 'hello', { name: updateName }, <Hello /> ],
  [ '/', <Home /> ],
  [ '*', <NotFound /> ],
];

This now allows dynamic routes and attaching action creators to routes to handle params.

Link component now takes to prop, not url prop.

Before:

<Link url="/">Home</Link>

After:

<Link to="/">Home</Link>

This now allows Link component to also take a to array:

<Link to={[ 'users', id, 'followers', { page: 2 }]}>Followers</Link>
updateUrl action creator has been removed from the public API in favour of changePageTo.

Before:

dispatch( updateUrl( '/' ))

After:

dispatch( changePageTo( '/' ))

This now allows us to also pass in a to array:

dispatch( changePageTo([ 'users', id, 'followers', { page: 2 }]))
now requires routerMiddleware.

Before: none

After:

const middleware = applyMiddleware( routerMiddleware( routes, { isServer }));
const store = createStore( reducer, state, middleware );

This allows us to batch the action creators we have attached to our routes into one dispatch.

now requires routerReducer instead of Redux combineReducers.

Before:

const reducer = combineReducers({ ...reducers, url: urlReducer });

After:

const reducer = routerReducer( reducers );

Notice how urlReducer is no longer needed.

now handles popstate by default.

No need to add listener and dispatch updateUrl manually.

Before:

window.addEventListener( 'popstate', () => {
  const { hash, pathname, search } = window.location;
  const url = pathname + search + hash;
  store.dispatch( updateUrl( url ));
});

After: none

(7ad5ffa9)

v0.4.0

24 Jan 19:27
Compare
Choose a tag to compare

<a name"0.4.0">

0.4.0 (2016-01-24)

Features

  • link: allow additional control over onclick (d335494b)

v0.3.0

21 Jan 17:40
Compare
Choose a tag to compare

<a name"0.3.0">

0.3.0 (2016-01-21)

Features

  • link: scroll to top after link click (00a9933d)