aviflombaum / shadcn-rails

https://shadcn.rails-components.com
MIT License
476 stars 32 forks source link

Use viewComponents instead of helper ? #14

Closed sergitejada closed 11 months ago

sergitejada commented 11 months ago

Using basic rails renders makes the code slow, since the advent of ViewComponents many companies have adopted it. ViewComponents allows for testing, component nesting and code organisation. I think migrating to ViewComponents would bring a lot of value and many developers would get involved, I would be one of them.

ViewComponets Github Component Library using VC I have created some complex components like NavList(menu allowing links, dropdowns, headers) or dialogs if you want to see an example.

aviflombaum commented 11 months ago

I'm hoping to somehow support vanilla rails, viewcomponent, and phlex, somehow. If you want to try to keep things as close to being able to work with render and a view component with one component and come up with a pattern for that, let's do it. I'll try to play with it too.

aviflombaum commented 11 months ago

I will be demonstrating how to wrap these easily in viewcomponents but am going to stick with the vanilla rails API and the render_ pattern which I like for some reason. Thanks for the thoughts and feedback though <3

iseth commented 9 months ago

Hey! Awesome gem! I was wondering if you did have any example of how i could wrap this into a view_component?