generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Open
xeho91
wants to merge
158
commits into
next
Choose a base branch
from
experimental-support-svelte-v5
base: next
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 6e5ccae.
JReinhold
added
enhancement
New feature or request
major
Increment the major version when merged
and removed
skip-release
Preserve the current version when merged
labels
May 14, 2024
xeho91
commented
Jun 6, 2024
xeho91
commented
Jun 6, 2024
xeho91
commented
Jun 6, 2024
JReinhold
reviewed
Jun 6, 2024
…js/addon-svelte-csf into experimental-support-svelte-v5
Goal: Prepare directory `parser/` for writing tests
…js/addon-svelte-csf into experimental-support-svelte-v5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Done
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/
Issues
Legend:
Related to build
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
🟡 Experimental support for Svelte 5 #181 (comment)New features
defineMeta({ ... })
- works in TypeScript and with JSDoc<Story />
can have a propname
omitted - it will be set toDefault
setTemplate
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 snippets outside the<Story />
TODO (to be done in this PR or the next one)
source
in componentStory
, see: Experimental support for Svelte 5 #181 (comment) and comment: Experimental support for Svelte 5 #181 (comment)📦 Published PR as canary version:
5.0.0--canary.181.2e3e102.0
✨ Test out this PR locally via:
npm install @storybook/addon-svelte-csf@5.0.0--canary.181.2e3e102.0 # or yarn add @storybook/addon-svelte-csf@5.0.0--canary.181.2e3e102.0