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 support / migration #159

Open
techniq opened this issue May 16, 2024 · 6 comments
Open

Svelte 5 support / migration #159

techniq opened this issue May 16, 2024 · 6 comments
Milestone

Comments

@techniq
Copy link
Owner

techniq commented May 16, 2024

Creating an overarching issue to track migrating to Svelte 5.

The plan is for LayerChart 1.x to support Svelte 3, 4, and 5 by not leveraging Svelte 5 specific features like runes and snippets, and 2.x+ will leverage these Svelte 5 specific features.


Outstanding Svelte 5 issues:


Issues that should be investigated:

@techniq techniq pinned this issue May 17, 2024
@oneezy
Copy link

oneezy commented Nov 30, 2024

any headway on 2.x ? i noticed that the latest version uses svelte 5 but didnt' see a next version using runes yet

@techniq
Copy link
Owner Author

techniq commented Dec 3, 2024

@oneezy The docs are using Svelte 5, but I haven't started migrating to runes/snippets just yet. Just got back from a family vacation and transitioning jobs this/next week, but plan to start the migration in a couple of weeks. I've got my eye on the Migration Magician SvelteHack category and we'll see if I can make the Jan 9th deadline. I'm migrating Svelte UX as well...

One thing I need to figure out is @mhkeller's Svelte 5 roadmap for LayerCake. I've been contemplating removing LayerCake as a dependency (at least initially) which would simplify some context and possibly open up additional improvements.

Stay tuned, but should see some progress soon. I need to drop a 1.x release for both projects first as this will continue to be Svelte 3-5 compatible, and 2.x+ will be Svelte 5 only (since it will leverage runes, snippets, etc).

@ccalobeto
Copy link

Waiting with anxiety about the svelte 5 migration.

@vijay8i
Copy link

vijay8i commented Jan 1, 2025

Hi! 👋

My project uses Svelte 5 in strict runes mode and trying to use layerchart results in the following error:

 'Cannot use `export let` in runes mode — use `$props()` instead'

FWIW, I am including this patch that let's me get past the error; and I think might benefit others if you could apply it in an interim release before reaching native Svelte 5 support which I can see is not an insignificant amount of work. Please disregard if this is not worth your time.

I am attaching the patch file in case it makes it easier to make that release.

PS: I have submitted a similar patch to layercake as well.
layerchart+0.60.3.patch

@techniq
Copy link
Owner Author

techniq commented Jan 1, 2025

Hey @vijay8i. That's interesting. I see the patch is adding...

<svelte:options runes={false} />

to all the components. As long as setting this option doesn't have any Svelte 3/4 compat issues (complains the option doesn't exist, etc), I'm fine with adding it as a temporary solution to improve Svelte 5 compat. If you could validate the change works with Svelte 4 and submit a PR, I'll happily merge it.

I haven't been as active on LayerChart development in December due to changing jobs and holidays with family (and a few other items), but plan to start the Svelte 5 migration (as next branch / releases) very soon. I'm wrapping some outstanding PRs and will be making a 1.0 release which will retain Svelte 3-5 compatibility and then start the Svelte 5 rune/snippet/etc migration, along with a few bigger changes.

I'm currently working on overhauling how Canvas integration works which will make it much more robust and simplier. The initial work has started in [PR ](#295), but the bigger change I hope to start this week. It's the biggest blocker for Svelte 5 migration work.

@techniq techniq added this to the v2 milestone Jan 1, 2025
@vijay8i
Copy link

vijay8i commented Jan 2, 2025

Hi @techniq,

I'm fine with adding it as a temporary solution to improve Svelte 5 compat. If you could validate the change works with Svelte 4 and submit a PR, I'll happily merge it.

I don't think this patch will work with Svelte 4 or below. This option was introduced in Svelte 5, so pretty iffy to even try on anything lower. The intent of my comment was to hope that you could add this to next branch that is meant to move to runes while still working on it.

I haven't been as active on LayerChart development in December due to changing jobs and holidays with family (and a few other items), but plan to start the Svelte 5 migration (as next branch / releases) very soon.

I understand. Fwiw, you are way ahead than most of us in our aspirations to build and maintain an open source library that offers utility and is used widely. More power to you.

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

4 participants