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

Svelte 5 compatibility #144

Open
techniq opened this issue Nov 29, 2023 · 7 comments
Open

Svelte 5 compatibility #144

techniq opened this issue Nov 29, 2023 · 7 comments

Comments

@techniq
Copy link
Owner

techniq commented Nov 29, 2023

Issue to track any Svelte 5 compatibility issues. Hoping close to 0 changes are required in Svelte UX to support 5.


FIXED: can only receive attributes, not directives

issue: sveltejs/svelte#10382
fix: sveltejs/svelte#10391


FIXED: type attribute must be a static text value if input uses two-way binding

Fixed via: sveltejs/svelte#9713
Reported in discord. If ran within the Svelte 5 beta (ex. 5.0.0-next.15), currently Input throws a 'type' attribute must be a static text value if input uses two-way binding error

image


FIXED: let directive on <svelte:self>

issue: sveltejs/svelte#9710
fix: sveltejs/svelte#9727

@CropWatchDevelopment
Copy link

I found a fix for this, I made a PR #145.
There is one more problem with TreeList.svelte, but I am hoping to get early feedback on this fix first!

@techniq
Copy link
Owner Author

techniq commented Nov 30, 2023

Thanks @CropWatchDevelopment, but it looks like this is a regression with the Svelte 5 compiler (see issue and Twitter/X discussion, including confirmation by Simon (Svelte/Vercel team).

I also found a workaround using <svelte:element>, although I would prefer to wait for it to be fixed upstream (which it should be). It looks like Svelte 3/4 had an explicit check for bind:this that likely was overlooked as part of the Svelte 5 rewrite, so likely the fix will be similar (and hopefully as simple).

Would it be OK if we wait a bit to see if this is resolved upstream before we consider a workaround?

I'm curious what you found in TreeList.

@CropWatchDevelopment
Copy link

100% Yes OK to wait until later. After checking the Svelte repo and seeing all of the v5 issues logged. I am thinking I may wait a few months even before making the move. It seems like v5 may take a bit be fully worked out :) I will pull down the PR, but Hope to help out in the future!

@techniq
Copy link
Owner Author

techniq commented Nov 30, 2023

100% Yes OK to wait until later. After checking the Svelte repo and seeing all of the v5 issues logged. I am thinking I may wait a few months even before making the move. It seems like v5 may take a bit be fully worked out :) I will pull down the PR, but Hope to help out in the future!

FWIW, the bind:this issue is already fixed and should be on 5.0.0-next.16 once released (already on the preview REPL). I was going to test my StackBlitz until I realize .16 wasn't published yet.

TBH, that's my plan ATM. As much as I love all the great things coming in Svelte 5, I personally will wait closer to the official release before I focus too much on it. My plan is for Svelte UX (and LayerChart) 1.0 releases to be fully compatibility with Svelte 3/4/5, and 2.0 I'll probably start embracing some of the Svelte 5 features (runes, snippets, etc) which will likely break 3/4 compatibility, but as long as 5 is a drop in replacement for 3/4, I think that's a fair tradeoff.

Just the speed/size improvements in 5 running non-rune mode is exciting.

Thanks for the PR and discussion.

@dimfeld
Copy link
Contributor

dimfeld commented Feb 3, 2024

Filed sveltejs/svelte#10382 because SelectField.svelte fails to compile with latest Svelte 5.

CleanShot 2024-02-02 at 20 42 27

@techniq
Copy link
Owner Author

techniq commented Feb 3, 2024

Thanks @dimfeld for submitting the upstream issue with repo. I've updated this issue's description to make it easy to track any known Svelte 5 compatibility issues. The Svelte team has been amazingly fast resolving these thus far.

@dimfeld
Copy link
Contributor

dimfeld commented Feb 5, 2024

Haven't tried it but I think this will hit svelte-ux as well sveltejs/svelte#10395

edit: this one is fixed now

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

3 participants