This repository has been archived by the owner on Dec 15, 2018. It is now read-only.
Releases: FormidableLabs/redux-little-router
Releases · FormidableLabs/redux-little-router
Bug Busting 5: This Time It's Personal
Patch
Fix undefined previous
router state (#70)
Live Free or Bug Hard
Patch
Fix duplicate reducer call #66
Nested Fragments and Nested Routes!
Minor
(#59) Nested route definitions and nested route support! See the section on fragments in the new docs: https://github.com/FormidableLabs/redux-little-router#fragment
(#57) Add a basic client-side demo!
Tiny Breaking Change!
Reverted #49 to support multiple children in Fragment
s again. Sorry about that!
A Little Bit of Polish
Bug Busting 3: The Threequel
New <RouterProvider> Component
You can now use the plain component<RouterProvider>
instead of the provideRouter
HoC.
Example:
import React from 'react';
import ReactDOM from 'react-dom';
import { RouterProvider } from 'redux-little-router';
import YourAppComponent from './';
import createYourStore from './state';
ReactDOM.render(
<RouterProvider store={createYourStore()}>
<YourComponent />
</RouterProvider>
document.getElementById('root');
)
Bug Busting 2: Electric Boogaloo
Bug Busting
Fixed #29
Boilerplate-begone!
We've banished all the boilerplate we could to arrive at a user-friendly, stable API! Goodbye, churn!
Patch
- Fixed a nasty bug where ignored route precedence and would mistake concrete routes for parameters (e.g. would display for routes like /:wantsparams). Coincidentally,
<Fragment>
now has full test coverage! 😆
Minor
- New, more robust test suite with greater coverage!
Breaking changes
- Removed the middleware! We now wrap dispatch in the store enhancer.
- The store enhancer now handles initial location state when passed a pathname and/or a query object! Consequently, we renamed initialStateForSSR to initialRouterState and made it private.
- The library now provides a default
history
instance and removes the need to provide a custom instance to both the store enhancer and the provider. - The enhancer now accepts:
- a
basename
option in the enhancer. - a
forServerRender
flag to determine which history instance to use internally (memory or browser).
- a
Major improvements
<Link>
now respects modifier keys!<Link>
now accepts either a string or an object like so:
{
pathname: '/yo/this/is/a/url',
query: {
some: 'stuff'
}
}
<Link>
comes in two flavors now:<Link>
(old behavior) and<PersistentQueryLink>
(persists the previous query string unless thehref
prop provides one). Since you'll probably just use one or the other, this is a nice pattern:
import { PersistentQueryLink as Link } from 'redux-little-router';
- Query string support is fixed across the board!
- Added a util that sets up initial state on a server-side render. This correctly sets up query strings on the initial location dispatch.
- The
history
listener now lives in the store enhancer. The middleware no longer lives in the enhancer and must be used separately due to middleware order issues. - The store enhancer's reducer enhancer (enhance!!!) now supports
redux-loop
. - The current route info now lives at the top of the
router
state tree like it always should've (no morerouter.current
). You can still access the previous route onrouter.previous
. - New
Fragment
component that shows or hides children based on active routes (and even conditions of those active routes). - New
provideRouter
adds the router context to a top-level component. This means that<Link>
no longer requires you to pass indispatch
andhistory
(THANK GOD).