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

Rewrite Svelte adapter with Svelte v5 syntax #448

Open
inokawa opened this issue May 14, 2024 · 6 comments
Open

Rewrite Svelte adapter with Svelte v5 syntax #448

inokawa opened this issue May 14, 2024 · 6 comments
Labels
good first issue Good for newcomers

Comments

@inokawa
Copy link
Owner

inokawa commented May 14, 2024

Related to #323

Try it after v5 becomes popular enough.

@gyzerok
Copy link

gyzerok commented Sep 12, 2024

What qualifies as enough?

Seems like it's quite close to stable and most people use version 5 for new projects.

And so are we and now looking for a virtual list solution. Would it make sense to just wait some weeks/months for the update or better go figure it out by ourselves?

@inokawa
Copy link
Owner Author

inokawa commented Sep 13, 2024

Svelte 4 syntax seems to work on both 4 and 5, otherwise 5 syntax only works on 5. An OSS should be backward compatible as much as possible so there is no strong reason to migrate for now.

@gyzerok
Copy link

gyzerok commented Oct 10, 2024

@inokawa seems like virtua can't be installed for Svelte 5 project due to dependency conflict, because it expects only version 4 in package.json

❯ npm install virtua
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/svelte
npm error   peer svelte@"^5.0.0-next.1" from @skeletonlabs/[email protected]
npm error   node_modules/@skeletonlabs/floating-ui-svelte
npm error     @skeletonlabs/floating-ui-svelte@"^0.3.1" from the root project
npm error   peer svelte@"^4.0.0 || ^5.0.0-next.0" from @sveltejs/[email protected]
npm error   node_modules/@sveltejs/kit
npm error     peer @sveltejs/kit@"^2.0.0" from @sveltejs/[email protected]
npm error     node_modules/@sveltejs/adapter-auto
npm error       dev @sveltejs/adapter-auto@"^3.2.3" from the root project
npm error     peer @sveltejs/kit@"^2.0.0" from @sveltejs/[email protected]
npm error     node_modules/@sveltejs/adapter-static
npm error       dev @sveltejs/adapter-static@"^3.0.3" from the root project
npm error     1 more (the root project)
npm error   7 more (@sveltejs/vite-plugin-svelte, ...)
npm error
npm error Could not resolve dependency:
npm error peerOptional svelte@">=4.0" from [email protected]
npm error node_modules/virtua
npm error   virtua@"*" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/svelte
npm error   peerOptional svelte@">=4.0" from [email protected]
npm error   node_modules/virtua
npm error     virtua@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

@thevincentlee
Copy link

Hi @inokawa, I agree with @gyzerok's suggestion.

I believe it is necessary to be compatible. The Svelte 5 API is now stabilizing. The official team also recommends using Svelte 5 directly, and migration tools have been released.

https://svelte-5-preview.vercel.app/docs/old-vs-new
https://x.com/dummdidumm_/status/1844750782647685151

@inokawa
Copy link
Owner Author

inokawa commented Oct 14, 2024

The peer dependency issue seems to be not inevitable, because 5.0.0-next.263 doesn't match >=4.0 semver (but 5.0.0 matches it).
npm/npm#8854

So after the Svelte 5.0.0 release would be the reasonable timing to release our v5 components. I'll try to migrate virtua after that timing, of course PR welcome.

@inokawa inokawa added the good first issue Good for newcomers label Oct 14, 2024
@gyzerok
Copy link

gyzerok commented Oct 14, 2024

I think ^4.0.0 || ^5.0.0 could be used to do this

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

No branches or pull requests

3 participants