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...
Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?
11–20 of 44 posts
Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?
#12Earlier quoted context omitted.
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'…
Quick link for others: https://github.com/DFE-Digital/govuk-components
I'm going to take a look through the repo as I'm sure there's some patterns you've found given you're at a much bigger scale. Any hot tips?
Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?
#13Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?
#14Will this get the nod from dhh and make it into Rails? Dhh wdyt?
Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?
#15I'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?
#16Earlier quoted context omitted.
Are you using the sidecar setup?
Nope. Does the sidecar create a folder for each component?
`bin/rails g component Button --sidecar`
Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?
#17Will this get the nod from dhh and make it into Rails? Dhh wdyt?
I'm sure I read somewhere (either on viewcomponent.org or on their GitHub) that their end goal is to merge upstream into Rails core.
Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?
#18Earlier quoted context omitted.
I'm sure I read somewhere (either on viewcomponent.org or on their GitHub) that their end goal is to merge upstream into Rails core.
They merged the ability to hijack the renderer already in Rails 6 I think, which this gem uses. But if they wanted to merge this one into Rails , Rails 7 would have been a good timing. So I'm not really sure this will go into Rails actually.
Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?
#19Earlier quoted context omitted.
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'…
Wow that's awesome, I knew GDS had a design system but didn't realise there was a Ruby implementation. Quick link for others: https://github.com/DFE-Digital/govuk-components I'm going to take a look through the repo as I'm sure there's some patterns you've found given you're at a much bigger scale. Any hot tips?
My tip would be to not worry too much about covering every last detail or feature immediately, aim to do what most people need most of the time and release early - then if there's demand for extra stuff add it as you go.
Re: Ruby on Rails: View Components, Storybook and Tailwind - a match made in heaven?
#20I'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...