-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 #25178
Comments
It's still too early in Svelte 5's development cycle for us to do anything meaningful with it beyond what we've already done. It's still unclear if Svelte 5 will release before Storybook 8, and if not we of course can't drop support for Svelte 4 in Storybook 8. We should put this issue on ice until Svelte 5 is further along, and revisit when we have a clearer picture of features and the timeline. |
@valentinpalkovic @yannbf @JReinhold let's scope this out of the breaking changes project for now. |
Hi there! Thank you for opening this issue, but it has been marked as |
@JReinhold, Just checking if is there any plan to support v5 for the final version of storybook v8. v5 has gone through around 64 revisions. Appreciate your thoughts here. It will help me decide when to get onto the v5 bandwagon. |
@bhvngt given that Storybook 8 is almost ready to release an RC, it's very unlikely that Storybook 8 will have full support for Svelte 5. |
It looks like there were attempts to introduce svelte5 support as part of the v8 work, I can see various references in the codebase but sadly still can't get it working locally.
@vanessayuenn if we shouldn't expect "full support", does that mean there will be some support? If so, is there any guide or docs that describe how to achieve a working setup? Ideally, the storybook builder would take the existing (working) vite config and use that directly. |
@RobinKnipe version Let me know if it doesn't work for you. |
Thanks @JReinhold for adding the support. I tried to use this with @storybook/addon-svelte-csf support. I am using 4.1.2.next-0 which from its release notes should be supporting storybook 8. Though, this may not yet have the support for svelte-5. I am getting following error
Here's the link to the reproduction of this error. |
@JReinhold great news! Always awesome to hear oh that thing you wanted, it was "just released an hour ago"! 🚀 |
@JReinhold @RobinKnipe Svelte Team release their first Svelte 5 release candidate, do you think you might include the support of it in your roadmap? |
This issue is rather misleading and outdated.
As for the Svelte CSF addon, we're hard at work with adding support for Svelte 5 in storybookjs/addon-svelte-csf#181. As for docs, we have a separate RFC outlining the plan at #27092 That leaves us with updating the example components and stories that are generated when initialising a new Storybook. I don't think that is so important that we need a tracking issue like this. We might even wait with updating those until we drop support for Svelte 4. If you experience any issues with Svelte 5 and Storybook, feel free to open bug reports. Closing as outdated. |
Hello, I'm trying to use storybook with Svelte 5, I've looked but cannot find any info on what changes I need to make in order to get Svelte 5 to work with Storybook 8, but according to the last comment it should work? Any link to guidance would be appreciated. |
@jhechtf if Storybook doesn't work with your Svelte 5 project, please open an issue with a minimal reproduction, showing off the problems you're experiencing in a minimal project. See https://storybook.js.org/docs/contribute/how-to-reproduce |
#24889 added initial support for the current Svelte 5 prereleases (
next.17
at the time of writing).Svelte 5 is not out in stable yet and things might still change until then. This issue is an attempt at keeping track of those changes. Unfortunately I don't think we can close this issue completely until Svelte 5 has gone GA.
Here are some known tasks we know we need to get done:
Tasks
Drop support for
on:X
handlersThe current Svelte 3+4 renderer supports attaching events handlers to custom component events (eg.
<Button on:click={callback} />
) by settingargs.on.click
. This is very lightly (or not at all) documented, however it is activated automatically by our argTypes inferencer.Svelte 5 deprecates this type of "traditional" event handler but still supports it. However you can't attach handlers to a dynamic component instance anymore in Svelte 5, so we can't actually attach these handlers. That's why we can't support this anymore in Svelte 5.
The only migration possible here is for users to migrate to the new event handlers which are just regular props and set a callback directly on the arg, similar to how you would do it for a React story today.
In practice we've had to skip the addon-actions test in Svelte 5 because the action is not automatically attached as an event handler.
Drop support for Svelte 4
There are arguments for and against dropping support for Svelte 4. I'm strongly leaning towards dropping support and @shilman is initially on board with that, but I can be persuaded otherwise.
Why we should drop it
Why we should keep supporting it
Update example stories+components
We should update all example components and stories to use the new Svelte 5 syntax. Especially because this is the only way to attach event handlers in Svelte 5.
The text was updated successfully, but these errors were encountered: