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 5 #1041

Open
curran opened this issue Oct 21, 2024 · 8 comments
Open

Support Svelte 5 #1041

curran opened this issue Oct 21, 2024 · 8 comments

Comments

@curran
Copy link
Collaborator

curran commented Oct 21, 2024

Currently VizHub support Svelte 4.

It should support Svelte 5 which is way better, and is now stable.

This would be a good place to start:

https://github.com/vizhub-core/vizhub/blob/main/runtime/src/v3Runtime/transformSvelte.ts

@curran
Copy link
Collaborator Author

curran commented Oct 21, 2024

@curran
Copy link
Collaborator Author

curran commented Oct 21, 2024

Worth tracking if the Svelte REPL gets Svelte 5 support

https://svelte.dev/repl/hello-world?version=4.2.19

Looks like not yet. When they do work on that, we can probably do the same in VizHub.

@higsch
Copy link

higsch commented Oct 22, 2024

There's a Svelte 5 REPL here: https://svelte-5-preview.vercel.app
Code seems to be here: https://github.com/sveltejs/svelte/tree/main/sites/svelte-5-preview

@curran
Copy link
Collaborator Author

curran commented Oct 22, 2024

Oh amazing! That's extremely helpful. Thank you for sharing that!

@curran
Copy link
Collaborator Author

curran commented Oct 22, 2024

I think I found it!

It's really nice that this is already done as a self-contained Web Worker. There's a real possibility we could just copy in that entire Web Worker implementation into the VizHub codebase and use it as-is, replacing the old Svelte implementation.

@higsch
Copy link

higsch commented Oct 23, 2024

Do you have time to implement it in the next days? I'm not feeling very confident to change the VizHub code. 😬 And it would be great to use Svelte 5 for courses right away.

@curran
Copy link
Collaborator Author

curran commented Oct 23, 2024

No, I don't think I'll be able to do this in the next few days. There is a slight chance, but I have a lot going on at the moment.

If anyone else wants to take a stab at it, that possibility is open! I can support a developer to get the env up and running via the VizHub Discord. If anyone picks this up, feel free to ping me in Discord. Cheers!

@higsch
Copy link

higsch commented Nov 12, 2024

I tried changing the svelteUrl in runtime/src/v3Runtime/transformSvelte.ts to https://cdn.jsdelivr.net/npm/[email protected].
I also changed the svelteCompilerUrl to export const svelteCompilerUrl = ${svelteURL}/compiler/index.js``.

However, the current implementation needs access to svelte/internal (https://cdn.jsdelivr.net/npm/[email protected]/src/internal/) which is forbidden in Svelte version 5+. See lines 63ff in transformSvelte.ts.

So we have to find a solution without using svelte/internal.

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

2 participants