You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
@storybook/web-components expects that stories can return Lit-specific return types like TemplateResult. This coupling is unfortunate because not every web component developer uses Lit. It also means that CSF renders need to have Lit support built-in. It would be great if instead CSF modules were completely self-contained by bringing their own renderer.
Describe the solution you'd like
It seems like we could have much more portable stories that don't require detecting the return type of story render functions and don't even require Storybook or alternate story renders to have any dependencies on the framework used to render stories by making the storyResult type be void.
This way stories would be entirely self-contained, and instead of returning a lit-html template from render(), render() would just be responsible for rendering to the canvas element.
This solution should actually work with any framework so that even Storybook wouldn't need any specific framework support built-in.
Describe alternatives you've considered
No response
Are you able to assist to bring the feature to reality?
yes, I can
Additional context
I am working on a web components catalog and am considering using CSF as the story format, but don't want to build Lit support directly into the catalog. If we use CSF, we might say that we only support CSF modules that are self-contained in this way.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe
@storybook/web-components
expects that stories can return Lit-specific return types like TemplateResult. This coupling is unfortunate because not every web component developer uses Lit. It also means that CSF renders need to have Lit support built-in. It would be great if instead CSF modules were completely self-contained by bringing their own renderer.Describe the solution you'd like
It seems like we could have much more portable stories that don't require detecting the return type of story render functions and don't even require Storybook or alternate story renders to have any dependencies on the framework used to render stories by making the storyResult type be
void
.This way stories would be entirely self-contained, and instead of returning a lit-html template from
render()
,render()
would just be responsible for rendering to the canvas element.So the metadata export would go from:
to:
Then to render a story module, one only needs to fetch it and call the render function:
This solution should actually work with any framework so that even Storybook wouldn't need any specific framework support built-in.
Describe alternatives you've considered
No response
Are you able to assist to bring the feature to reality?
yes, I can
Additional context
I am working on a web components catalog and am considering using CSF as the story format, but don't want to build Lit support directly into the catalog. If we use CSF, we might say that we only support CSF modules that are self-contained in this way.
The text was updated successfully, but these errors were encountered: