Live data from Hacker News

Storybook 8

storybook.js.org

31–38 of 38 posts

Re: Storybook 8

#31
post #14

I just tried Storybook this past week and it's a great improvement even from version 6.x. That said, I wish this was at a place where I could easily use it for the UI layer with simple integration into a given CMS. As others have stated, it's great in isolation and for demos. Also, I realize that most apps and CMSes are so opinionated and using Storybook for the view of that system is a lot of overhead. One less than…

Interesting! What would the integration between Storybook and a CMS such as Wordpress look like, ideally? How would you use it?

We have a Storybook set up that displays components rendered with PHP and Twig using a REST API endpoint on our WP install. Pretty crazy setup but it works. We use play functions in Storybook to fire the request and just render the returned HTML from the server.

Re: Storybook 8

#32
post #7

I'd be curious to hear from everyone what's the use case for using Storybook in 2024? The only one I can think of is developing a UI library, but for the usual SPA development, it seems to me that MSW provides a much smoother and less obtrusive dev experience without affecting how my app is architected.

Looks like MSW is just a network override, how is that comparable?

Re: Storybook 8

#33
post #7

I'd be curious to hear from everyone what's the use case for using Storybook in 2024? The only one I can think of is developing a UI library, but for the usual SPA development, it seems to me that MSW provides a much smoother and less obtrusive dev experience without affecting how my app is architected.

How is a network mocking tool equivalent to Storybook?

Same question here, I see absolutely no overlap between the two

Re: Storybook 8

#34
post #33

Earlier quoted context omitted.

How is a network mocking tool equivalent to Storybook?

Same question here, I see absolutely no overlap between the two

Totally bizarre, it's the second time in the thread I saw this comparison being drawn. From what I've seen in the past HN seems to fail to understand ideas like "design systems" and "component libraries" or sometimes even frontend at large, perhaps the confusion comes from there...

Re: Storybook 8

#35
post #33

Earlier quoted context omitted.

Same question here, I see absolutely no overlap between the two

Totally bizarre, it's the second time in the thread I saw this comparison being drawn. From what I've seen in the past HN seems to fail to understand ideas like "design systems" and "component libraries" or sometimes even frontend at large, perhaps the confusion comes from there...

Looks like the same person raising it in both cases.

Re: Storybook 8

#36
post #12

Earlier quoted context omitted.

I've used Storybook during development for a while now and the use case you present is how the Storybook is usually pitched. I actually agree about the simplicity of discovering the components. What I disagree with, though, is that I can't see the value of "develop & test your UI independently from your app" part. It forces me to decouple the state from a component and this in turn adds unnecessary complexity to the…

I don't think the point is to isolate all state. In the SiloUtilizationPage, I would assume that the hard part is getting the result of the two useApiQuery calls. The other state could be set up by clicking around or in a `play()` function. Since you're using ReactQuery, you can just create a separate QueryClient for testing, call `setQueryData` on it, and then pass it in through a context. That way you could render…

> I don't think the point is to isolate all state

We may have been using it incorrectly in my team, but our pattern is moving out all of the state out of the component, essentially separating the logic from the view.

Re: Storybook 8

#37
post #7

I'd be curious to hear from everyone what's the use case for using Storybook in 2024? The only one I can think of is developing a UI library, but for the usual SPA development, it seems to me that MSW provides a much smoother and less obtrusive dev experience without affecting how my app is architected.

How is a network mocking tool equivalent to Storybook?

It's not equivalent. Storybook has lots of features and plugins that make it useful.

What I'm saying is that effectively, my team has been using Storybook to develop components in isolation from the backend or the rest of the app and this was the main feature that we utilized. For example, we develop whole pages in Storybook. Our use case is that we also don't have a component library which is what people use it for primarily, from my understanding. Component library is a valid use case for teams who have a homegrown set of components but we don't have one.

So in our use case, developing a component in Storybook meant writing a story that passes all of the props and different prop variations to a component that doesn't have any state inherently. Swapping Storybook to MSW allowed us to avoid structuring components in a specific way (e.g. separating state from the JSX) while retaining the benefits of not having to have a complete backend.

In conclusion, we used both tools primarily to develop our SPA in separation from the backend. MSW filled this niche (which was specific to us) better.

Re: Storybook 8

#38
post #33

Earlier quoted context omitted.

Same question here, I see absolutely no overlap between the two

Totally bizarre, it's the second time in the thread I saw this comparison being drawn. From what I've seen in the past HN seems to fail to understand ideas like "design systems" and "component libraries" or sometimes even frontend at large, perhaps the confusion comes from there...

It's totally unfair to say that we don't understand design systems or component libraries when I mentioned in multiple comments that in our case we don't have a component library. Component library is a valid use case, as I mentioned previously, but it seems to me that our setup with no component library is fairly uncommon.
Post reply on HN