-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 stories in Story index #16673
Comments
I was curious so had a little look, the two issues I can see are: storybook/lib/core-server/src/utils/StoryIndexGenerator.ts Lines 55 to 57 in cc14131
Customisation for this is pretty straightforward via config from the svelte framework but you also get an error here: storybook/lib/csf-tools/src/CsfFile.ts Lines 407 to 410 in cc14131
but I'm not show this can be solved without running some kind of pre-processor. |
Where can I find documentation for this new stories index ? or maybe pointers in the code |
Hello all, First things first: I love Storybook! I've never really used it before starting this recent project. Now that I'm actually using it, I can see how wonderful it is. So, thank you for your contributions to our industry :) Now, to my issue(s)/misunderstanding(s): I just rebuilt my SvelteKit project's Storybook configuration due to some changes related to adding Vitest to the project. The additions seemed to have caused the following error to my existing, and working, Storybook implementation:
The full error is similar to what's seen here: https://stackoverflow.com/questions/68049006/why-is-vite-throwing-import-error-in-sveltekit-javascript. I believe this is due to the addition of
After adding a few dependencies and manual config changes (TailwindCSS and fixing ES Module v. CommonJS syntax), I discovered the combination of
Flipping My question (issue): Is flipping Here's my project repo, if you are curious: https://github.com/cerebrl/forgerock-web-login-framework. It's fairly simple project at the moment. Thanks, again. Hope to hear from you soon <3 |
@cerebrl everything you said is correct. this is a limitation of the svelte CSF format and the reason we've referred to it as experimental. the workaround you mentioned is the recommended workaround. there are other ecosystem limitations as well. for example, we recently announced a test runner and it is not fully compatible with Svelte CSF stories. I'd like to resolve this issue one way or another in the coming months, but for now it's a bit of a mess. Thanks for your patience! |
Thanks for the super quick response, @shilman! I did notice I could write the stories in regular |
@cerebrl It's really up in the air. I'm sure we'll come up with something good. I posted this in discord yesterday about CSF3 which has a lot of nice ergonomics but lacks the ability to define compositions of Svelte components the way Svelte CSF does.
I think we'll figure this out in the next few months. In the meantime, CSF3 is the "safe" bet, because it is 100% supported and compatible with the growing Storybook ecosystem (testing, design handoff, perf optimizations, etc). But composing components ergonomically is a pretty big deal and we absolutely need to handle that much better to provide a first class experience. |
@shilman, I can't thank you enough for your time. I've joined the Discord community, and I'll continue there with any future questions that I might have. I've gone ahead and switched to CSF3 (rather than using Svelte CSF) and think that's the right decision. If needed, I'll just compose my components in a separate Svelte file, probably Again, thank you! |
This has been implemented in storybookjs/addon-svelte-csf#69, and is supported in storybook 7.0 and |
Storybook v7 is based on a story index. Which currently doesn't support svelte native stories. We should fix this!
The text was updated successfully, but these errors were encountered: