- The move from
platform.js
towebcomponents.js
removed theURL()
constructor polyfill. The v2.0.3 fix created a bug in Safari when parsing the URL. This fixes Safari.
- The move from
platform.js
towebcomponents.js
removed theURL()
constructor polyfill webcomponents/webcomponentsjs#53. IE doesn't support theURL()
constructor yet so this fix is adding URL parse support for IE.
- Fixing issue 19 using best effort approach. Use
template.createInstance()
if Polymer is loaded, otherwise usedocument.importNode()
.
- Fixing bug where multiple
<app-route>
s had anactive
attribute.
New features
- Added support for
<core-animated-pages>
. Example: set up the router like<app-router core-animated-pages transitions="hero-transition cross-fade">
then include thehero
andcross-fade
attributes on the elements you want transitioned.
Breaking changes
- Previously the active route's content was under an
<active-route>
element. Now the content for the route is under it's<app-route>
element. This changed to support<core-animated-pages>
. - The
<active-route>
element androuter.activeRouteContent
have been removed. - Removed the
shadow
attribute from the<app-router>
. This was applied to the<active-route>
element which no longer exists.
Breaking changes
pathType="auto|hash|regular"
has been replaced withmode="auto|hash|pushstate"
for redirects,router.go(path, options)
, and testing routes.
New features
- Added support for redirects with
<app-route path="..." redirect="/other/path"></app-route>
. - Added
router.go(path, options)
. Example:document.querySelector('app-router').go('/home', {replace: true})
. - Note: If you're using redirects or
go()
you should specify the mode with<app-router mode="pushstate|hash"></app-router>
. Leaving the mode asauto
(the default) will change the hash, even if you wanted it to change the real path with pushstate.
- Refactor
parseUrl()
to use the nativeURL()
constructor and return additional information about the hash path. - Cleaned up
testRoute()
androuteArguments()
with additional information fromparseUrl()
. - Moved utility functions to
AppRouter.util
.
- Fixed bug where the regular path was being used when
pathType="hash"
was set on the router.
template
no longer required on inline template routes.- Only use
app-route
s that are direct children of the router by replacingquerySelector()
withfirstElementChild
and iterating withnextSibling
. - Took internal functions off the public API and simplified parameters.
- Added the
pathType
attribute to the router. The options areauto
,hash
, andregular
.