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

Continuation of experimental support for Svelte v5 #1

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

xeho91
Copy link

@xeho91 xeho91 commented May 6, 2024

This is an attempt to fully support Svelte v5.

I did not consider supporting the legacy v4.
I'm not sure if we should do it(?). AFAIK, if anyone uses legacy features, they will still work in Svelte v5. However as for this addon, I think it's best to migrate everything - to using runes & snippets. And I meant for what is being internally used there. For example the components Template and Story.

For this reason, I've removed deprecated methods and properties, and used Svelte runes whenever possible.

Removed (breaking changes)

  • Meta component and the codebase (especially in parser) which were related to it
  • refactor of the collect-stories.ts & extract-stories.ts

Issues

  1. Tests emit error that the components should use render from svelte/render instead of mount - I'm not sure how to deal with this one yet. Perhaps using environment variable TEST?
  2. One of the tests is failing, which is related to the above issue. I've got no idea yet how to resolve the case where we can't use setContext on the server side - if we used' the render instead of mount, it would break AFAIK.
  3. Actions tab doesn't work, I couldn't figure out whether is related to the breaking change that on:* should be replaced with on* (removed colon)
  4. Typings for args used in {#snippet children(args)} - no idea yet how to crack this one
  5. Setting the layout in export meta parameters is broken, I can't center while testing it on my personal side project

New features

  1. Improved TypeScript experience while using <Story /> and & <Template /> components
  2. Add helper function typed(meta) to boost TypeScript experience - heavily inspired by Export typed Story and Template components storybookjs/addon-svelte-csf#155

What I haven't done yet

  • Update the examples on the docs
  • Update the tests

@xeho91 xeho91 changed the title support svelte v5 Continuation of experimental support for Svelte v5 May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant