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

Demonstration of description #2

Merged
merged 7 commits into from
May 16, 2024
Merged

Demonstration of description #2

merged 7 commits into from
May 16, 2024

Conversation

xeho91
Copy link
Collaborator

@xeho91 xeho91 commented May 13, 2024

Issues

  1. JSDoc meta descriptions are lost with lang="ts". [Bug] JSDoc description disappears with lang="ts" addon-svelte-csf#175
  2. Encountered issue with setting the description in the Svelte CSF format, above the export const meta.
  3. In the Svelte CSF format, setting explicitly the description inside the <Story /> component via parameter prop doesn't work, nor override the comment.
  4. In the current version of @storybook/addon-svelte-csf <Story> and <Template /> component, it doesn't have typings for tags prop, so the TypeScript will complain - which is unrelated to the subject of this demonstration.
  5. Might need to wait for Tags: Add project tags, negation, dev/autodocs/test system tags storybook#26634 to be released, so we can improve the examples showcase for this case.

@xeho91
Copy link
Collaborator Author

xeho91 commented May 13, 2024

FYI.

Regarding the issue 1. and 3., I have solved them while I was working on the experimental support for Svelte v5 (on @storybook/addon-svelte-csf). I had to refactor the parser.

Copy link
Collaborator

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! ❤️

Added some very minor comments

Encountered issue with setting the description in the Svelte CSF format, above the export const meta

Could you elaborate on this?

In the Svelte CSF format, setting explicitly the description inside the component via parameter prop doesn't work, nor override the comment.

Great find! Sounds like a regular bug.

In the current version of @storybook/addon-svelte-csf <Story> and <Template /> component, it doesn't have typings for tags prop, so the TypeScript will complain - which is unrelated to the subject of this demonstration.

Thanks!

Might need to wait for storybookjs/storybook#26634 to be released, so we can improve the examples showcase for this case.

This is already in the 8.1.0 beta which we're using in this repo, so it should be fine.

src/docs/DescriptionExplicit.stories.svelte Outdated Show resolved Hide resolved
src/docs/DescriptionExplicit.stories.svelte Outdated Show resolved Hide resolved
src/docs/DescriptionExplicit.stories.ts Outdated Show resolved Hide resolved
src/docs/DescriptionExplicit.stories.ts Outdated Show resolved Hide resolved
src/docs/DescriptionFromComment.stories.svelte Outdated Show resolved Hide resolved
src/docs/DescriptionFromComment.stories.ts Outdated Show resolved Hide resolved
src/docs/DescriptionFromComment.stories.ts Outdated Show resolved Hide resolved
src/docs/DescriptionFromComment.stories.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@xeho91
Copy link
Collaborator Author

xeho91 commented May 13, 2024

Encountered issue with setting the description in the Svelte CSF format, above the export const meta

Could you elaborate on this?

What I recall from refactoring the parser in @storybook/addon-svelte-csf, there was a small issue with not being able to read the leading comment while using lang=ts. I don't remember the exact reason of what caused it, but I think it was execution order with preprocess at compile. I can take a look at it tomorrow.

@xeho91 xeho91 merged commit bf6aeb0 into main May 16, 2024
4 checks passed
@xeho91 xeho91 deleted the description branch May 16, 2024 05:31
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.

2 participants