yumauri / effector-storage-extras

Extra adapters for effector-storage package
MIT License
4 stars 0 forks source link

SvelteKit query-string adapter #110

Open falkomerr opened 3 weeks ago

falkomerr commented 3 weeks ago

When using query string in SvelteKit I get this error: Avoid using history.pushState(...) and history.replaceState(...) as these will conflict with SvelteKit's router. Use the pushState and replaceState imports from $app/navigation instead.

yumauri commented 3 weeks ago

I'm not familiar with SvelteKit, unfortunately, but it would be great, if you could contribute and make a PR with such adapter :)

falkomerr commented 3 weeks ago

I just changed the adapter.ts like this: https://pastebin.com/uC6wR0LH

Can you create a PR with this adapter for SvelteKit? I just haven't created a repository for it.

yumauri commented 3 weeks ago

It is not that simple like this. At least there should be tests and documentation. And I don't know, how to test library with SvelteKit, maybe there should be tests with some empty application build. Import from '$app/navigation' works fine inside your SvelteKit application, but I have doubts that it will work inside a library. Builders and packagers usually have different rules for your application code and code from library from node_modules folder.

Maybe it could be covered by adding support for custom history adapter 🤔