Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Svelte 4 #111

Open
Foorack opened this issue Jun 30, 2023 · 21 comments
Open

Support Svelte 4 #111

Foorack opened this issue Jun 30, 2023 · 21 comments

Comments

@Foorack
Copy link

Foorack commented Jun 30, 2023

Currently svelte-navigator has a dependency on Svelte 3.x, which causes issues for projects wanting to upgrade to Svelte 4.

$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: svelte-navigator@3.2.2
npm ERR! Found: svelte@4.0.1
npm ERR! node_modules/svelte
npm ERR!   dev svelte@"^4.0.1" from the root project
npm ERR!   peer svelte@"^3.54.0 || ^4.0.0-next.0" from @sveltejs/kit@1.20.1
npm ERR!   node_modules/@sveltejs/kit
npm ERR!     peer @sveltejs/kit@"^1.0.0" from @sveltejs/adapter-auto@2.1.0
npm ERR!     node_modules/@sveltejs/adapter-auto
npm ERR!       dev @sveltejs/adapter-auto@"^2.1.0" from the root project
npm ERR!   9 more (@sveltejs/vite-plugin-svelte, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer svelte@"3.x" from svelte-navigator@3.2.2
npm ERR! node_modules/svelte-navigator
npm ERR!   dev svelte-navigator@"^3.2.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: svelte@3.59.2
npm ERR! node_modules/svelte
npm ERR!   peer svelte@"3.x" from svelte-navigator@3.2.2
npm ERR!   node_modules/svelte-navigator
npm ERR!     dev svelte-navigator@"^3.2.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
@norricorp
Copy link

Working with svelte 4 would be very useful. Last commit was 8 months ago.
Is the project still active?

@flpms
Copy link

flpms commented Aug 2, 2023

That's a good question, I already schedule a change to sveltekit after see this issue.

Be sides exists the roadmap #19

@norricorp
Copy link

norricorp commented Aug 3, 2023

I have forked the project (norricorp/svelte4-navigator), downloaded it and made changes. It compiles and I have used it in my project (which is also upgraded to svelte 4) and it all appears to work.
I have no pushed the changes yet.
So after the changes have been pushed, I open a PR to go from norricorp/svelte4-navigator to mefechoel/svelte-navigator?
But that depends if mefechoel is still updating it.
Is there a test suite I can run against my change?

@norricorp
Copy link

I have commited to the forked repo and created a pull request to the part repo.
I guess it is up to mefechoel now?

@mefechoel
Copy link
Owner

Hello there ans thanks for the pr! Unfortunately i don't have a lot of time to work on the project, but i'll try to review your pr soon. There are quite extensive tests, you can run using the npm test command. I'll also run them in the github actions pipeline of you pr, so you'll see the results there too.

@Visual-Dawg
Copy link

Hey guys, which other libraries for routing can you recommend?

@Foorack
Copy link
Author

Foorack commented Aug 28, 2023 via email

@norricorp
Copy link

I agree that svelte kit is the answer but I would like to get svelte navigator working with svelte 4 just because ....

@kevin4dhd
Copy link

any solution?

@norricorp
Copy link

Unfortunately not.
I think override is the short term answer and sveltekit is the long term answer.
With regard to testing, the test app definitely behaves differently in the svelte 3 and 4 versions, with chunks of code not called in history.js. It may possibly the test app that is the problem.

@pndiogo
Copy link

pndiogo commented Sep 21, 2023

While SvelteKit seems to be the more future proof approach, svelte-navigator is just a nice library to implement on an existing Svelte project. Is there any perpective of updating it's Svelte dependency to version 4?

@norricorp
Copy link

Hi @pndiogo,
basically I am stuck so any help would be great.
I have run the svelte 4 migration (which updated svelteinternal.d.ts) and package.json. The changes pass unit tests and it works fine in my app. But the integration tests fail.
I have added console.logging to both my changes and the original svelte3 code and can see where functions are not called in the former but no idea why this is happening. Could even be the test app.

I completely agree with your comment that svelte-navigator is just easier to use for an existing project. Certainly moving to sveltekit is a lot of work.

If you would like to discuss further than am more than happy to email you directly.

@MrBns
Copy link

MrBns commented Sep 22, 2023

I think this project is died. owner should archive this repo so that everyone can understand.

@flpms
Copy link

flpms commented Sep 24, 2023

I already fork the project and try to learn more about it. anyone here already tried the project that's was forked?

https://github.com/EmilTholin/svelte-routing

This project seems continue be maintained

@sushidub
Copy link

sushidub commented Oct 1, 2023

UPDATE:
Nevermind, I see in your commit you've just updated the dependencies list which I can do myself locally. Good luck on the testing.


@norricorp

I think override is the short term answer ...

I realize your fork and PR solves this issue and your now just waiting on help from the current maintainer to get the integration tests to pass. In theory tho, is it possible to go ahead and use your override for those of us that don't want to wait on the PR merge (assuming our own risk of course). If so, do you have a commit hash you would recommend using with just the override and not all the testing mumble jumble?

@abrman
Copy link

abrman commented Oct 23, 2023

I used npm install svelte-navigator --force seems to work also, but you'll never feel clean again.

@ignatij
Copy link

ignatij commented Feb 16, 2024

Any progress here on this issue? We struggle with the same problem

@dysfunc
Copy link

dysfunc commented Feb 16, 2024

This is what I'm using in our production app:

"overrides": {
  "svelte-navigator": {
    "svelte": ">=4.x"
  }
}

I've started working on a branch to migrate this package to Svelte 4+. It's partially done, but a decent amount to go.

@marekdedic
Copy link

Unfortunately, it seems that svelte-navigator may be abandoned. I am currently switching to SvelteKit (with adapter-static) due to this... :(

@norricorp
Copy link

That was the conclusion I came to as well.
Just to add that restructuring for sveltekit is a lot of work and it did make me realise how convienient svelte-navigator is so a great shame that it is no more.

@flpms
Copy link

flpms commented Feb 20, 2024

Did you consider use the original https://github.com/EmilTholin/svelte-routing? This project is a fork from svelte-routing, may it's more easy to migrate.

Sadly I didn't tried yet, but I'll pretty soon

Unfortunately, it seems that svelte-navigator may be abandoned. I am currently switching to SvelteKit (with adapter-static) due to this... :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests