Live data from Hacker News

Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?

finnian.io

1–10 of 44 posts

Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?

#2
I've been using view_components for a while, and there's no going back for me. Much easier to organise views and keep them modular and easy to change and reuse. Only thing I haven't figured out yet is refactoring, how to organise a large number of views into folders / modules without having to move tons of files manually or script it.

Tailwind is pretty useful as well, but definitely needs a component system like this, or an application of the Atomic Design principles to not have to repeat your styles hundreds of times all over the place.

Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?

#3
I've used view component heavily over the last year or so, it's an amazing library. It perfectly fits the gap between helpers and partials and really does help keep things well organised.

I maintain a library of components and being able to spin up a new project and hit the ground running makes for a great experience.

I'm looking at documenting with lookbook instead of storybook, but both look decent.

https://github.com/allmarkedup/lookbook

Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?

#4
post #2

I've been using view_components for a while, and there's no going back for me. Much easier to organise views and keep them modular and easy to change and reuse. Only thing I haven't figured out yet is refactoring, how to organise a large number of views into folders / modules without having to move tons of files manually or script it. Tailwind is pretty useful as well, but definitely needs a component system like thi…

Are you using the sidecar setup?

Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?

#5
post #3

I've used view component heavily over the last year or so, it's an amazing library. It perfectly fits the gap between helpers and partials and really does help keep things well organised. I maintain a library of components and being able to spin up a new project and hit the ground running makes for a great experience. I'm looking at documenting with lookbook instead of storybook, but both look decent. https://github.…

Lookbook _looks_ interesting. We use some React in some places of our app which is why I went with Storybook for now, as I figured we could render both types of components (Rails & React) in the same library, which I thought could be neat.

How does Lookbook stack up against Storybook? Always keen to stay in the Ruby ecosystem if possible :-)

Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?

#7
post #3

I've used view component heavily over the last year or so, it's an amazing library. It perfectly fits the gap between helpers and partials and really does help keep things well organised. I maintain a library of components and being able to spin up a new project and hit the ground running makes for a great experience. I'm looking at documenting with lookbook instead of storybook, but both look decent. https://github.…

The more stuff like this I see (Rails view components and HTML over the wire) the more I realize how, for lack of a better word, "advanced" ASP.Net MVC was over 10 years ago...

Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?

#8
post #3

I've used view component heavily over the last year or so, it's an amazing library. It perfectly fits the gap between helpers and partials and really does help keep things well organised. I maintain a library of components and being able to spin up a new project and hit the ground running makes for a great experience. I'm looking at documenting with lookbook instead of storybook, but both look decent. https://github.…

Lookbook _looks_ interesting. We use some React in some places of our app which is why I went with Storybook for now, as I figured we could render both types of components (Rails & React) in the same library, which I thought could be neat. How does Lookbook stack up against Storybook? Always keen to stay in the Ruby ecosystem if possible :-)

I only tested it out a couple of days ago, I'm no expert.

So far it's been plain sailing, I'm already familiar with Yard-style docs and getting everything up and running from the spec/dummy app was really straightforward.

The library I maintain currently uses a home-rolled docs page (https://dfe-digital.github.io/govuk-components/) that needs to be refreshed manually. It's been an 'ok' approach until now but as it's matured we need something that's automated and easier to maintain.

Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?

#9
post #7
post #3

I've used view component heavily over the last year or so, it's an amazing library. It perfectly fits the gap between helpers and partials and really does help keep things well organised. I maintain a library of components and being able to spin up a new project and hit the ground running makes for a great experience. I'm looking at documenting with lookbook instead of storybook, but both look decent. https://github.…

The more stuff like this I see (Rails view components and HTML over the wire) the more I realize how, for lack of a better word, "advanced" ASP.Net MVC was over 10 years ago...

Yeah, that's undoubtedly the case.

Rails appears to have (Apple-style) taken some cues from elsewhere and made the user experience actually nice.

Post reply on HN