v1.4.0
Live Demo →
API Documentation →
New features
-
add TypeScript declarations
Fixes #304.
-
setRoutes
has now theskipRender
param and returns a Promise -
router.location
includes nowsearch
andhash
parameters
Bug fixes
-
fix: keep the url when the context does not change
Fixes #329.
Previously, if navigation originating from pressing the back button was prevented, the browser was still changing the URL. The fix puts the original URL back in such a case.
-
fix: add prepare script to allow usage via git directly (#367)
Adds
prepare
script inpackage.json
that builds the router entrypoints from source. This allows convenient symlink / folder / github installation. -
fix: preserve search and hash on the first render (#359)
Fixes #356.
The
search
andhash
initial location state were discarded and stripped from the URL as a result of initial router render after firstsetRoutes
call. The fix makes sure this does not happen. -
fix: render correctly if reusing the same instance or same tagName (#375)
Fixes #357.
This supports reusing the same element instance in navigation, fixes issues with rendering the element and its content being removed.
-
fix: get search and hash only if given a context (#368)
Fixes #366
Before the fix, the string argument of
render('/pathname')
was mistreated as an object, and its.search
and.hash
key contents were taken into account. The fix makes sure that the string argument is treated as a pathname string only. -
fix: events and detach/re-attach (#370)
Fixes #355, #361, #360, #311, #331
This fixes a few connected issues regarding lifecycle callbacks and detaching/re-attaching DOM elements when reusing same element instances.
Other changes
-
fix(docs): lifecycle callbacks on dynamicly imported routes (#369)
-
chore: update npm dependencies (#381)
Fixes the security issues in
eslint-utils
(GHSA-3gx7-xhv7-5mx3).