-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Support for Astro components #18356
Comments
I'd also love to see this! Would it be down to Storybook core team to develop this, or the Astro team / community? |
I was just trying out Astro, and I just realized that it does not have support for storybook, which is something I use in next.js, although I think for react components inside astro (using @astro/react) it could work |
It would be awesome to use storybook with astro pages. |
I wonder whether v7.0 being on Vite makes it easier to integrate Astro components 🤔 |
I have not had any serious issues yet using Storybook with Astrojs. My observations thou
That's all |
This ticket's in reference to rendering |
Oh, understood. Support for .astro components would be great |
Is there anything happening soon regarding this topic? Somebody knows, if this is discussed among Storybook/Astro Teams? |
This is one of those open tickets I've checked back in on 20 time or so. Excessively you might say. It's safe to say Astro isn't going to be tossed from our bag of tools anytime soon. In fact it's quickly become the favorite faster than I've personally ever seen. Therefore I'm leaving sentiment finally with a +1 to this. |
I need this so badly! |
Astro uses vite and vite-node together to monitor SSR changes. Storybook works by bootstrapping the UI rendering on top of the existing storybook platform so that it can render the stories in iframes. I get the feeling that trying to bootstrap everything Astro does on top of storybook isn't a simple task, especially for a framework that's still finding its footing. What may be possible is to leverage the UI of Storybook and bootstrap story creation through Astro itself. I actually think it would be very nice if Storybook switched its underlying rendering to Astro across the board, since Astro is already setting itself up to be the defacto framework for island architecture, which complements storybook's test-in-isolation philosophy very nicely. |
+1 |
We're collaborating closely with the Astro team on this, but it's not an easy feat. The main obstacle right now is that Astro doesn't expose a programatic way to render an Astro component, the only way to render a But I know the Astro team is currently hard at work on this exact issue. It remains to be seen whether or not the first iteration of it will be compatible with Storybook's current way of rendering components - mainly that we always do client-side rendering - but it's at least a step in the right direction. |
Also in deep need of this integration! +1 |
Eagerly anticipating this arrival |
Yes, please. |
Also waiting for this. |
It will be awesome! |
Yes please! |
This would be awesome! Following... |
Hoping to be integrated with AstroJS. |
Still hoping that integration can happen in the future |
I would love to have this integration. Astro is currently most used web tooling, and is unlikely to go away soon. |
There is an issue on the Astro repo to track the feature in Astro that would enable support for systems like Storybook. Basically you can't just render an Astro component on its own right now. You need the entire context of the Astro system. This API would allow you to do that outside the context of an Astro "app". |
It's definitely on our radar. We'll reach out the Astro team to try and expedite withastro/roadmap#533 once we've committed to supporting it on the Storybook side! |
Still waiting!) |
+1 |
1 similar comment
+1 |
@shilman how can we contribute to help? |
+1 hope this can be worked out |
Any update ? |
this is great. is someone woking on it? |
I have an astro project with preact components. I am linking in my preact components into storybook, however, the image loading within astro is different from storybook (in astro importing an svg icon produces an object with |
Astro finally released a way to render components in isolation ❤️🚀 hopefully it will enable moving this Storybook feature ❤️🙌 https://github.com/withastro/astro/releases/tag/astro%404.9.0 |
It's still in the early stages, and as far as I know, they don't support props yet (though I might be wrong). |
@abiriadev yup, but I am super happy that something finally started to happen in this area 🙌 |
@marekbrze Of course, I'm excited about this update too! However, it isn't as straightforward as it seems. I did an experiment(repo) and realized that Storybook can't render Astro components on the client(you would probably see a "externalized for browser" warning from vite). Perhaps the ideal renderer should use techniques similar to RSC support? |
Following |
I found this fresh project that can be useful until Storybook supports Astro components: https://github.com/ocavue/astrobook Edit: the downside is that it needs to be a separate instance than the Astro project, but hopefully it will change in the future |
Astrobook added option to run it only on dev env and on selected subpath 🙌❤️ |
Would love to see this implemented. |
+1 |
1 similar comment
+1 |
+1! |
+1 |
for all the "+1" and "following" comments, there is a magnificient reaction function you can use in each issue. This kind of comments only polute the thread and distract from what's been debated |
I started working on a POC yesterday: https://github.com/slawekkolodziej/storybook-astro However, as I have limited experience with the internals of Vite, Astro, and Storybook, I would appreciate any help! Below you can see what I have so far: storybook-astro.mp4 |
Is your feature request related to a problem? Please describe
Astro is a new framework focusing on mostly static sites. It has its own template syntax, very much like jsx.
Describe the solution you'd like
Add ability to include .astro components in your Storybook.
Are you able to assist to bring the feature to reality?
I don't believe I will have the bandwidth / ability to do that - but flagging since I assume more people may be interested.
Additional context
https://astro.build
The text was updated successfully, but these errors were encountered: