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

[Feature Request] Support of Svelte 4 #109

Closed
oscard0m opened this issue Jun 23, 2023 · 10 comments · Fixed by #112
Closed

[Feature Request] Support of Svelte 4 #109

oscard0m opened this issue Jun 23, 2023 · 10 comments · Fixed by #112
Assignees
Labels
enhancement New feature or request released This issue/pull request has been released.

Comments

@oscard0m
Copy link

Describe the feature

Is there a plan to support Svelte 4? I would be happy to help with this if possible.
Storybook has an alpha release in the oven where it will support Svelte v4: storybookjs/storybook#23197

Additional context

https://svelte.dev/blog/svelte-4

@oscard0m oscard0m added the enhancement New feature or request label Jun 23, 2023
@JReinhold
Copy link
Collaborator

I'd be happy to take a look at any PRs adding support for Svelte 4. At the minimum we'd need to bump the versions of svelte and related packages in package.json, similar to what storybookjs/storybook#23197 does. We might need to do more than that, I'm unsure.

@oscard0m oscard0m self-assigned this Jul 3, 2023
@RSWilli
Copy link
Contributor

RSWilli commented Jul 4, 2023

it looks like there is a bit more to do:

I tried to simply update it, but it looks like the @storybook/svelte-webpack5 still requires svelte v3.

The only reference to that module in this project that I can find is in the storybook main.js. Shouldn't it be possible to completely remove this module and use the "standard" vite way of bundling instead of webpack?

@JReinhold
Copy link
Collaborator

Thanks for trying @RSWilli !

  1. The fact that @storybook/svelte-webpack5 still only supports Svelte 3 is an error upstream - by me. I need to update that as well.
  2. That dependency is only used for the internal Storybook to test out the features in this project, it's not used for the actual bundling. I'd be happy for anyone to replace it with @storybook/svelte-vite, it should be doable. I'm not exactly sure why the stuff in webpackFinal is needed, maybe it wouldn't be needed in a Vite based setup, or maybe we need to port it over to the Vite equivalent.

@RSWilli
Copy link
Contributor

RSWilli commented Jul 6, 2023

That's what I suspected, I am going to try again, since addon-svelte-csf is the only dependency that blocks the update to svelte 4 in my repositories.

@JReinhold
Copy link
Collaborator

FYI storybookjs/storybook#23336

@RSWilli
Copy link
Contributor

RSWilli commented Jul 6, 2023

I give up again. I tried, but with the vite loader I am getting errors that I cannot explain. Aka: some of the webpack stuff seems to do something

After your PR it should be easier to update this repo though.

@rory-orennia
Copy link

@RSWilli Storybook has been updated to support svelte 4 now (https://github.com/storybookjs/storybook/releases/tag/v7.0.27) if you wanted to give it another shot. I'm also seeing an issue with HMR where if you change a story the HMR refresh will overwrite all template args with the args from the last story. But I didn't want to raise that issue until this addon properly supports svelte 4

@RSWilli
Copy link
Contributor

RSWilli commented Jul 14, 2023

@rory-orennia I'm at it, although I will not do anything about the HMR issue you mentioned

@rory-orennia
Copy link

@rory-orennia I'm at it, although I will not do anything about the HMR issue you mentioned

My hope was that it's caused by the outdated dependencies. I'll raise the issue after this is merged if it still exists

@shilman
Copy link
Member

shilman commented Jul 19, 2023

🚀 Issue was released in v3.0.4 🚀

@shilman shilman added the released This issue/pull request has been released. label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants