Repository navigation
Replies: 4 comments
|
Are the advantages and differences documented somewhere? I did not know the web components version could do this and it seems mostly the same as the html version that I used in the past with stencil (per an older tutorial). |
|
I've been using the |
|
Hi, I'm a maintainer of FAST as well as Fluent Web Components where we're using
We have a I think a bigger issue is that the automatic control generation handled by |
|
Throwing our use case into the ring here. My team uses @storybook/web-components with Lit, instead of using the out of the box control generation we leverage this addon alongside this analyzer, I've documented our process here. To be fair I've never thought that the web-components exporter purely relied on Lit, but even if I wasn't using Lit I'm not sure that that'd have stopped me if it's used purely as a convenience to render HTML in a story. While I appreciate I can render things directly, using my own framework of choice, writing other framework code within the context of Storybook is not unfamiliar, for example we have to write React components already for Storybook doc blocks. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Re-export Lit’s
htmltemplate tag from@storybook/web-componentsto improve adoption among non-Lit WC users, who mistakenly think that Storybook WC is Lit-specific.Problem Statement
@storybook/web-componentsuses Lit for custom render functions:Thanks to its peer dependency on
litand the import in the story file, there is a preconception that Storybook WC is somehow Lit-specific.As a result of this misunderstanding, users of other WC frameworks such as FAST often use
@storybook/html, and forego benefits of@storybook/web-componentslike automatic control generation.Non-goals
Different WC folks have proposed making it possible to to provide custom render function handlers so that users can create their own. This is already possible, but we have not documented it because we don't want to increase the surface area and fragment the space.
Implementation
To solve this problem, we propose re-exporting
htmlfrom@storybook/web-componentsrenderer and the frameworks@storybook/web-components-vite/@storybook/web-components-webpack5. Thelitpeer dependency would become alit-htmldependency, and the story import would change as well:NOTE: Render function can also return a plain HTML string as its output.
Prior Art
???
Deliverables
lit-htmland re-exporthtmlfrom the renderer (@storybook/web-components) and frameworks (@storybook/web-components-vite,@storybook/web-components-webpack5).@storybook/htmland@storybook/web-componentsdocs that@storybook/web-componentsis the recommendation for all WC projects.Risks
litin their stories than justhtml, and we need to add a fulllitdependency instead and export more utilities (litdepends onlit-html).Unresolved Questions
No response
Alternatives considered / Abandoned Ideas
No response
All reactions