- Support returning a data object by
beforeEnter()
andbeforeUpdate()
hooks of a route service, and passing it towillEnter()
/enter()
andwillUpdate()
/update()
hooks. - Support applying extension by
willEnter()
/enter()
andwillUpdate()
/update()
hooks.
- Make
$snapshot
and$nextSnapshot
onRouter
observable. - Allow triggering
beforeLeave
multiple times during continuous navigation.
- Add
RouteMatch#$match()
helper to match against ref string.
- Move
$metadata
property fromRouteMatch
toRouteMatchShared
.
- Move autorun/reaction initialization into
enter
phase. - Expose
$snapshot
and$nextSnapshot
fromRouter
. - Add
toEmitChange
flag toHistory#restore()
. - Forward ref for
Link
andNavLink
components.
- Exposed
snapshot
getter inHistory
objects.
- Added
enter
,update
andleave
hooks that execute synchronously within the same action of a route update.
- Added
stopPropagation
flag forLink
(and consequentlyNavLink
).
- Upgrade mobx version to 6.3.5.
- Fixed
$rest
with parent route match returning the parent route match instead of the deepest descendant.
- Upgraded to MobX 6.
- Keep matched rest segment building referring route.
- Added prefix for
MemoryHistory
.
- Treat
/foo/bar/
as/foo/bar
. Route#$route()
method now accepts a route schema similar to what for a child route except for$match
option.
- Added hooks
$before/will/afterEnter
,$before/will/afterUpdate
,$before/will/afterLeave
; added$before/will/afterEnterOrUpdate
as shortcut for$before/will/afterEnter
and$before/will/afterUpdate
. - Added service
$service
. - Added parallel routes.
- Added
RouteBuilder
. - Added
$metadata
support.
Router.create()
is removed in favor ofnew Router().$route()
.- Names related to
fragment
has been changed tosegment
. - The router will no longer match parent if it has no matching child.
- By default, the router will no longer match a route if it has children but the path is ended at the route itself. For example, if the path is
/account
, and routeaccount
has$children
,account
will not be matched by default. An option$exact
is added for this scenario, and applies only to route schema with$children
. RouteMatch#$action
has been removed, see hooks for alternatives.- The second argument
RouteMatch#$ref()
,RouteMatch#$push()
,RouteMatch#$replace()
methods is now an option object. - Route match ref option
preserveQuery
is now removed, but the behavior has changed to preserve query defined with$query
(and its parents). - The return value of route hooks (such as
RouteMatch#$beforeEnter
,RouteMatch#$afterLeave
) is now a removal callback. <Redirect>
component has been removed.`
0.2.1 - 2018-9-5
- Added
<NavLink>
component.
0.2.0 - 2018-9-2
<Link>
component now doeshistory.push()
by default. A new boolean parameterreplace
is added to override the behavior withhistory.replace()
.<Redirect>
component now doeshistory.replace()
by default. A new boolean parameterpush
is added to override the behavior withhistory.push()
.
<Link>
and<Redirect>
component now supports onlyRouteMatch
as value ofto
parameter, and<HistoryProvider>
is now removed.$navigate
method ofRouteMatch
is now removed in favor of$push
and$replace
.<Redirect>
component no longer acceptsmatch
parameter with type boolean.