Skip to content

Commit a48fe8d

Browse files
authored
feat: Rename package to @svelte-core/kit (#13)
1 parent 89d7e18 commit a48fe8d

File tree

12 files changed

+345
-313
lines changed

12 files changed

+345
-313
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
1-
# @wjfe/n-savant-sk
1+
# @svelte-router/kit
22

33
> Hash router for Sveltekit projects
44
5-
This is an extension package of the [@wjfe/n-savant](https://github.com/WJSoftware/wjfe-n-savant) SPA router, and enables the use of the router in hash mode in Sveltekit projects.
5+
This is an extension package of the [@svelte-router/core](https://github.com/WJSoftware/svelte-router-core) SPA router, and enables the use of the router in hash mode in Sveltekit projects.
66

77
## Why Would I Need This?
88

99
Sveltekit has an excellent file-based router. You should always stick to the built-in router for routing your application. However, as with every other router in existence, you can only do path routing or hash routing, but not both.
1010

11-
The `@wjfe/n-savant` router was born to break this barrier: This SPA router can do path and hash routing simultaneously. However, this is a router for SPA's and PWA's that render on the client. It was not designed for SSR scenarios. After all, Sveltekit has routing capabilities included.
11+
The `@svelte-router/core` router was born to break this barrier: This SPA router can do path and hash routing simultaneously. However, this is a router for SPA's and PWA's that render on the client. It was not designed for SSR scenarios. After all, Sveltekit has routing capabilities included.
1212

13-
But what if you wanted to do hash routing on top of Sveltekit's path routing? You can, with this router extension.
13+
But what if you wanted to do hash routing on top of Sveltekit's path routing? You can today, with this router extension.
1414

1515
### Useful Scenarios
1616

1717
1. You could show a complex dialog box that is driven by hash routing.
1818
2. You could mount a micro-frontend that routes with a path in the hash.
19+
3. You could drive your tabs components with individual named hash paths (this is demonstrated in this repository's demo project).
1920

2021
## Quickstart
2122

2223
1. Install the package
2324
```bash
24-
npm install @wjfe/n-savant-sk # This also installs the @wjfe/n-savant main package
25+
npm install @svelte-router/kit # This also installs the @svelte-router/core main package
2526
```
2627
2. Initialize the library. Ideally, in the root `+layout.svelte` component:
2728
```svelte
2829
<script lang="ts">
29-
import { init } from "@wjfe/n-savant-sk";
30+
import { init } from "@svelte-router/kit";
3031
3132
init(/* options */);
3233
</script>
3334
```
34-
3. Add routers, routes and links for hash navigation as you please.
35+
3. Add routers, routes and links for hash navigation as you please. Note that these are still imported from the core package, `@svelte-router/core`.
3536
3637
> **⚡ Attention!**
3738
>
38-
> Early testing has revealed what may or may not be a bug in Svelte or Sveltekit. The situation: Just importing `init` from `@wjfe/n-savant-sk` triggers error `rune_outside_svelte` on the `trace.svelte.js` file in the `@wjfe/n-savant` package. To overcome this, just add `{ ssr: { noExternal: ["@wjfe/n-savant"] }}` to Vite's configuration.
39+
> Early testing has revealed what may or may not be a bug in Svelte or Sveltekit. The situation: Just importing `init` from `@svelte-router/kit` triggers error `rune_outside_svelte` on the `trace.svelte.js` file in the `@svelte-router/core` package. To overcome this, just add `{ ssr: { noExternal: ["@svelte-router/core"] }}` to Vite's configuration.
3940
>
4041
> Hopefully, I'll be able to figure more about this problem in the coming weeks.
4142
@@ -45,4 +46,4 @@ But what if you wanted to do hash routing on top of Sveltekit's path routing? Y
4546
4647
---
4748
48-
Generally speaking, you need to understand the `@wjfe/n-savant` router, so have handy its [online documentation](https://wjfe-n-savant.hashnode.space/).
49+
Generally speaking, you need to understand the `@svelte-router/core` router, so have handy its [online documentation](https://wjfe-n-savant.hashnode.space/).

0 commit comments

Comments
 (0)