- PR Merged #277
- Update dependencies.
- PR Merged #266.
- Update dependencies.
- Issue Fixed #260.
- Update svelte version.
- Fixed viewtransition callback function error.
- Added Prettier.
- Added View Transition (Experimental).
- PR Merged #258.
- PR Merged #245.
- Update svelte version.
- PR Merged #243.
- Major improvement in performance. Minimize unnecessary prefetch components.
- Fixed. Sometimes navigate return info null.
- Issue Fixed #132.
- Segment mismatch bug fixed.
- Issue Fixed #242.
- Update svelte version.
- Codebase improved.
- Can Use Dom function improved.
- function & class mismatch bug fixed.
- Issue Fixed #241.
- Hooks & Types bugs fixed.
- Svelte dependency updated.
- Lazyload component return type added.
- Issue Fixed #240.
- Major Bugs fixed in
Router.svelte
. - Converted all interfaces into types.
- Improved Lazy Loading/Async Route Import. Get much smaller chunk for every route. Only load files (JS & CSS module) when URL is active.
<!-- App.svelte -->
<Route path="/" component={() => import("./Home.svelte")} />
<Route path="/about" component={() => import("./About.svelte")} />
<Route path="/user/:user" component={() => import("./User.svelte")} />
- Added Hooks for Contexts.
useLocation
,useRouter
,useHistory
.
<!-- Page.svelte -->
<script>
import { useLocation } from "svelte-routing";
const location = useLocation();
</script>
<div>{JSON.stringify($location)}</div>
- Added Code of Conduct.
- Optimized the codebase.
- Update the dependencies.
- PR Merged #220.
- PR Merged #210.
- PR Merged #206.
- PR Merged #192.
- PR Merged #188.
- PR Merged #175.
- PR Merged #173.
- PR Merged #158.
- PR Merged #105.
- PR Merged #95.
- PR Merged #85.
- PR Merged #77.
- PR/Issue #200, Tested & it's not relevant/exists.
- Issue Fixed #122, #4652.
Added TypeScript support.
Added functionality for passing the location
to the rendered Route component
and slot.
<!-- App.svelte -->
<Route path="/blog" component="{Blog}" />
<!-- Blog.svelte -->
<script>
import queryString from "query-string";
export let location;
let queryParams;
$: queryParams = queryString.parse(location.search);
</script>
<h1>Blog</h1>
<p>{queryParams.foo}</p>
<!-- App.svelte -->
<Route path="/blog" let:location>
<h1>Blog</h1>
<p>{location.search}</p>
</Route>
Added functionality to pass potential Route
path parameters back to the parent
using props, so they can be exposed to the slot template using let:params
.
<Route path="/blog/:id" let:params>
<BlogPost id="{params.id}" />
</Route>
Added functionality for passing all the extra Route
properties to the rendered
component
.
<!-- App.svelte -->
<Route path="/page" component="{Page}" foo="foo" bar="bar" />
<!-- Page.svelte -->
<script>
export let foo;
export let bar;
</script>
<h1>{foo} {bar}</h1>
Added the ability to give Route
path wildcards a custom name.
<!-- App.svelte -->
<Route path="/page/*wildcardName" component="{Page}" />
<!-- Page.svelte -->
<script>
export let wildcardName;
</script>
<h1>{wildcardName}</h1>
- Moved to Svelte 3.
- It's now required for all
Route
andLink
components to have aRouter
ancestor. NavLink
was removed in favour for a more versatileLink
component. Check the userlandNavLink
component in theexample
directory for an example.- The SSR component no longer needs to be compiled at runtime with the help of
esm as there is no longer a
dependency on the
history
library. You can compile a separate CJS bundle for the server and pass in a prop to the topmost component and use that as theurl
property for theRouter
, which will force the URL for all descendants. - All component filename extensions have been changed to
.svelte
. - Hash routing is no longer supported.
- The entire API of the library is now exported from the
src/index.js
file, so importing from the library is now much more pleasant.
import { Router, Route, Link } from "svelte-routing";
Moved to Svelte v2 and added the new link and links actions.
Split the createHistory
function into createBrowserHistory
,
createMemoryHistory
, createHashHistory
to allow for better tree shaking of
unused history creation code.
Added the ability to access the match object in a matched route:
<!-- App.html -->
<Route path="/:myParam" bind:match>
<h1>{{match && match.params.myParam}}</h1>
</Route>
or:
<!-- App.html -->
<Route path="/:myParam" component="{{MyComponent}}" />
<!-- MyComponent.html -->
<h1>{{match.params.myParam}}</h1>
Added the ability to give a component constructor to a route with the
component
property:
<!-- App.html -->
<Route path="/:myParam" component="{{MyComponent}}" />