Remove warning message.
Use ES modules. Upgrade packages.
Fix bug when sitePrefix is under a subdomain.
Fix bug with named routes starting with a /.
Update type definitions. Upgrade packages.
Use esm modules.
Use host instead of hostname to include port in url comparison.
Remove console log.
Fix issue with history when using browser's back button.
Improve handling of href links.
Added prefix param to constrain routes.
Fix bug with anchor tags.
Fix assignment to constat variable error.
Fix bug that prevented internal links to be open in a new tab.
Fix bug that removed anchor tags from url.
Support named params at the beginning of the path name.
Add custom 404 page.
Add a default language.
Fix bug that was duplicating query params on page reload.
Remove warining of assignment to undeclared variable redirectTo.
Fix wrong import routes. Now it's true.
Fix wrong import routes.
Refactor of code. Renaming router.js as spa_router.js. Fix issue where namedParams get an undefined value if route name starts with a '/'.
Fix route generation when localised and multiple paths with named params in name. -> { name: 'complex/route/:param/other/stuff/:param2' }
A bit of refactoring.
Add missing code to Navigate component onMount.
Fix bug where navigateTo did not return the right localised route.
currentRoute.path returns the full path including query params.
Navigate and navigateTo support route generation for a language.
- Internationalisation. Translate the route names to as many languages as you need.
const adminRoutes = [
{
name: 'employees',
layout: EmployeesPage,
lang: { es: 'empleados', fr: 'employes', de: 'angestellte', it: 'impiegati' },
},
]
- Fix an error when a route has a redirectTo that leads to a guarded route that also redirects.
const adminRoutes = [
{
name: '/admin',
layout: AdminLayout,
nestedRoutes: [
{ name: 'index', redirectTo: 'admin/dashboard' },
{
name: 'dashboard',
component: DashboardIndex,
onlyIf: {
guard: isLoggedIn,
redirect: '/login',
},
},
],
},
]
- routeIsActive gets a second optional param to check if the path is included in the current active route.
- [Breaking change] Simplify configuration. SpaRouter and editing main.js no more needed. Add your routes directly to the Router component.
- Correct naming of redirect param used in guards.
- [Breaking change] SpaRouter params have changed. Please check the docs.
- Reorder SpaRouter object initial params
- Track pageviews in google analytics.
- Route guards
- Route redirection
- Improve handling of not found routes. No more custom not found logic use standard 404.html pages available in most of the hosting providers.
- Remove outdated config info.
- Add params to Route.
- Avoid full page reload when using a tags.
- Remove console log.
- Add named params to all child routes not just specific ones.
- Ensure nested routes with named params work.
- Remove ? when not needed.
- Get pathname and params from currentRoute
- Update onpopstate
- Do not remove query params from visible route.
- Add onpopstate handler.
- Fix docs to request a full url in pathName
- Eslint upgraded to version 6.
- Add Svelte as a peer dependency.
- Upgrade eslint and svelte
- Unlock Svelte
- Lock Svelte to 3.5.1
- Fix wrong result in routeIsActive
- Improve recognition of routes not nested.
-
[Breaking Change] MainLayout has been renamed to Router. Please replace all references to MainLayout with Router.
-
[Breaking Change] Replace nestedRoutes array in currentRoute with childRoute object.
-
[Breaking Change] Renamed currentRoute method as routeIsActive.
-
Refactor and cleanup code.
- Fix queryParams not generated in some type of routes.
- Improvements to nested routes and layouts
- New currentRoute method returns true/false if pathName is the active route.
- SpaRouter: If pathName is an empty string then navigate to home.
- Fix bug where external links where ignored.
- Update docs.
- Add Navigate component.
- Fix an error in navigateTo method.
- Docs updated.
- Initial version published.