mefechoel / svelte-navigator

Simple, accessible routing for Svelte
Other
502 stars 39 forks source link

Roadmap v4 #19

Open mefechoel opened 3 years ago

mefechoel commented 3 years ago

V4 should make the router usable for more use cases. I've been planing on adding a hash based history for a while now. But there are a few things standing in the way to do this properly. Although the hash history would be optional, you'd still need the default browser history, as well as the fallback memory history module, even though you'd never use them. I've setup a new repo, where the history modules will be developed (svelte-navigator-history). As a result the Router API will need to change slightly. There will need to be different Routers, like a HashRouter and BrowserRouter, similar to react-routers API. That's the only way to not bundle all history modules for every project.

In more detail, for v4 I'm planning to finish these tasks:

guidobouman commented 3 years ago

Do you not want to use https://github.com/ReactTraining/history ? The underlying history handler for react-router. Seems like that would take the issues out of routing, and focus on the actual value for svelte.

mefechoel commented 3 years ago

I've thought about it and I might switch to it in the future or during the development of v4. It also already implements blocking, so that would be a benefit as well.

I didn't do it for now because it handles a few things a little differently. It parses locations slightly differently and it does not implement the svelte store interface, so I'd need to write a wrapper for svelte-navigator. It was also kind of fun do build the module myself...

I guess it would be more maintainable to rely on the history package going forward, but I'll try to finish the v4 api first and then see if I'll switch the history module...