-
Notifications
You must be signed in to change notification settings - Fork 32
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
Experimental support for Svelte 5 #181
Conversation
This reverts commit 6e5ccae.
Oh sorry I took for granted the depandabot branch, thanks for helping! Now this is going back to
Tried with 5.0.0--canary.181.82ac172.0 but same result |
🚀 PR was released in |
Happy to see this get an official release! Glad I could help getting this kickstarted 😁 👍 |
Caution
This is still a work in progress 🚧.
Breaking changes may occur at any time, so do not use it for other purposes than experimenting yet.
Credits
Additional goals
Resources
Tip
Call for contribution on the demo (by add missing or improving examples) to help us find potential issues. Some of them we can fix the next major version 🙏.
Breaking changes
webpack
- See discussion [RFC] Official support for Svelte CSF storybook#27092<Meta />
component<Template />
component in favor of Svelte snippets<Story />
components no longer has a propautodocs
, usetags={['autodocs']}
instead<Story />
components no longer has a propsource
, we've revamped the behaviour< v7.4
New features
defineMeta({ ... })
- works in TypeScript and with JSDocsetTemplate
to allow adding a default{#snippet children()}
to all of the<Story>
in the stories file.Args<typeof Story>
andStoryContext<typeof Story>
to get typings while creating Svelte v5 snippets outside the<Story />
TODO
indexer.ts
- it uses Svelte AST fromsvelte.compile
to extract the data required for indexerestree-walker
tozimmerframe
,modernAst
option in thesvelte.compile
<Meta>
and<Template>
component<Story>
to use Svelte 5 featurescontext
to use Svelte 5 runes instead ofwritable()
stories/
source
in componentStory
, see: Experimental support for Svelte 5 #181 (comment) and comment: Experimental support for Svelte 5 #181 (comment)./ERRORS.md
(below are the error categories):PARSER_EXTRACT_SVELTE
PARSER_EXTRACT_COMPILED
PARSER_ANALYSE_DEFINE_META
PARSER_ANALYSE_STORY
./examples/
directoryMIGRATION.md
guideREADME.md
CHANGELOG.md
with migration guide, new prerequisites and breaking changesIssues
Legend:
Related to tests
🟡 Tests emit error that the components should userender
fromsvelte/render
instead ofmount
- I'm not sure how to deal with this one yet. Perhaps using environment variableTEST
?🟡 Related to above. It seems we can't usesetContext
during the tests - we used' therender
instead ofmount
, it will break while runningvitest
, AFAIK.@storybook/vite-builder
&@storybook/svelte-vite
). Based the compiled output, I want to test the snippets which analyse/extract AST nodes from the compiled output. To see if creating appendix to the compiled output works as expected.Related to runtime
Actions
tab doesn't work, I couldn't figure out whether is related to the breaking change thaton:*
should be replaced withon*
(removed colon)Typings forargs
used in{#snippet children(args)}
- no idea yet how to crack this oneSetting thelayout
in export meta parameters is brokenImporting thezimmerframe
fails due tovite
not being able to getexports
correctly - current workaround to continue developing: manual overrideimport
todefault
in./node_modules/zimmerframe/package.json
.🔴 Inserting HTML comments as description &<Story>
doesn't work in the development mode - see: Experimental support for Svelte 5 #181 (comment)Related to TypeScript
🟡 Stories with requiredchildren
snippet, and not being explicitly set. See comment: Experimental support for Svelte 5 #181 (comment)🟡 Experimental support for Svelte 5 #181 (comment)📦 Published PR as canary version:
5.0.0--canary.181.26b0f68.0
✨ Test out this PR locally via:
npm install @storybook/addon-svelte-csf@5.0.0--canary.181.26b0f68.0 # or yarn add @storybook/addon-svelte-csf@5.0.0--canary.181.26b0f68.0
Version
Published prerelease version:
v5.0.0-next.0
Changelog
💥 Breaking Change
🐛 Bug Fix
Authors: 4