v1.0.0-rc.0 — Release Candidate
Pre-release
Pre-release
Live Demo ↗
API documentation ↗
⚠️ Breaking Changes Since v0.4.0:
- Updated the
main
entry inpackage.json
to use ES module version for better tools compatibility. UMD bundle still exists, in order to use it you should include it to your project manually from thenode_modules/@vaadin/router/dist/vaadin-router.umd.min.js
. - The public API has been changed significantly to be more consistent using new
location
object:- the
route
property on the view components is replaced with thelocation
- the
vaadin-router-route-changed
event renamed intovaadin-router-location-changed
- the
activeRoutes
property on the routes instance is replaced withlocation.routes
- the
router.ready
property now returns a Promise which resolves in thelocation
object - the
context
argument for the lifecycle callbacks also replaced with thelocation
- the
- Added the new
commands
object which should be used to prevent or redirect navigation from the lifecycle callbacks or custom route actions, e. g.context.cancel()
is nowcommands.prevent()
- Removed the possibility to return a Promise from
onAfterLeave
andonAfterEnter
callbacks, as the feature in these cases was considered to be not reliable enough in certain edge cases. From now, onlyonBeforeEnter
andonBeforeLeave
callbacks may return a Promise - Changed the order of the lifecycle callbacks, now
onAfterEnter
callbacks on the new view components get executed beforeonAfterLeave
callbacks on the old view components - Changed
bundle
property on the route config object to acceptmodule
andnomodule
paths
Bug Fixes
- Lifecycle callbacks are called properly when the route is the same and only parameters changed
- Fixed the "not found page" error not processed correctly when using parent layouts
- Fixed the issue with parent layouts when nested component remained after navigation
- Fixed the silent failure for case when the
children
function returns incorrect result
Changes Since v0.4.0:
- c82677c Call onAfterEnter before calling onAfterLeave (#226)
- 371b92d Change the result of router.ready from outlet to location (#225)
- ffac12e Refactor animations code (#224)
- 9e79a64 Use
location
andcommands
instead ofcontext
in the public API (#222) - 5fb5bed Fix parent layouts: update references to the unchanged elements (#223)
- f39581b Run lifecycle callbacks when only route params change (#221)
- 45b6d5e Refactor some method names, simplify the code (#219)
- 032fe09 Update bundle property to accept module and nomodule (#218)
- c759a62 Prevent suppressing not found route with nested components (#215)
- ba12cca Remove build-specific Vaadin.Router import from demo snippets (#213)
- 823e19e Simplify and comment the code that adds / removes outlet content (#216)
- 8d99e82 Fix the issue when a nested content remains on navigation (#214)
- 2c3994c Remove UMD bundle from package.json (#208)
- 5f28a9b Throw exception if children result is not array or object (#210)