routify icon indicating copy to clipboard operation
routify copied to clipboard

Update peerDependencies to prevent `npm install` conflicts

Open yairkukielka opened this issue 1 year ago • 7 comments

Helllo! Would it be possible to update peerDependencies so we don't have to use the npm overrides field?

Using svelte 4 and vite 5 I'm getting these warnings when I run npm install:

           
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @sveltejs/[email protected]
npm WARN Found: [email protected]
npm WARN node_modules/vite
npm WARN   dev vite@"^5.2.10" from the root project
npm WARN   5 more (@roxi/routify, @sveltejs/vite-plugin-svelte, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer vite@"^4.0.0" from @sveltejs/[email protected]
npm WARN node_modules/@roxi/routify/node_modules/@sveltejs/vite-plugin-svelte
npm WARN   @sveltejs/vite-plugin-svelte@"^2.4.6" from @roxi/[email protected]
npm WARN   node_modules/@roxi/routify
npm WARN   1 more (@sveltejs/vite-plugin-svelte-inspector)
npm WARN 
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/vite
npm WARN   peer vite@"^4.0.0" from @sveltejs/[email protected]
npm WARN   node_modules/@roxi/routify/node_modules/@sveltejs/vite-plugin-svelte
npm WARN     @sveltejs/vite-plugin-svelte@"^2.4.6" from @roxi/[email protected]
npm WARN     node_modules/@roxi/routify
npm WARN     1 more (@sveltejs/vite-plugin-svelte-inspector)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @sveltejs/[email protected]
npm WARN Found: [email protected]
npm WARN node_modules/vite
npm WARN   dev vite@"^5.2.10" from the root project
npm WARN   5 more (@roxi/routify, @sveltejs/vite-plugin-svelte, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer vite@"^4.0.0" from @sveltejs/[email protected]
npm WARN node_modules/@roxi/routify/node_modules/@sveltejs/vite-plugin-svelte/node_modules/@sveltejs/vite-plugin-svelte-inspector
npm WARN   @sveltejs/vite-plugin-svelte-inspector@"^1.0.4" from @sveltejs/[email protected]
npm WARN 
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/vite
npm WARN   peer vite@"^4.0.0" from @sveltejs/[email protected]
npm WARN   node_modules/@roxi/routify/node_modules/@sveltejs/vite-plugin-svelte/node_modules/@sveltejs/vite-plugin-svelte-inspector
npm WARN     @sveltejs/vite-plugin-svelte-inspector@"^1.0.4" from @sveltejs/[email protected]

I needed to add this section to my package.json to make npm happy:

        "@sveltejs/vite-plugin-svelte": "$@sveltejs/vite-plugin-svelte",
        "@roxi/routify": {
            ".": "$@roxi/routify",
            "vite": "$vite",
            "svelte": "$svelte"
        }

Also, in package.json I use "@sveltejs/vite-plugin-svelte": "^3.1.0", because it's imported by vite 5.

How to fix

I think if we add this to the "peerDepenencies" field in routify package.json it would get resolved:

    "peerDependencies": {
        "vite": "4 || 5",
        "svelte": ">=4",
        "@sveltejs/vite-plugin-svelte": ">=2"
    },

yairkukielka avatar Apr 26 '24 19:04 yairkukielka

Hi @yairkukielka , thanks for sharing this. Is this issue related to R2 or R3?

jakobrosenberg avatar Apr 29 '24 09:04 jakobrosenberg

R3

yairkukielka avatar Apr 30 '24 13:04 yairkukielka

Actually, we should probably just do

"peerDependencies": {
        "vite": "4 || 5",
        "svelte": "3 || 4",
        "@sveltejs/vite-plugin-svelte": ">=2"
    },

Since this package doesn't seem to work with Svelte 5 yet

yairkukielka avatar May 16 '24 14:05 yairkukielka

So far I'm only aware of one issue with Svelte 5. I don't know if it's a bug, but when passing data through <slot mydata="hello world" /> the passed mydata seems to be an empty store if nothing is passed.

I have a small fix for it, but it needs further investigation.

EDIT, this issue affects Routify itself and not just Routify projects as Routify uses slot properties internally.

jakobrosenberg avatar May 16 '24 17:05 jakobrosenberg

Hi, I added a separate issue for Svelte 5 support: https://github.com/roxiness/routify/issues/554

yairkukielka avatar May 17 '24 11:05 yairkukielka

Hello @jakobrosenberg Were you able to push that fix? Given that Svelte 5 was released recently, are there any remaining blockers from using roufity 3 with svelete 5? Thanks!

kefahi avatar Oct 24 '24 01:10 kefahi

@kefahi sorry about the slow reply.

The only blocker now is SSR/SSG. If you don't need server rendering, I'm not aware of any bugs.

jakobrosenberg avatar Nov 05 '24 11:11 jakobrosenberg