Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
v3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lyohaplotinka committed Mar 18, 2021
1 parent f999e03 commit a3a242f
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v3.1.1
* fix: removed circular dependency in EasyrouteProvider;
* fix: correct type definitions for registerRouterSSR;
* feat: added type definitions for usage with TypeScript.

### v3.1.0
* **breaking**: easyroute-core updated to 1.4.0 - difference in hooks definitions ([changelog](https://github.com/easyroute-router/easyroute-core/blob/master/CHANGELOG.md#v140));
* **beraking**: removed current route info access method via `export let currentRoute`;
Expand Down
8 changes: 7 additions & 1 deletion docs-app/src/Pages/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<li>
Hash, history and silent modes
</li>
<li>
Svelte + TypeScript support <code>v3.1.1+</code>
</li>
</ul>

<p>Why you should try it?</p>
Expand Down Expand Up @@ -103,6 +106,9 @@
<li>
Режими hash, history и "тихий"
</li>
<li>
Поддержка Svelte + TypeScript <code>v3.1.1+</code>
</li>
</ul>

<p>Почему стоит попробовать?</p>
Expand All @@ -122,4 +128,4 @@
</ol>
</article>

{/if}
{/if}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "svelte-easyroute",
"description": "Config-based router for Svelte in style of Vue Router with SSR support",
"version": "3.1.0",
"version": "3.1.1",
"main": "./index.js",
"types": "./types.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/lyohaplotinka/svelte-easyroute.git"
Expand Down
5 changes: 2 additions & 3 deletions src/EasyrouteProvider.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script>
import Router from '../index'
import { setContext } from 'svelte'
export let router = null
if (!router || !(router instanceof Router)) {
if (!router) {
throw new Error('[Easyroute] no router instance passed into EasyrouteProvider')
}
Expand All @@ -13,4 +12,4 @@
})
</script>

<slot></slot>
<slot></slot>
2 changes: 1 addition & 1 deletion ssr/registerRouterSSR/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import Router from 'easyroute-core'

declare function registerRouter(router: Router): void

export { registerRouter }
export default registerRouter
34 changes: 34 additions & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/// <reference types="svelte" />

import { SvelteComponentTyped } from 'svelte'
import Router from 'easyroute-core'

export interface RouterOutletProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['div']> {
/**
* @default null
*/
transition?: string | null

/**
* @default false
*/
forceRemount?: boolean

/**
* default "default"
*/
name?: string
}

export interface RouterLinkProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['a']> {
to: string
}

export default Router
export class RouterOutlet extends SvelteComponentTyped<RouterOutletProps> {}
export class RouterLink extends SvelteComponentTyped<RouterLinkProps> {}
export class EasyrouteProvider extends SvelteComponentTyped<{
router: Router
}> {}

0 comments on commit a3a242f

Please sign in to comment.